Extroot after upgrade to latest (22.03.4)

I have been happily running a OpenWrt-1043ND with an extroot on a usb drive under openwrt18 for some time. I decided to upgrade to the latest. The flash worked with the usual loss of the mounted overlay. I can install the relevant tools (usb-storage etc) mount the usb srive as sda1 but the uci config fails. I am following the instructions to get the USB recognised at https://openwrt.org/docs/guide-user/storage/usb-drives-quickstart and

However, follwing the extroot instructions at https://openwrt.org/docs/guide-user/additional-software/extroot_configuration provided a valud uci configuration, but, the overlay is simply not mounted after reboot.

hrere are the details:

The issue seems to be low level and the only useful info from dmesg is:

root@OpenWrt-1043ND:~# uname -a
Linux OpenWrt-1043ND 5.10.176 #0 Sun Apr 9 12:27:46 2023 mips GNU/Linux
root@OpenWrt-1043ND:~# block info
/dev/mtdblock3: UUID="a2384227-903f3048-8bf1570c-3f57982c" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock4: TYPE="jffs2"
/dev/sda1: UUID="90a7fe98-7dfb-4bcf-9a3f-beee40fff573" VERSION="1.0" MOUNT="/overlay" TYPE="ext4"
root@OpenWrt-1043ND:~# 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].delay_root='5'
fstab.@global[0].check_fs='0'
fstab.rwm=mount
fstab.rwm.device='/dev/mtdblock4'
fstab.rwm.target='/rwm'
fstab.overlay=mount
fstab.overlay.uuid='90a7fe98-7dfb-4bcf-9a3f-beee40fff573'
fstab.overlay.target='/overlay'
root@OpenWrt-1043ND:~# mount /dev/sda1 /mnt
root@OpenWrt-1043ND:~# ls /mnt
asterisk-tim-master  lost+found           opkg                 usr
etc                  old                  ssh-ca               work
homes                old2                 upper
root@OpenWrt-1043ND:~# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,noexec,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
/dev/sda1 on /overlay type ext4 (rw,relatime)
/dev/sda1 on /mnt type ext4 (rw,relatime)
root@OpenWrt-1043ND:~# dmesg | grep sda
[   14.576813] sd 0:0:0:0: [sda] 30515200 512-byte logical blocks: (15.6 GB/14.6 GiB)
[   14.586519] sd 0:0:0:0: [sda] Write Protect is off
[   14.591396] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[   14.592388] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   14.610283]  sda: sda1
[   14.617271] sd 0:0:0:0: [sda] Attached SCSI removable disk
[   18.762319] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts:
[   75.524137] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[   93.458579] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 4000.776411] /dev/sda1: Can't open blockdev
[ 4196.736433] /dev/sda1: Can't open blockdev

Can anyone assist?

I did this just a few days ago without issue.

Are you in a position where you can start over from scratch? I'd recommend following only the extroot guide.

Thanks but I seem to need to follow the ucb to get the usb disk removed.

I'm not sure what you mean about the "ucb to get the usb disk removed"...

From a fresh start, the only thing that is necessary is the extroot guide (and your usb stick is already formatted ext4, so you should be set to go).

Well aparenty not. The USB stick does not show as /dev/sda up unless I install the following modules as per:

I have downgraded now to 21 and this works (the above USB modules are needed here too).

One more omnious issue now on 21.x when I try to upload 22 this provokes the following error:

So in my view there is clearly something wrong with 22.x

I meant to get the subsystem that reads the uci configuration to mount the USB disk. Appols typo.

You may need to reset to defaults and start over.

I have done that and started again. I am now having the same trouble with 21: That is after a firstboot && reboot and re-installing. Is there some setting that can cause this because I am uploading the config from a back up and beging to suspect this is an isse.



BusyBox v1.33.2 (2023-04-09 12:28:16 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 21.02.6, r16842-bc99ce5b22
 -----------------------------------------------------
root@OpenWrt-1043ND:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 3328      3328         0 100% /rom
tmpfs                    29208      1316     27892   5% /tmp
/dev/mtdblock4            2752      2260       492  82% /overlay
overlayfs:/overlay        2752      2260       492  82% /
tmpfs                      512         0       512   0% /dev
root@OpenWrt-1043ND:~# 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].delay_root='5'
fstab.@global[0].check_fs='0'
fstab.rwm=mount
fstab.rwm.device='/dev/mtdblock3'
fstab.rwm.target='/rwm'
fstab.overlay=mount
fstab.overlay.uuid='90a7fe98-7dfb-4bcf-9a3f-beee40fff573'
fstab.overlay.target='/overlay'
root@OpenWrt-1043ND:~# block detect | uci import fstab
root@OpenWrt-1043ND:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 3328      3328         0 100% /rom
tmpfs                    29208      1316     27892   5% /tmp
/dev/mtdblock4            2752      2260       492  82% /overlay
overlayfs:/overlay        2752      2260       492  82% /
tmpfs                      512         0       512   0% /dev
root@OpenWrt-1043ND:~# service fstab boot
root@OpenWrt-1043ND:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 3328      3328         0 100% /rom
tmpfs                    29208      1316     27892   5% /tmp
/dev/mtdblock4            2752      2260       492  82% /overlay
overlayfs:/overlay        2752      2260       492  82% /
tmpfs                      512         0       512   0% /dev
root@OpenWrt-1043ND:~# mount /dev/sda1 /mnt
root@OpenWrt-1043ND:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 3328      3328         0 100% /rom
tmpfs                    29208      1316     27892   5% /tmp
/dev/mtdblock4            2752      2260       492  82% /overlay
overlayfs:/overlay        2752      2260       492  82% /
tmpfs                      512         0       512   0% /dev
/dev/sda1             14911312   2865028  11267024  20% /mnt
root@OpenWrt-1043ND:~# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/mtdblock4 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
/dev/sda1 on /mnt type ext4 (rw,relatime)

From a completely default state, run the following:

(install extroot dependencies)

opkg update; opkg install block-mount kmod-usb-storage kmod-fs-ext4
reboot

Plug in your USB drive and make sure it shows up:

block info

If it does...
delete everyhing on it.

mount /dev/sda1 /mnt; rm -rf /mnt; umount /mnt

(you may get an error that it can't delete /mnt but that's fine)

Now pivot to extroot:

mount /dev/sda1 /mnt ; tar -C /overlay -cvf - . | tar -C /mnt -xf - ; umount /mnt

block detect > /etc/config/fstab; \
   sed -i s/option$'\t'enabled$'\t'\'0\'/option$'\t'enabled$'\t'\'1\'/ /etc/config/fstab; \
   sed -i s#/mnt/sda1#/overlay# /etc/config/fstab; \
   cat /etc/config/fstab;
   
reboot

When it comes back up, check to see if it has mounted as overlay...

df -h

Report back with the output if there are any errors or anything unexpected.

1 Like