I am getting below error when execute the resize2fs command.
root@OpenWrt:/etc# resize2fs /dev/sda2
resize2fs 1.45.6 (20-Mar-2020)
Filesystem at /dev/sda2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 15
Performing an on-line resize of /dev/sda2 to 61045422 (4k) blocks.
resize2fs: Invalid argument While trying to add group #1
root@OpenWrt:/etc#
Update: Above issue got fixed after router rebook. But when executing resize command connection getting reset and its taking lot of time. Any suggestions?
I'm another user who have sucessfully installed OpenWrt 21.02-rc2 to a 64GB msata SSD on a x86 based Qotom computer. Everything works as expected, except it started showing differing sizes for /dev/sda2, depending on where I look:
I have originally expanded the /dev/sda2 partition offline, by booting from an USB linux live-cd type operating system. From there I was able to successfully expand the second partition to occupy all the remaining disk space. It was done by deleting the original /dev/sda2 partition and recreating it as a primary ext4 partition that started at sector 33792 and ended at the last available sector (which is what you get if you simply press enter when prompted for the ending sector). I then run e2fsfck and resize2fs commands and got successful messages from both commands.
After rebooting for the first time, I was able to confirm from Luci System/Software, that the resize operation was indeed successful.
But, somehow, after I got my system fully configured and I had moved it to its definitive place inside a cupboard, yesterday I started noticing the Luci System/Software output was off, as if I had not expanded the partition.
So, I'm scratching my head without knowing what to do next.
I have already tried running resize2fs /dev/sda2 ONLINE from inside OpenWrt, but I keep getting the following:
root@Qotom:~# resize2fs /dev/sda2
resize2fs 1.45.6 (20-Mar-2020)
Filesystem at /dev/sda2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 4
Performing an on-line resize of /dev/sda2 to 15626326 (4k) blocks.
resize2fs: Invalid argument While trying to add group #1
At the end of the link, there are a couple commands to try. In short, I had to download and install tune2fs package into OpenWrt and run a few commands:
root@Qotom:~# mount -o remount,ro /
root@Qotom:~# cd /boot
root@Qotom:/boot# tune2fs -O^resize_inode /dev/sda2
tune2fs 1.45.6 (20-Mar-2020)
Please run e2fsck -f on the filesystem.
(and reboot afterwards!)
root@Qotom:/boot# e2fsck -f /dev/sda2
e2fsck 1.45.6 (20-Mar-2020)
Filesystem does not have resize_inode enabled, but s_reserved_gdt_blocks
is 7; should be zero. Fix<y>? yes
Resize_inode not enabled, but the resize inode is non-zero. Clear<y>? yes
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences: -(2--8) -427
Fix<y>? yes
Free blocks count wrong for group #0 (26164, counted=26172).
Fix<y>? yes
Free blocks count wrong (26164, counted=26172).
Fix<y>? yes
Padding at end of inode bitmap is not set. Fix<y>? yes
rootfs: ***** FILE SYSTEM WAS MODIFIED *****
rootfs: ***** REBOOT SYSTEM *****
rootfs: 1963/6656 files (0.1% non-contiguous), 6596/32768 blocks
root@Qotom:/boot# fsck.ext4 /dev/sda2
e2fsck 1.45.6 (20-Mar-2020)
rootfs: clean, 1963/6656 files, 6596/32768 blocks
root@Qotom:/boot# reboot now
root@Qotom:/boot# Connection to 192.168.3.1 closed by remote host.
Connection to 192.168.3.1 closed.
After reboot, I ran
root@Qotom:~# resize2fs /dev/sda2
resize2fs 1.45.6 (20-Mar-2020)
Filesystem at /dev/sda2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 4
The filesystem on /dev/sda2 is now 15626326 (4k) blocks long.
And now Luci System/Software show the following, as expected: