From c388eee81bc13b8aa12e7f802e06dd00b675b9e1 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Thu, 18 Apr 2024 17:24:09 +0200 Subject: [PATCH] busybox: use mke2fs instead of resize2fs This ensures the /storage filesystem will have the correct options (block size, inode_ratio etc) for the target partition size. Signed-off-by: Matthias Reichl --- packages/sysutils/busybox/scripts/fs-resize | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/sysutils/busybox/scripts/fs-resize b/packages/sysutils/busybox/scripts/fs-resize index a6f4f914a3..2d469e5187 100755 --- a/packages/sysutils/busybox/scripts/fs-resize +++ b/packages/sysutils/busybox/scripts/fs-resize @@ -47,10 +47,13 @@ if [ -e /storage/.please_resize_me ] ; then rm -f /storage/.please_resize_me sync - echo "DISK: $DISK PART: $PART" >>$LOG + LABEL=$(blkid -o value -s LABEL $PART) + UUID=$(blkid -o value -s UUID $PART) + + echo "DISK: $DISK PART: $PART LABEL: $LABEL UUID: $UUID" >>$LOG # just in case - if [ ! -z "$DISK" -a ! -z "$PART" ] ; then + if [ ! -z "$DISK" -a ! -z "$PART" -a ! -z "$UUID" ] ; then umount $PART echo "PARTITION RESIZING IN PROGRESS" @@ -59,8 +62,8 @@ if [ -e /storage/.please_resize_me ] ; then echo "" StartProgressLog spinner "Resizing partition... " "parted -s -f -m $DISK resizepart 2 100% >>$LOG 2>&1" + StartProgressLog spinner "Creating file system... " "mke2fs -F -q -t ext4 -m 0 -L \"$LABEL\" -U \"$UUID\" $PART >>$LOG 2>&1" StartProgressLog spinner "Checking file system... " "e2fsck -f -p $PART >>$LOG 2>&1" - StartProgressLog spinner "Resizing file system... " "resize2fs $PART >>$LOG 2>&1" StartProgress countdown "Rebooting in 15s... " 15 "NOW" else echo "Partition was not detected - resizing aborted."