]> gitweb.fluxo.info Git - hydra.git/commitdiff
Fix: hydractl: provision: check partitions' alignment
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 9 Jan 2022 21:46:52 +0000 (18:46 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 9 Jan 2022 21:46:52 +0000 (18:46 -0300)
share/hydractl/provision

index c219a0f4c91c5353c042b58de64e09fa32a1a8de..e0fa24837a020f681afd5f0158687ab72cb8dd62 100755 (executable)
@@ -270,7 +270,11 @@ else
 #quit
 #EOF
 
-  hydra_sudo_run parted -s -- $device set     1  bios_grub on
+  # Se GRUB flag
+  hydra_sudo_run parted -s -- $device set 1 bios_grub on
+
+  # Check alignment
+  hydra_sudo_run parted -s -- $device align-check optimal 1
 
   if [ "$encrypt" == "y" ]; then
     # Second partition must also be aligned by a multiple of $optimal_sector_size
@@ -282,6 +286,9 @@ else
     hydra_sudo_run parted -s -- $device mkpart ext2 ${lvm_start}s -1
     hydra_sudo_run parted -s -- $device set    2    lvm on
 
+    # Check alignment
+    hydra_sudo_run parted -s -- $device align-check optimal 2
+
     boot_device="${device}${partition_separator}2"
     syst_device="${device}${partition_separator}2"
   else
@@ -299,6 +306,10 @@ else
     hydra_sudo_run parted -s -- $device mkpart ext2 ${lvm_start}s -1
     hydra_sudo_run parted -s -- $device set    3    lvm on
 
+    # Check alignment
+    hydra_sudo_run parted -s -- $device align-check optimal 2
+    hydra_sudo_run parted -s -- $device align-check optimal 3
+
     boot_device="${device}${partition_separator}2"
     syst_device="${device}${partition_separator}3"
   fi