Partition resized, free disk space not updating

As you can see above the disk space on my OpenWRT device is showing 93.33MB. However, I used fdisk and cfdisk to expand the partition.

image

Does anyone know what file or function controls the "disk space" OpenWRT sees as available? Im trying to avoid having to do a full OW rebuild as others online have suggested.

Im gonna try the OpenWRT script in the mean time, however its labeled for x86 so not sure if it will work or cause a mess. :smiley:

that would only resize the partition.

did you resize the FS afterwards ?

1 Like

No I believe that's the file or function I'm looking to find.

I did write the partition record to the disk.

resize2fs is what you're looking for.

FYI, I changed the thread topic, hope you don't mind.

1 Like

Thank you ill give that a look!

root@OWRTRPI58GB:~# resize2fs -P /dev/root
resize2fs 1.47.0 (5-Feb-2023)
open: No such file or directory while opening /dev/root
root@OWRTRPI58GB:~# resize2fs -P /
resize2fs 1.47.0 (5-Feb-2023)
resize2fs: Is a directory while trying to open /
Couldn't find valid filesystem superblock.

Posting this here to see if anyone knows the solution. I read through the readme's on resize2fs. It says, for making a file system bigger you dont have to unmount.

'/dev/mmcblk0p2' is '/dev/root' on mount point '/'

/dev/mmcblk0p2: LABEL="rootfs" UUID="ff313567-e9f1-5a5d-9895-3ba130b4a864" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="10649237-02"

resize2fs /dev/mmcblk0p2

1 Like
root@OWRTRPI58GB:~# resize2fs /dev/mmcblk0p2
resize2fs 1.47.0 (5-Feb-2023)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/mmcblk0p2 to 524288 (4k) blocks.
resize2fs: Invalid argument While trying to add group #1

Sorry I had tried that before as well but didnt post it.

remount -o ro, or perhaps boot openwrt off a flash drive, and resize from there.
booting gparted works too, obviously.

is assume it's not a squashfs ? otherwise it can't be done with a plain resize2fs.

1 Like

Ill give that a try and no its not SFS.

Kernel Messages

[ 4022.357908] EXT4-fs warning (device mmcblk0p2): ext4_resize_fs:2194: error (-22) occurred during file system resize
[ 4022.368391] EXT4-fs (mmcblk0p2): resized filesystem to 32768
[ 4022.389676] EXT4-fs warning (device mmcblk0p2): reserve_backup_gdb:1052: reserved block 8 not at offset 7

Looks like I might not have a choice I'm gonna have to rebuild the image or use GParted on the SD card externally.

Thanks everyone for your help!

Got it figured out from an old x86 post. With some of the input here. Before doing this you must have tune2fs installed. If you RO the FS you cant install anything.

# mount -o remount,ro / #Remount root as ReadOnly
# tune2fs -O^resize_inode /dev/mmcblk0p2 #Remove reserved GDT blocks
Fix part, answer yes to remove GDT blocks remnants and all other fixes.
#reboot
#resize2fs /dev/mmcblk0p2
2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.