From 8fbe0ac9e3d11dbf4132ff1034a24fcedcc4d00d Mon Sep 17 00:00:00 2001 From: Diederik de Haas Date: Tue, 15 Nov 2022 17:25:59 +0100 Subject: [PATCH] Recheck the root filesystem after expanding it. Checking the root filesystem before mounting it is always a good idea. But after changing the root filesystem, it is especially important to (re-)check it to ensure everything went fine. So add that check. --- .../etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs b/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs index 64b4dee..3826847 100755 --- a/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs +++ b/rootfs/etc/initramfs-tools/scripts/local-bottom/rpi-resizerootfs @@ -45,6 +45,9 @@ wait_for_udev 5 partprobe "$rootdev" resize2fs "$rootpart" +# After resizing, (re)check the root partition's filesystem +fsck "$rootpart" + # Remount root # Don't quote ${ROOTFLAGS} as that results in an extra (empty) argument # to 'mount', which in turn causes a boot failure