About extroot again

OpenWrt 23.05.5 (r24106-10cc5fcd00)

I configure extroot by this, except on ssd, no usb.
It doesn't work.

I'm trying to do as overlay partition the my /dev/mmcblk0p1 partition, but the existing partition /dev/mtdblock6 is already mounted as overlay.
So overlayfs:/overlay therefore is /dev/mtdblock6, no /dev/mmcblk0p1.

Log:

Wed Nov 13 20:24:32 2024 daemon.err block: /dev/mtdblock6 is already mounted on /rom/overlay

As result:

root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                13312     13312         0 100% /rom
tmpfs                    61488       248     61240   0% /tmp
/dev/mtdblock6        10320724       536   9777580   0% /rom/overlay
overlayfs:/overlay         768       316       452  41% /
tmpfs                      512         0       512   0% /dev
/dev/mmcblk0p1        10320724       536   9777580   0% /rom/overlay
root@OpenWrt:~# uci show fstab
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.extroot=mount
fstab.extroot.uuid='66bb462b-cc65-4275-90c0-6b94a8fddbc5'
fstab.extroot.target='/rom/overlay'
fstab.extroot.enabled='1'
fstab.rwm=mount
fstab.rwm.device='/dev/mtdblock6'
fstab.rwm.target='/rwm'
fstab.rwm.enabled='1'
fstab.@mount[2]=mount
fstab.@mount[2].enabled='1'
fstab.@mount[2].device='/dev/sda'
fstab.@mount[2].target='/mnt'

Can you show output of

ubus call system board
block detect
root@OpenWrt:~# ubus call system board
{
	"kernel": "5.15.167",
	"hostname": "OpenWrt",
	"system": "MediaTek MT7620A ver:2 eco:6",
	"model": "Zbtlink ZBT-WE1026-5G (16M)",
	"board_name": "zbtlink,zbt-we1026-5g-16m",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "23.05.5",
		"revision": "r24106-10cc5fcd00",
		"target": "ramips/mt7620",
		"description": "OpenWrt 23.05.5 r24106-10cc5fcd00"
	}
}
root@OpenWrt:~# 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	'66bb462b-cc65-4275-90c0-6b94a8fddbc5'
	option	enabled	'0'

You should use "/overlay" as a target, instead of "/rom/overlay".

3 Likes

The doc is wrong?: eval $(block info | grep -o -e 'MOUNT="\S*/overlay"')

Let's check first that the change fixes the issue, then we will review the doc.

Of course not, you made a stupid assumption.

I think if mmcblk driver is loaded later you dont have it for extroot, you need to stuff files down to filesystem using eg firmware-selector to be available before /overlay
See /etc/modules-boot.d and check that all are in base image and not in /overlay/upper/

Alternative is to mount device as casual, add software install target in one subdirectroy, database files in another, torrents in third and so on.

I went back to v21.02.7 (PHP7 and a working modem), but this instruction do not work too.
Despite the fact that in this version OpenWRT a overlay partition are mounted to /overlay, not to /rom/overlay as in v23.05.5

Which of two versions work your way?

I need PHP7.

It looks like that's enough

config mount 'extroot'
	option uuid '66bb462b-cc65-4275-90c0-6b94a8fddbc5'
	option target '/overlay'
	option enabled '0'

on /etc/config/fstab...

vi /etc/opkg.comf
opkg install -d usb php99

Come on, dude, I know.

1 Like

It is much easier, with sysupgrade and stuff.

It's not true...

Sometimes it works, sometimes it doesn't. I don't see a pattern and I don't understand what needs to be done to make it work.

1 Like

It is a niche option to save devices with no space, like 8/64 and add more than 2 packages

Yes, this instruction is correct and complete.
But only if you do it literally.

You have to format a partition for overlay in OpenWRT, because if you format in a normal operating system, the partition may have a unsupported ext4 optional features.
You cannot install a new firmware - then the extroot will have to be created again.

Last point is what you took up when choosing extroot over normal mount, time to stop complaining.