]> gitweb.fluxo.info Git - hydra.git/commitdiff
Fix: hydractl: provision: default optimal size should be 1 MiB
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 9 Jan 2022 21:36:55 +0000 (18:36 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 9 Jan 2022 21:36:55 +0000 (18:36 -0300)
share/hydractl/provision

index 3176f218a1c6318cc2d77e9066a4df467e141895..35137ee5961a9240158b8025ad04aa50b5080d03 100755 (executable)
@@ -235,9 +235,12 @@ else
   block="`echo $device | sed -e 's|^/dev/||'`"
   optimal_size="`cat /sys/block/$block/queue/optimal_io_size`"
 
+  # Use a default of 1 MiB for the optimal size
   # See https://access.redhat.com/articles/3911611
+  #     https://blog.hqcodeshop.fi/archives/273-GNU-Parted-Solving-the-dreaded-The-resulting-partition-is-not-properly-aligned-for-best-performance.html
+  #     http://opensource.hqcodeshop.com/Parted%20calculator/parted_mkpart_calc.sh
   if [ "$optimal_size" == "0" ]; then
-    optimal_size="1024"
+    optimal_size="$megabyte"
   fi
 
   alignment_offset="`cat /sys/block/$block/alignment_offset`"