Extroot configuration with no /overlay mount

Following the extroot configuration guide on a Linksys EA8300 (running OpenWrt 22.03.2, r19803-9a599fee93) I could see that there's a note stating:

This configuration will not be able to be used on devices that do not have the /overlay partition on mtd or on ROMs that do not have /overlay partition at all. In the first case OpenWrt will not want to read the configuration of /etc/config/fstab (FS#2231) ; in the latter case you can work around it by mounting the external/additional disk directly to / .

This is my case for this router with this OpenWrt version. As df command shows, there's no /overlay partition, but a /rom/overlay (see below).

I'm not sure if I understand what would change in the process for the mentioned workaround to work. Which device should I use when configuring rootfs_data? Should I mount to /rom/overlay when configuring overlay in fstab uci commands? Should I use /rom/overlay when transferring data?

Any help would be appreciated. In fact, the outcome of this thread may be useful for the guide itself.

Thanks!

Here's some system information:

# df

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 4608      4608         0 100% /rom
tmpfs                   124096      1224    122872   1% /tmp
/dev/ubi0_1              66976      9816     53704  15% /rom/overlay
overlayfs:/overlay       66976      9816     53704  15% /
tmpfs                      512         0       512   0% /dev
/dev/sda1             14900552        24  14121808   0% /mnt/sda1

# cat /etc/mtab

/dev/root /rom squashfs ro,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,noatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,noatime 0 0
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,noatime 0 0
/dev/ubi0_1 /rom/overlay ubifs rw,noatime,assert=read-only,ubi=0,vol=1 0 0
overlayfs:/overlay / overlay rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work 0 0
tmpfs /dev tmpfs rw,nosuid,noexec,noatime,size=512k,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,noatime,mode=600,ptmxmode=000 0 0
debugfs /sys/kernel/debug debugfs rw,noatime 0 0
none /sys/fs/bpf bpf rw,nosuid,nodev,noexec,noatime,mode=700 0 0
/dev/sda1 /mnt/sda1 ext4 rw,relatime 0 0

# cat /proc/mtd

dev:    size   erasesize  name
mtd0: 00100000 00020000 "sbl1"
mtd1: 00100000 00020000 "mibib"
mtd2: 00100000 00020000 "qsee"
mtd3: 00080000 00020000 "cdt"
mtd4: 00080000 00020000 "appsblenv"
mtd5: 00080000 00020000 "ART"
mtd6: 00200000 00020000 "appsbl"
mtd7: 00080000 00020000 "u_env"
mtd8: 00040000 00020000 "s_env"
mtd9: 00040000 00020000 "devinfo"
mtd10: 05800000 00020000 "kernel"
mtd11: 05500000 00020000 "rootfs"
mtd12: 05800000 00020000 "alt_kernel"
mtd13: 05500000 00020000 "alt_rootfs"
mtd14: 00100000 00020000 "sysdiag"
mtd15: 04680000 00020000 "syscfg"

# block info

/dev/mtdblock11: UUID="1117646803" VERSION="1" TYPE="ubi"
/dev/ubiblock0_0: UUID="39f04184-f6874d75-c78b30dd-13643400" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/ubi0_1: UUID="3eb5dfe2-3d73-401a-bec1-d08c7de8410f" VERSION="w5r0" MOUNT="/rom/overlay" TYPE="ubifs"
/dev/sda1: UUID="61d2fc7f-dcc6-435c-a3c3-f4513c679a80" LABEL="extroot" VERSION="1.0" MOUNT="/mnt/sda1" TYPE="ext4"

# block detect

config 'global'
    optionanon_swap'0'
    optionanon_mount'0'
    optionauto_swap'1'
    optionauto_mount'1'
    optiondelay_root'5'
    optioncheck_fs'0'

config 'mount'
    optiontarget'/mnt/sda1'
    optionuuid'61d2fc7f-dcc6-435c-a3c3-f4513c679a80'
    optionenabled'0'

You've got your storage mounted as /mnt/sda1 instead of /

Here's the recipe I follow:

1 Like

Thanks for the quick reply!

I already stumbled upon that thread but I notoced the same difference: there's no /overlay mount in my case, but a /rom/overlay. Or am I missing aomething?

Cheers.

did you follow the recipe exactly? I've done it dozens of times and never had an issue.

Hi, just tried, just in case, but I get stuck in the process since I have no /overlay mount point in the file system.

# mount /dev/sda1 /mnt/sda1

# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 4608      4608         0 100% /rom
tmpfs                   124096       116    123980   0% /tmp
/dev/ubi0_1              66976      9488     54032  15% /rom/overlay
overlayfs:/overlay       66976      9488     54032  15% /
tmpfs                      512         0       512   0% /dev
/dev/sda1             14900552         8  14121824   0% /mnt/sda1

# tar -C /overlay cvf - . | tar -C /mnt/sda1 -xf - 
BusyBox v1.35.0 (2022-10-14 22:44:41 UTC) multi-call binary.

Usage: tar c|x|t [-zahvokO] [-f TARFILE] [-C DIR] [-T FILE] [-X FILE] [FILE]...
...
tar: short read

~# ls /overlay
ls: /overlay: No such file or director

Hope it clarifies a little bit more.

Ok,... so what happens if you do this:

you can work around it by mounting the external/additional disk directly to / .

I updated the wiki instructions to support both /overlay and /rom/overlay.
It needs testing and verification, specifically the mount point location for extroot.
The current location matches the one used by the original overlay.

So, I had the time to follow the newly updated wiki (thanks a lot @vgaetera), I could notice that the changes introduced also contemplated the paths in the configuration I have while I was executing the commands. After completing the process this is how I found the system:

# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 4.5M      4.5M         0 100% /rom
tmpfs                   121.2M    112.0K    121.1M   0% /tmp
/dev/ubi0_1              14.2G     19.1M     13.4G   0% /rom/overlay
overlayfs:/overlay       65.4M      9.3M     52.8M  15% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda1                14.2G     19.1M     13.4G   0% /rom/overlay
# ls -la /rom/overlay/
drwxr-xr-x    5 root     root          4096 Oct  7 00:36 .
drwxr-xr-x   16 root     root           223 Oct 14  2022 ..
lrwxrwxrwx    1 root     root             1 Oct  7 00:36 .fs_state -> 2
drwx------    2 root     root         16384 Oct  7 00:34 lost+found
drwxr-xr-x   11 root     root          4096 Oct  7 00:36 upper
drwxr-xr-x    3 root     root          4096 Oct  7 00:36 work
# block detect
config 'global'
	option	anon_swap	'0'
	option	anon_mount	'0'
	option	auto_swap	'1'
	option	auto_mount	'1'
	option	delay_root	'5'
	option	check_fs	'0'

config 'mount'
	option	target	'/rom/overlay'
	option	uuid	'5ee9c420-0b1c-4b59-bc1d-85321baf9daa'
	option	enabled	'0'
# block info
/dev/mtdblock11: UUID="1117646803" VERSION="1" TYPE="ubi"
/dev/ubiblock0_0: UUID="39f04184-f6874d75-c78b30dd-13643400" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/ubi0_1: UUID="3eb5dfe2-3d73-401a-bec1-d08c7de8410f" VERSION="w5r0" MOUNT="/rom/overlay" TYPE="ubifs"
/dev/sda1: UUID="5ee9c420-0b1c-4b59-bc1d-85321baf9daa" LABEL="extroot" VERSION="1.0" MOUNT="/rom/overlay" TYPE="ext4"

I can see both devices mounted to /rom/overlay match in size, also the contents of the directory seem to be correct. Can I consider this a success?

1 Like

I'm afraid this is not the case:

I only adapted the instructions to determine the current overlay mount point and use it as a variable to copy the contents of the overlay and to mount extroot, but I'm not sure about the mount point in this specific case and to what degree the mentioned issue is relevant for your device.
You can edit the fstab configuration and test the / or /overlay values for the mount point, and if none of them works, there's nothing else to do except subscribing on the ticket and waiting for good news.

Yup, no luck changing it to / (in fact, router wasn't even booting, that was quite a scare). I'll mention this in the issue.

Thanks for everything!

1 Like