From 00da85177cdd6a1446381fb45fd5439c9bba860a Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 4 May 2022 15:21:12 +0100 Subject: [PATCH] Adjust partition formatting and mount options Format the root partition with the metadata_csum option Format the boot partition with 4 sectors per cluster for a slight performance boost Remove 'flush' mount option from the boot partition --- export-image/prerun.sh | 4 ++-- export-noobs/00-release/files/partitions.json | 2 +- export-noobs/00-release/files/release_notes.txt | 4 +++- scripts/qcow2_handling | 4 ++-- stage1/01-sys-tweaks/files/fstab | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/export-image/prerun.sh b/export-image/prerun.sh index fad7f80..145d61e 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -70,12 +70,12 @@ if [ "${NO_PRERUN_QCOW2}" = "0" ]; then echo "/: offset $ROOT_OFFSET, length $ROOT_LENGTH" ROOT_FEATURES="^huge_file" - for FEATURE in metadata_csum 64bit; do + for FEATURE in 64bit; do if grep -q "$FEATURE" /etc/mke2fs.conf; then ROOT_FEATURES="^$FEATURE,$ROOT_FEATURES" fi done - mkdosfs -n boot -F 32 -v "$BOOT_DEV" > /dev/null + mkdosfs -n boot -F 32 -s 4 -v "$BOOT_DEV" > /dev/null mkfs.ext4 -L rootfs -O "$ROOT_FEATURES" "$ROOT_DEV" > /dev/null mount -v "$ROOT_DEV" "${ROOTFS_DIR}" -t ext4 diff --git a/export-noobs/00-release/files/partitions.json b/export-noobs/00-release/files/partitions.json index 3d06017..8ca103d 100644 --- a/export-noobs/00-release/files/partitions.json +++ b/export-noobs/00-release/files/partitions.json @@ -3,7 +3,7 @@ { "filesystem_type": "FAT", "label": "boot", - "mkfs_options": "-F 32", + "mkfs_options": "-F 32 -s 4", "partition_size_nominal": BOOT_NOM, "uncompressed_tarball_size": BOOT_SIZE, "want_maximised": false, diff --git a/export-noobs/00-release/files/release_notes.txt b/export-noobs/00-release/files/release_notes.txt index 331d8d9..4240372 100644 --- a/export-noobs/00-release/files/release_notes.txt +++ b/export-noobs/00-release/files/release_notes.txt @@ -1,5 +1,7 @@ UNRELEASED: - * + * Format the root partition with the metadata_csum option + * Format the boot partition with 4 sectors per cluster for a slight performance boost + * Remove 'flush' mount option from the boot partition 2022-04-04: * Default "pi” user has been removed; the first-boot wizard enforces the creation of a new user account * rename-user script added to allow existing users to be renamed by temporarily rebooting to cut-down first-boot wizard diff --git a/scripts/qcow2_handling b/scripts/qcow2_handling index 6b2a56b..66708e7 100644 --- a/scripts/qcow2_handling +++ b/scripts/qcow2_handling @@ -109,8 +109,8 @@ load_qimage() { EOF sync kpartx -as $NBD_DEV - mkdosfs -n boot -F 32 -v $MAP_BOOT_DEV - mkfs.ext4 -L rootfs -O "^huge_file,^metadata_csum,^64bit" $MAP_ROOT_DEV + mkdosfs -n boot -F 32 -s 4 -v $MAP_BOOT_DEV + mkfs.ext4 -L rootfs -O "^huge_file,^64bit" $MAP_ROOT_DEV sync else if [ ! -f "${WORK_DIR}/image-${PREV_STAGE}.qcow2" ]; then diff --git a/stage1/01-sys-tweaks/files/fstab b/stage1/01-sys-tweaks/files/fstab index 2159c1c..f16e3fb 100644 --- a/stage1/01-sys-tweaks/files/fstab +++ b/stage1/01-sys-tweaks/files/fstab @@ -1,3 +1,3 @@ proc /proc proc defaults 0 0 -BOOTDEV /boot vfat defaults,flush 0 2 +BOOTDEV /boot vfat defaults 0 2 ROOTDEV / ext4 defaults,noatime 0 1