]> gitweb.fluxo.info Git - hydra.git/commitdiff
Provision: partition alignment: comments
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 12 May 2019 16:15:07 +0000 (13:15 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 12 May 2019 16:15:07 +0000 (13:15 -0300)
share/hydractl/provision

index ac786995648fd959b48de85c691dff5b20afe9e9..50c689ab9355ab9dd6d88f030bc566dfd3bb00e1 100755 (executable)
@@ -201,6 +201,9 @@ if [ "$num_devices" != "1" ]; then
   syst_device="$device"
 else
   # Partition alignment
+  # See https://rainbow.chard.org/2013/01/30/how-to-align-partitions-for-best-performance-using-parted/
+  #     https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-block
+  #     https://people.redhat.com/msnitzer/docs/io-limits.txt
   megabyte="$((1024*1024))"
   block="`echo $device | sed -e 's|^/dev/||'`"
   optimal_size="`cat /sys/block/$block/queue/optimal_io_size`"
@@ -209,10 +212,6 @@ else
   start="$((($optimal_size + $alignment_offset) / $block_size))"
   optimal_sector_size="$(($optimal_size / $block_size))"
 
-  #start="`awk -v x=$(cat /sys/block/$block/queue/optimal_io_size) \
-  #            -v y=$(cat /sys/block/$block/alignment_offset)      \
-  #            -v z=$(cat /sys/block/$block/queue/physical_block_size) 'BEGIN { print ( x + y ) / z }'`"
-
   # Sector size for a 1MB partition
   bios_grub_size="$(($megabyte/$block_size))"
   bios_grub_end="$(($start + $bios_grub_size - 1))"