Expanding root partition and filesystem

Tested this:

and does not work

X86 CR25Wing with 4 GB CompactFlash & also with a 250 Gb HDD

remove the > /dev/null in the script, and post the output.
post /etc/mtab too.

assume you've also installed the required packages ?

1 Like

i have removed the 3 lines with > /dev/null

no output

for /etc/mtab same

i have packages
opkg update
opkg install parted losetup resize2fs wget-ssl

if not wget-ssl i have an download error

you really need to start pasting some cli output, currently we're still at "it doesn't work".

wget-ssl is only for getting the script, not running it.

no output

i use a serial console

for the wget script edited with 3 > /dev/null removed same


ls -l /etc/uci-defaults/70-rootpt-resize /etc/rootpt-resize /etc/uci-defaults/80-rootfs-resize /etc/sysupgrade.conf

ubus call system board | jsonfilter -e "$['rootfs_type']"

root@OpenWrt:/# ls -l /etc/uci-defaults/70-rootpt-resize /etc/rootpt-resize /etc
/uci-defaults/80-rootfs-resize /etc/sysupgrade.conf
 call system boa-rw-r--r--    1 root     root             0 Nov  7 09:31 /etc/rootpt-resize
-rw-r--r--    1 root     root           898 Nov  7 10:05 /etc/sysupgrade.conf
-rw-r--r--    1 root     root           387 Nov  7 10:05 /etc/uci-defaults/70-rootpt-resizerd |
-rw-r--r--    1 root     root           668 Nov  7 10:00 /etc/uci-defaults/80-rootfs-resize
root@OpenWrt:/# ubus call system board | jsonfilter -e "$['rootfs_type']"

this is interesting, post ubus call system board.

I get ext4 as reply when I run ubus call system board | jsonfilter -e "$['rootfs_type']" (which is accurate).

"kernel": "5.10.176",
"hostname": "OpenWrt",
"system": "Intel(R) Atom(TM) CPU  E3845  @ 1.91GHz",
"model": "Roqos Roqos Core RC10",
"board_name": "roqos-roqos-core-rc10",
"rootfs_type": "ext4",
root@OpenWrt:/# ubus call system board
        "kernel": "5.4.143",
        "hostname": "OpenWrt",
        "system": "AMD GX-412TC SOC",
        "model": "To be filled by O.E.M. To be filled by O.E.M.",
        "board_name": "to-be-filled-by-o-e-m-to-be-filled-by-o-e-m",
        "release": {
                "distribution": "OpenWrt",
                "version": "21.02.0",
                "revision": "r16279-5cc0535800",
                "target": "x86/64",
                "description": "OpenWrt 21.02.0 r16279-5cc0535800"

upgrade, perhaps ?

for the moment I think that the script does not work at all...

how can it, when ubus call system board isn't producing the expected output ?
don't blame your outdated openwrt version.

21.02 is EOL anyway, AFAIK.

1 Like

i build at this time 23.05.0 witn firmware selector

I will come back this afternoon I am going to the doctor

I came back for a moment, the doctor has not yet returned to the office


with 22.05 disk is expanded but script not reboot

after i have with the 250GB HDD each reboot i have:

[7.162671] mount_root: mounting /dev/root
[7.168627] EXT4-fs (sda2): warning: mounting unchecked fs, running e2fsck is recommended
[7.186703] EXT4-fs (sda2): re-mounted. Opts: (null). Quota mode: disabled.
[7.295753] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupted. Please run fsck.

Another error

root@OpenWrt:/# firstboot
This will erase all settings and remove any installed packages. Are you sure? [N/y]
MTD partition 'rootfs_data' not found

that's no error.

you're using x86 on ext4, firstboot doesn't really work here.

work as designed

I ahve some others errors

[ 305.655145] EXT4-fs (sda2): error count since last fsck: 2
[ 305.660694] EXT4-fs (sda2): initial error at time 1699359089: ext4_validate_block_bitmap:428
[ 305.669223] EXT4-fs (sda2): last error at time 1699359090: ext4_readdir:258: inode 83: block 597

I'm going to try in squashfs
before I used gparted not compatible

I've never had any issues with ext4, and I've owned a couple Cyberoam CRx5s.

I might however have used the x86 platform in a different way, with two parallell installs.
Write rootfs manually, from the running openwrt, then resize partition and file system, finally boot into the new version.

I may solve this problem, according to above offical document, expand script will only execute once, if you already done this when you custumise you image, you need to remove below two file:

  1. /etc/rootpt-resize
  2. /etc/rootfs-resize

after that, reboot your machine, then you got your root filesystem growed.