Root FS is not expanded in LuCI but

I have expanded correctly the Root filesystem but LuCI is not showing this change

root@OpenWrt:~# fdisk /dev/sda

Welcome to fdisk (util-linux 2.39).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.


Command (m for help): p

Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: FPT310M4SSD256G
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 80CDD189-4CE8-125D-9E5C-32A6BB5C6500

Device      Start      End  Sectors  Size Type
/dev/sda1     512    33279    32768   16M Linux filesystem
/dev/sda2   33280 10272768 10239489  4.9G Linux filesystem
/dev/sda128    34      511      478  239K BIOS boot

Partition table entries are not in disk order.

Command (m for help): d
Partition number (1,2,128, default 128): 2

Partition 2 has been deleted.

Command (m for help): n
Partition number (2-127, default 2):
First sector (33280-500118158, default 34816): 33280
Last sector, +/-sectors or +/-size{K,M,G,T,P} (33280-500118158, default 500117503): 10485760

Created a new partition 2 of type 'Linux filesystem' and of size 5 GiB.
Partition #2 contains a ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: n

Command (m for help): w

The partition table has been altered.
Syncing disks.

root@OpenWrt:~#

Note: I changed the UUID in /boot/grub/grub.cfg correctly too. I rebooted and halted but still like this:

S1

lsblk output:

root@OpenWrt:~# lsblk
NAME     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda        8:0    0 238.5G  0 disk
├─sda1     8:1    0    16M  0 part
├─sda2     8:2    0     5G  0 part /
└─sda128 259:0    0   239K  0 part

Any idea why?

you missed resize2fs ?

I followed the guide with fdisk, not with losetup and resize2fs.

What i have to do with resize2fs?

losetup is for squashfs ...

run it on the resized partition ?

I mean.. resize2fs /dev/sda2?

I told you your method was incorrect here

1 Like

i finally completed that. it was a ip/dns issue but i have luci and ssh now. i dont know what method are you meaning

dont know how but now the /boot/grub/grub.cfg file doesnt exist.. :roll_eyes:
can i regenerate it somehow?

can i use this one? (changing UUID)

EDIT: tried but OpenWRT is not saving that change, do i need something like update-grub?

im using PARTUUID not UUID

you can pull it from the openwt image file.

that one's incomplete.

just use root=/dev/sda2

how?

did it. but still doesnt saving the file..

edit...: ok it was setparams not menuentry.. wow

Now we can afford follow this

as guide says..

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

dmesg command:

[  247.708634] EXT4-fs (sda2): resizing filesystem from 32768 to 1306560 blocks
[  247.710529] EXT4-fs warning (device sda2): reserve_backup_gdb:1034: reserved block 8 not at offset 7
[  247.711420] EXT4-fs warning (device sda2): ext4_resize_fs:2145: error (-22) occurred during file system resize
[  247.712375] EXT4-fs (sda2): resized filesystem to 32768
[  247.713645] EXT4-fs warning (device sda2): reserve_backup_gdb:1034: reserved block 8 not at offset 7
[  429.451857] EXT4-fs (sda2): resizing filesystem from 32768 to 1306560 blocks
[  429.452808] EXT4-fs warning (device sda2): reserve_backup_gdb:1034: reserved block 8 not at offset 7
[  429.453701] EXT4-fs warning (device sda2): ext4_resize_fs:2145: error (-22) occurred during file system resize
[  429.454658] EXT4-fs (sda2): resized filesystem to 32768
[  429.455629] EXT4-fs warning (device sda2): reserve_backup_gdb:1034: reserved block 8 not at offset 7
root@OpenWrt:~#

remount as read only, or boot from a flash drive, and do the resize from the booted OS.

1 Like

Done, thanks for the help frollic :black_heart:

had to execute e2fsck -f /dev/sda2 first as resize2fs -f /dev/sda2 command told me

interesting, I usually don't get that, but I'm always resizing from another OS, not openwrt itself.

I booted a OpenWRT live image, maybe for that reason..

btw, you can browse the openwrt image in windows, using 7zip, read only though.

1 Like

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