OK I am getting really frustrated, and don't know what else to do. I reset the router to defaults and flashed again sysupgrade 23.05.5 from the firmware selector, without retaining settings. The only thing I did was to create a build with block-mount kmod-fs-ext4 e2fsprogs parted kmod-usb-storage kmod-usb-storage-uas
packages included in order for me to be able to access the external disk.
Without doing anything else (so on a completely clean installation other than the additional packages above) I started the extroot configuration process. I am pasting all the steps I did below.
root@OpenWrt:~# ls /dev/sd*
/dev/sda /dev/sda1 /dev/sda2
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 delay_root '5'
option check_fs '0'
config 'mount'
option target '/overlay'
option uuid '17d7647c-1dd2-11b2-ada9-8a354acb70ba'
option enabled '0'
config 'mount'
option target '/rom'
option uuid 'e11b49de-30b96036-93f56fe9-fcef9bbb'
option enabled '0'
config 'mount'
option target '/mnt/sda1'
option uuid '88d2e92c-dced-4c50-afe2-e149ab912ddb'
option enabled '0'
config 'mount'
option target '/mnt/sda2'
option uuid '055586e2-5336-41f6-b4b4-44986cd5efa6'
option enabled '0'
root@OpenWrt:~# block info
/dev/loop0: UUID="17d7647c-1dd2-11b2-ada9-8a354acb70ba" LABEL="rootfs_data" VERSION="1.16" MOUNT="/overlay" TYPE="f2fs"
/dev/mmcblk0p7: UUID="e11b49de-30b96036-93f56fe9-fcef9bbb" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/sda1: UUID="88d2e92c-dced-4c50-afe2-e149ab912ddb" VERSION="1.0" TYPE="ext4"
/dev/sda2: UUID="055586e2-5336-41f6-b4b4-44986cd5efa6" LABEL="extroot" VERSION="1.0" TYPE="ext4"
root@OpenWrt:~# DISK="/dev/sda"
root@OpenWrt:~# DEVICE="${DISK}2"
(this is the only thing I did different, I selected the 2nd partition for the overlay as I had in my previous router, the 1st partition has my data)
root@OpenWrt:~# eval $(block info ${DEVICE} | grep -o -e 'UUID="\S*"')
root@OpenWrt:~# eval $(block info | grep -o -e 'MOUNT="\S*/overlay"')
root@OpenWrt:~# uci -q delete fstab.extroot
root@OpenWrt:~# uci set fstab.extroot="mount"
root@OpenWrt:~# uci set fstab.extroot.uuid="${UUID}"
root@OpenWrt:~# uci set fstab.extroot.target="${MOUNT}"
root@OpenWrt:~# uci commit 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 delay_root '5'
option check_fs '0'
config mount
option target '/overlay'
option uuid '17d7647c-1dd2-11b2-ada9-8a354acb70ba'
option enabled '0'
config mount
option target '/rom'
option uuid 'e11b49de-30b96036-93f56fe9-fcef9bbb'
option enabled '0'
config mount
option target '/mnt/sda1'
option uuid '88d2e92c-dced-4c50-afe2-e149ab912ddb'
option enabled '0'
config mount
option target '/mnt/sda2'
option uuid '055586e2-5336-41f6-b4b4-44986cd5efa6'
option enabled '0'
config mount 'extroot'
option uuid '055586e2-5336-41f6-b4b4-44986cd5efa6'
option target '/overlay'
root@OpenWrt:~# ORIG="$(block info | sed -n -e '/MOUNT="\S*\/overlay"/s/:\s.*$//p')"
root@OpenWrt:~# uci -q delete fstab.rwm
root@OpenWrt:~# uci set fstab.rwm="mount"
root@OpenWrt:~# uci set fstab.rwm.device="${ORIG}"
root@OpenWrt:~# uci set fstab.rwm.target="/rwm"
root@OpenWrt:~# uci commit 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 delay_root '5'
option check_fs '0'
config mount
option target '/overlay'
option uuid '17d7647c-1dd2-11b2-ada9-8a354acb70ba'
option enabled '0'
config mount
option target '/rom'
option uuid 'e11b49de-30b96036-93f56fe9-fcef9bbb'
option enabled '0'
config mount
option target '/mnt/sda1'
option uuid '88d2e92c-dced-4c50-afe2-e149ab912ddb'
option enabled '0'
config mount
option target '/mnt/sda2'
option uuid '055586e2-5336-41f6-b4b4-44986cd5efa6'
option enabled '0'
config mount 'extroot'
option uuid '055586e2-5336-41f6-b4b4-44986cd5efa6'
option target '/overlay'
config mount 'rwm'
option device '/dev/loop0'
option target '/rwm'
root@OpenWrt:~# mount ${DEVICE} /mnt
root@OpenWrt:~# ls /mnt
upper work
(I am now deleting the upper and work dirs that were left over from the previous attempts)
root@OpenWrt:~# rm -rf /mnt/upper
root@OpenWrt:~# rm -rf /mnt/work
root@OpenWrt:~# ls /mnt
root@OpenWrt:~# tar -C ${MOUNT} -cvf - . | tar -C /mnt -xf -
./
./upper/
./upper/lib/
./upper/lib/firmware/
./upper/lib/firmware/mediatek/
./upper/lib/firmware/mediatek/mt7986_eeprom_mt7976_dual.bin
./upper/etc/
./upper/etc/config/
./upper/etc/config/wireless
./upper/etc/config/network
./upper/etc/config/system
./upper/etc/config/dhcp
./upper/etc/config/dropbear
./upper/etc/config/firewall
./upper/etc/config/luci
./upper/etc/config/rpcd
./upper/etc/config/ucitrack
./upper/etc/config/uhttpd
./upper/etc/config/fstab
./upper/etc/config/ubootenv
./upper/etc/board.json
./upper/etc/uci-defaults/
./upper/etc/uci-defaults/00_uhttpd_ubus
./upper/etc/uci-defaults/05_fix-compat-version
./upper/etc/uci-defaults/10-fstab
./upper/etc/uci-defaults/10_migrate-shadow
./upper/etc/uci-defaults/12_network-generate-ula
./upper/etc/uci-defaults/13_fix-group-user
./upper/etc/uci-defaults/14_migrate-dhcp-release
./upper/etc/uci-defaults/15_odhcpd
./upper/etc/uci-defaults/20_migrate-feeds
./upper/etc/uci-defaults/30_luci-theme-bootstrap
./upper/etc/uci-defaults/30_uboot-envtools
./upper/etc/uci-defaults/50-dnsmasq-migrate-ipset.sh
./upper/etc/uci-defaults/50-dnsmasq-migrate-resolv-conf-auto.sh
./upper/etc/uci-defaults/50-migrate-rpcd-ubus-sock.sh
./upper/etc/uci-defaults/50_luci-mod-admin-full
./upper/etc/uci-defaults/99_fwenv-store-ethaddr.sh
./upper/etc/fw_env.config
./upper/etc/dropbear/
./upper/etc/dropbear/dropbear_ed25519_host_key
./upper/etc/dropbear/dropbear_rsa_host_key
./upper/etc/urandom.seed
./work/
./work/work/
./work/work/#9
./.fs_state
root@OpenWrt:~# reboot
root@OpenWrt:~# Connection to 192.168.1.1 closed by remote host.
root@OpenWrt:~# grep -e /overlay /etc/mtab
/dev/loop0 /overlay f2fs rw,lazytime,noatime,background_gc=on,nodiscard,no_heap,user_xattr,inline_xattr,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=reuse,checkpoint_merge,fsync_mode=posix,discard_unit=block 0 0
overlayfs:/overlay / overlay rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work,xino=off 0 0
root@OpenWrt:~# df /overlay /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/loop0 7581376 196424 7384952 3% /overlay
overlayfs:/overlay 7581376 196424 7384952 3% /
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 6.0M 6.0M 0 100% /rom
tmpfs 494.5M 68.0K 494.5M 0% /tmp
/dev/loop0 7.2G 191.8M 7.0G 3% /overlay
overlayfs:/overlay 7.2G 191.8M 7.0G 3% /
tmpfs 512.0K 0 512.0K 0% /dev
root@OpenWrt:~# dmesg | grep -E 'extroot|overlay|mount|sda'
[ 3.033933] sd 0:0:0:0: [sda] 2000409264 512-byte logical blocks: (1.02 TB/954 GiB)
[ 3.041591] sd 0:0:0:0: [sda] 4096-byte physical blocks
[ 3.046953] sd 0:0:0:0: [sda] Write Protect is off
[ 3.051737] sd 0:0:0:0: [sda] Mode Sense: 53 00 00 08
[ 3.057067] sd 0:0:0:0: [sda] Disabling FUA
[ 3.061266] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 3.198034] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a multiple of physical block size (4096 bytes)
[ 3.210305] sda: sda1 sda2
[ 3.214462] sd 0:0:0:0: [sda] Attached SCSI disk
[ 5.005290] mount_root: loading kmods from internal overlay
[ 5.302666] mount_root: loading kmods from internal overlay
[ 5.311918] kmodloader: loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
[ 5.320482] kmodloader: done loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
[ 5.424993] mount_root: switching to f2fs overlay
[ 5.430358] overlayfs: null uuid detected in lower fs '/', falling back to xino=off,index=off,nfs_export=off.
So again overlay stays with /dev/loop0. Again I see this "null uuid detected" in the boot log which I am not sure if this is related to the issue. Any help appreciated.