MT#17529 Create partitions using optimal partition table alignment

parted supports the "-a optimal" option to get better alignment during partition table setup.

We should use that by default, since it:

a) shouldn't cause any harm on VMs anyway and
b) might improve performance especially on SSDs with non-standard
   optimal_io_size settings (as observed on a Samsung EVA 850
   with a setting of 33553920, so the partition should start
   at 33.6MB and not 1MiB/2048s)

NOTE: fai-setup-storage doesn't support setting the parted options
like "-a optimal" yet, reported as #812712 in Debian's BTS.

Change-Id: Ib1c49d4f2b405697f0dcac5f164473ea9f87557c
changes/82/4282/1
Michael Prokop 9 years ago
parent f4cc0e80f7
commit c17dfa6d18

@ -1165,11 +1165,11 @@ EOF
ROOT_FS="/dev/mapper/${VG_NAME}-root"
SWAP_PARTITION="/dev/mapper/${VG_NAME}-swap"
else # no LVM (default)
parted -s /dev/${DISK} mktable "$TABLE" || die "Failed to set up partition table"
else # no LVM
parted -s -a optimal /dev/${DISK} mktable "$TABLE" || die "Failed to set up partition table"
# hw-raid with rootfs + swap partition
parted -s /dev/${DISK} 'mkpart primary ext4 2048s 95%' || die "Failed to set up primary partition"
parted -s /dev/${DISK} 'mkpart primary linux-swap 95% -1' || die "Failed to set up swap partition"
parted -s -a optimal /dev/${DISK} 'mkpart primary ext4 2048s 95%' || die "Failed to set up primary partition"
parted -s -a optimal /dev/${DISK} 'mkpart primary linux-swap 95% -1' || die "Failed to set up swap partition"
sync
# used later by installer

Loading…
Cancel
Save