aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-05-12 13:15:07 -0300
committerSilvio Rhatto <rhatto@riseup.net>2019-05-12 13:15:07 -0300
commite2ed854f9213e63345522a1891098d2e3b6fee03 (patch)
treef75245e6964ee5d36308028f40a0987d22b4242a /share
parent1703d6f8cfae4973ed5d84e60f3151b707303530 (diff)
downloadhydra-e2ed854f9213e63345522a1891098d2e3b6fee03.tar.gz
hydra-e2ed854f9213e63345522a1891098d2e3b6fee03.tar.bz2
Provision: partition alignment: comments
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydractl/provision7
1 files changed, 3 insertions, 4 deletions
diff --git a/share/hydractl/provision b/share/hydractl/provision
index ac78699..50c689a 100755
--- a/share/hydractl/provision
+++ b/share/hydractl/provision
@@ -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))"