From 5bd1bad62e0c36b83a96daea15baffdd9c34818c Mon Sep 17 00:00:00 2001 From: Googulator Date: Mon, 13 Nov 2023 10:20:04 +0100 Subject: [PATCH] Start Linux rootfs partition at 1M, not sector 1 This improves partition alignment, and therefore performance on SSDs and AF (4K-sectored) HDDs. Also, it leaves some space before the partition to allow installing GRUB. --- sysb/run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sysb/run.sh b/sysb/run.sh index 653a66e6..4fc3baa6 100755 --- a/sysb/run.sh +++ b/sysb/run.sh @@ -69,7 +69,8 @@ fi # shellcheck disable=SC2012 if [ $(($(ls -l "/dev/${DISK}" | sed "s/.*, *//" | sed "s/ .*//") % 8)) -eq 0 ]; then echo "Creating partition table..." - echo ";" | sfdisk "/dev/${DISK}" + # Convince our ancient sfdisk to align to megabytes, not cylinders + echo "2048;" | sfdisk -uS -S32 -H64 "/dev/${DISK}" fdisk -l "/dev/${DISK}" echo "Creating ext4 partition..." mkfs.ext4 "/dev/${DISK}1"