Extroot config failed after reboot

My router is x86 with cpu 3205U using last stable openwrt version OpenWrt 21.02.0 r16279-5cc0535800 . My overlay space will be full, so I want to extend my overlay space to install more packages.

I follow up the guide of wiki page Extroot configuration but failed.

my fstab

root@OpenWrt:~# cat /etc/config/fstab

config global
	option anon_swap '0'
	option anon_mount '0'
	option auto_swap '1'
	option auto_mount '1'
	option check_fs '0'
	option delay_root '20'

config mount
	option target '/overlay'
	option uuid 'fb7604f7-b620-4368-9a31-8e051c89b735'
	option enabled '0'

config mount
	option target '/boot'
	option uuid '84173db5-fa99-e35a-95c6-28613cc79ea9'
	option enabled '0'

config mount
	option target '/rom'
	option uuid 'ca2e4295-6c2e7e2a-db5d7a18-d19e4084'
	option enabled '0'

config mount 'rwm'
	option device '/dev/loop0'
	option target '/rwm'
	option enabled '1'

config mount 'overlay'
	option uuid '2130c1dd-4c49-4724-bd7e-dd15bf45fb40'
	option target '/overlay'
	option enabled '1'

Block info

root@OpenWrt:~# block info
/dev/loop0: UUID="fb7604f7-b620-4368-9a31-8e051c89b735" LABEL="rootfs_data" VERSION="1.14" MOUNT="/overlay" TYPE="f2fs"
/dev/sda1: UUID="84173db5-fa99-e35a-95c6-28613cc79ea9" LABEL="kernel" VERSION="1.0" MOUNT="/boot" TYPE="ext4"
/dev/sda2: UUID="ca2e4295-6c2e7e2a-db5d7a18-d19e4084" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/sda3: UUID="2130c1dd-4c49-4724-bd7e-dd15bf45fb40" VERSION="1.0" TYPE="ext4"

df:

root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 4096      4096         0 100% /rom
tmpfs                  1975644       508   1975136   0% /tmp
/dev/loop0              100416     92776      7640  92% /overlay
overlayfs:/overlay      100416     92776      7640  92% /
/dev/sda1                16112      4876     10912  31% /boot
/dev/sda1                16112      4876     10912  31% /boot
tmpfs                      512         0       512   0% /dev

I also follow up the troubleshooting method

uci set fstab.@global[0].delay_root="15"

uci set about fstab

root@OpenWrt:~# uci show | grep fsta
fstab.@global[0]=global
fstab.@global[0].anon_swap='0'
fstab.@global[0].anon_mount='0'
fstab.@global[0].auto_swap='1'
fstab.@global[0].auto_mount='1'
fstab.@global[0].check_fs='0'
fstab.@global[0].delay_root='20'
fstab.@mount[0]=mount
fstab.@mount[0].target='/overlay'
fstab.@mount[0].uuid='fb7604f7-b620-4368-9a31-8e051c89b735'
fstab.@mount[0].enabled='0'
fstab.@mount[1]=mount
fstab.@mount[1].target='/boot'
fstab.@mount[1].uuid='84173db5-fa99-e35a-95c6-28613cc79ea9'
fstab.@mount[1].enabled='0'
fstab.@mount[2]=mount
fstab.@mount[2].target='/rom'
fstab.@mount[2].uuid='ca2e4295-6c2e7e2a-db5d7a18-d19e4084'
fstab.@mount[2].enabled='0'
fstab.rwm=mount
fstab.rwm.device='/dev/loop0'
fstab.rwm.target='/rwm'
fstab.rwm.enabled='1'
fstab.overlay=mount
fstab.overlay.uuid='2130c1dd-4c49-4724-bd7e-dd15bf45fb40'
fstab.overlay.target='/overlay'
fstab.overlay.enabled='1'
ucitrack.@fstab[0]=fstab
ucitrack.@fstab[0].exec='/sbin/block mount'

start log about fs

root@OpenWrt:~# logread | grep fs
Tue Feb 15 03:52:12 2022 kern.info kernel: [    2.538673] squashfs: version 4.0 (2009/01/31) Phillip Lougher
Tue Feb 15 03:52:12 2022 kern.info kernel: [    3.250431] VFS: Mounted root (squashfs filesystem) readonly on device 8:2.
Tue Feb 15 03:52:12 2022 kern.notice kernel: [    6.979824] F2FS-fs (loop0): Mounted with checkpoint version = 5a9dd90d
Tue Feb 15 03:52:12 2022 user.info kernel: [    7.117680] block: attempting to load /etc/config/fstab
Tue Feb 15 03:52:12 2022 user.err kernel: [    7.123115] block: unable to load configuration (fstab: Entry not found)
Tue Feb 15 03:52:12 2022 user.info kernel: [    7.135146] mount_root: switching to f2fs overlay
Tue Feb 15 03:52:12 2022 kern.info kernel: [    7.140525] overlayfs: "xino" feature enabled using 32 upper inode bits.
Tue Feb 15 03:52:12 2022 kern.warn kernel: [    7.187326] EXT4-fs (sda1): warning: mounting unchecked fs, running e2fsck is recommended
Tue Feb 15 03:52:12 2022 kern.info kernel: [    7.200615] EXT4-fs (sda1): mounted filesystem without journal. Opts: (null)
Tue Feb 15 03:52:13 2022 user.notice ucitrack: Setting up non-init /etc/config/fstab reload handler: /sbin/block mount

preinit log:

root@OpenWrt:~# logread | sed -n -e "/- preinit -/,/- init -/p"
Tue Feb 15 03:52:12 2022 user.info kernel: [    3.598269] init: - preinit -
Tue Feb 15 03:52:12 2022 kern.notice kernel: [    3.753949] random: jshn: uninitialized urandom read (4 bytes read)
Tue Feb 15 03:52:12 2022 kern.notice kernel: [    3.766732] random: jshn: uninitialized urandom read (4 bytes read)
Tue Feb 15 03:52:12 2022 kern.notice kernel: [    3.775747] random: jshn: uninitialized urandom read (4 bytes read)
Tue Feb 15 03:52:12 2022 kern.warn kernel: [    6.830257] urandom_read: 4 callbacks suppressed
Tue Feb 15 03:52:12 2022 kern.notice kernel: [    6.830259] random: jshn: uninitialized urandom read (4 bytes read)
Tue Feb 15 03:52:12 2022 kern.notice kernel: [    6.863468] random: procd: uninitialized urandom read (4 bytes read)
Tue Feb 15 03:52:12 2022 kern.notice kernel: [    6.979824] F2FS-fs (loop0): Mounted with checkpoint version = 5a9dd90d
Tue Feb 15 03:52:12 2022 user.info kernel: [    6.989350] mount_root: loading kmods from internal overlay
Tue Feb 15 03:52:12 2022 user.info kernel: [    7.040761] kmodloader: loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
Tue Feb 15 03:52:12 2022 user.info kernel: [    7.049544] kmodloader: done loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
Tue Feb 15 03:52:12 2022 user.info kernel: [    7.117680] block: attempting to load /etc/config/fstab
Tue Feb 15 03:52:12 2022 user.err kernel: [    7.123115] block: unable to load configuration (fstab: Entry not found)
Tue Feb 15 03:52:12 2022 user.err kernel: [    7.130018] block: no usable configuration
Tue Feb 15 03:52:12 2022 user.info kernel: [    7.135146] mount_root: switching to f2fs overlay
Tue Feb 15 03:52:12 2022 kern.info kernel: [    7.140525] overlayfs: "xino" feature enabled using 32 upper inode bits.
Tue Feb 15 03:52:12 2022 kern.warn kernel: [    7.187326] EXT4-fs (sda1): warning: mounting unchecked fs, running e2fsck is recommended
Tue Feb 15 03:52:12 2022 kern.info kernel: [    7.200615] EXT4-fs (sda1): mounted filesystem without journal. Opts: (null)
Tue Feb 15 03:52:12 2022 user.warn kernel: [    7.211518] urandom-seed: Seeding with /etc/urandom.seed
Tue Feb 15 03:52:12 2022 user.info kernel: [    7.236151] procd: - early -
Tue Feb 15 03:52:12 2022 user.info kernel: [    7.762489] procd: - ubus -
Tue Feb 15 03:52:12 2022 kern.notice kernel: [    7.772452] random: ubusd: uninitialized urandom read (4 bytes read)
Tue Feb 15 03:52:12 2022 user.info kernel: [    7.820267] procd: - init -

What are you booting from?

On a non flash device, you usually just resize the partition and file system, instead of messing around with exroot...

BTW, 21.02.1 is the latest stable.

1 Like

Thanks for the response.BTW I missing the latest version21.02.1:)
My device booting from /dev/sda1 non flash device.

fdisk info

root@OpenWrt:~# fdisk -l
Disk /dev/loop0: 100.06 MiB, 104923136 bytes, 204928 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 14.75 GiB, 15837691904 bytes, 30932992 sectors
Disk model: BR 16G
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: dos
Disk identifier: 0xd0f061a8

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sda1  *       512    33279    32768   16M 83 Linux
/dev/sda2        33792   246783   212992  104M 83 Linux
/dev/sda3       247808 30932991 30685184 14.6G 83 Linux

from the df info above the /overlay size is total: 100416(98m) while /sda/sda2 is 104M?

so what need i to do to extends the overlay size, resize the /dev/sda2 partition?

Thanks.

100M overlay is the default size.

You need to shrink the sda3 first, so sda2 can be extended,
or delete sda3, extend sda2, and recreate sda3.

https://gparted.org/livecd.php can do most of the job for you, except resizing the
squashfs, it doesn't seem to support it.
https://openwrt.org/docs/guide-user/installation/installation_methods/sd_card
Expanding the squashfs file system

or just start from scratch, it'll happen if you upgrade to 21.02.1 anyway.
I'd move from squashfs to ext4, if you're considering a reinstall.

1 Like

If I can delete sd3(14.6G) and resize sda2 to make it large?

Does overlay mount on /dev/sda2? right?

If I am not considering a reinstall, how can I make overlay size large than 100m to install more package ?

If there is no method to extends the overlay size, I will considering a reinstall.

Thanks.

yes

yes

as in the link provided.

1 Like

After My resize the /dev/sda2 size , the overlay size will extend to the new size large than 100m right?
This method will allow me extends the overlay size instead of reinstall right?

yes, it will.

Sad, : '(, it does not works for me.
I have extends the /dev/sda2 size to 5 GB, but overlay size is still 98M

the new df

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 4.0M      4.0M         0 100% /rom
tmpfs                     1.9G     92.0K      1.9G   0% /tmp
/dev/loop0               98.1M     91.6M      6.5M  93% /overlay
overlayfs:/overlay       98.1M     91.6M      6.5M  93% /
/dev/sda1                15.7M      4.8M     10.7M  31% /boot
/dev/sda1                15.7M      4.8M     10.7M  31% /boot
tmpfs                   512.0K         0    512.0K   0% /dev

the new fdisk info

root@OpenWrt:~# fdisk -l
Disk /dev/loop0: 5 GiB, 5364580352 bytes, 10477696 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 14.75 GiB, 15837691904 bytes, 30932992 sectors
Disk model: BR 16G
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: dos
Disk identifier: 0xd0f061a8

Device     Boot Start      End  Sectors Size Id Type
/dev/sda1  *      512    33279    32768  16M 83 Linux
/dev/sda2       33792 10519551 10485760   5G 83 Linux

I'm no squashfs expert (one of the reasons why I avoid it :wink: ),
but did you resize the FS afterwards ?

you could try this instead, it's from one of the two threads posted earlier

1 Like

Oh, It works for me, just forget resize the FS.
Thanks so much!
This problem has troubled me for a long
Thanks again for the kindly response! :wink:

FYI,

if you upgrade, the partition will shrink again.

This might be a better upgrade path for you, but it assumes you're using ext4 not squashfs.

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