OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Johann Neuhauser - 31.03.2020

FS#2951 - x86_64 ext4 generic: online resizing of root partition fails

Used HW/SW:

- PCEngines APU2C4
- OpenWrt SNAPSHOT, r12776-437eb41f23

Steps to reproduce:

- Install needed packages:

root@OpenWrt:~# opkg update && opkg install fdisk resize2fs

- Extend root partition from 104 MB to 256 MB with fdisk:

root@OpenWrt:~# fdisk /dev/mmcblk0 << EOF
p
d
2
n
p
2
33792
+256M

w
EOF

- Extend ext4 filesystem:

root@OpenWrt:~# resize2fs /dev/mmcblk0p2

Here are the output of resize2fs:

root@OpenWrt:~# resize2fs /dev/mmcblk0p2 
resize2fs 1.45.4 (23-Sep-2019)
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 65664 (4k) blocks.
resize2fs: Invalid argument While trying to add group #1

Here are the dmesg output:

root@OpenWrt:~# dmesg | tail -n 6
[50698.949591] EXT4-fs (mmcblk0p2): resizing filesystem from 32768 to 65664 blocks
[50698.957030] EXT4-fs (mmcblk0p2): resizing filesystem from 32768 to 65536 blocks
[50698.969299] EXT4-fs warning (device mmcblk0p2): reserve_backup_gdb:1033: reserved block 8 not at offset 7
[50698.978959] EXT4-fs warning (device mmcblk0p2): ext4_resize_fs:2120: error (-22) occurred during file system resize
[50698.989429] EXT4-fs (mmcblk0p2): resized filesystem to 32768
[50698.999227] EXT4-fs warning (device mmcblk0p2): reserve_backup_gdb:1033: reserved block 8 not at offset 7

Offline resizing does work as expected.

Johann Neuhauser commented on 31.03.2020 13:44

Some time ago i´m able to install all needed packages into my rootfs partition without the need of resizing.

The following commits changed the old size of 256 MB first to 128 MB and later to 104 MB.
https://github.com/openwrt/openwrt/commit/469ba337a73586573699be3999bfdf6f9ebe404f
https://github.com/openwrt/openwrt/commit/61c57af618e264e9ed3ebd795eb923cbf32797c8

This really sucks as i do not understand the reason for such small and not resizeable rootfs partiitons on the x86_64 target.

Lukas Wingerberg commented on 19.09.2020 11:56

I can confirm this issue,
having exactly the same outputs with todays trunk builds on my APU2 hardware as reported by the user above.

root@OpenWrt:~# 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 = 1
resize2fs: Invalid argument While checking for on-line resizing support
[  275.145363] EXT4-fs (sda2): resizing filesystem from 26624 to 3905430 blocks
[  275.153734] EXT4-fs warning (device sda2): reserve_backup_gdb:1033: reserved block 8 not at offset 7
[  275.162926] EXT4-fs warning (device sda2): ext4_resize_fs:2120: error (-22) occurred during file system resize
[  275.172949] EXT4-fs (sda2): resized filesystem to 32768
[  275.178220] EXT4-fs warning (device sda2): ext4_group_extend:1804: can't shrink FS - resize aborted
Mario Tremblay commented on 10.03.2021 19:46

Issue was already present in the x86_64 image on 19.07.7
(Using CompuLab fit-PC4, not far from a PCEngines APU2C4)

Could be related to the partition not aligned to 4k boundary.
Following workaround has allowed me to resize the ext4 "root":

mount -o remount,ro / #Remount root as ReadOnly
tune2fs -O^resize_inode /dev/mmcblk0p2 #Remove reserved GDT blocks
fsck.ext4 /dev/mmcblk0p2 #Fix part, answer yes to remove GDT blocks remnants

#reboot
resize2fs /dev/mmcblk0p2
Orev commented on 03.10.2021 03:13

I'm seeing the same issue on the 21.02.0 release and Mario's workaround did seem to work. However, I had better success resizing it when booted to a live USB (Fedora in my case). Using tune2fs/fsck causes the filesystem to need repairs, which just doesn't seem like the "right" way to approach it.

SiNONiMiTY commented on 10.01.2022 12:57

This is working. Must be added as a reference for those who needs this.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing