[SOLVED] Extroot on USB

Sorry, it's old question, but I have no answers for me with my Engenius EPG 5000 OpenWrt 18.06.2 r7676-cddd7b4c77 / LuCI openwrt-18.06 branch (git-19.020.41695-6f6641d).
So, I'm trying to add external overlay partition at USB drive. All was done by native manual
But no any final solution for "after reboot" case, extroot was not reconnecting

  1. export PREINIT = 1 ; mount_root was added.
  2. /etc/config/fstab at /overlay was equal as default.
Block info is:

/dev/mtdblock3: UUID="5ad90c52-d373b933-9c164be3-2a4588e9" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock4: MOUNT="/overlay" TYPE="jffs2"
/dev/mtdblock5: UUID="87f3ac98-d218fa59-f1015dc8-46e010a7" VERSION="4.0" TYPE="squashfs"
/dev/mtdblock7: TYPE="jffs2"
/dev/sda1: UUID="1080afc6-55c5-4036-9d24-5a552fda3d79" LABEL="overlay" VERSION="1.0" TYPE="ext4"
/dev/sda2: UUID="9ab68baf-e7db-46e1-82df-e83f66b72b93" LABEL="swap" VERSION="1" TYPE="swap"
/dev/sda3: UUID="0729f0bc-38f3-44e7-878f-4da3757374b1" LABEL="data" VERSION="1.0" TYPE="ext4"

My presented fstab is:

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

config mount
option target '/overlay'
option uuid '1080afc6-55c5-4036-9d24-5a552fda3d79'
option enabled '1'

config swap
option uuid '9ab68baf-e7db-46e1-82df-e83f66b72b93'
option enabled '1'

config mount
option target '/data'
option fstype 'ext4'
option enabled '1'
option uuid '0729f0bc-38f3-44e7-878f-4da3757374b1'

DF after extroot mounting is:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 2816 2816 0 100% /rom
tmpfs 127608 548 127060 0% /tmp
/dev/mtdblock4 3824916 34056 3576844 1% /overlay
overlayfs:/overlay 10560 8184 2376 78% /
tmpfs 512 0 512 0% /dev
/dev/sda1 3824916 34056 3576844 1% /overlay
/dev/sda3 55082232 53272 52201236 0% /data

DF after reboot is:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 2816 2816 0 100% /rom
tmpfs 127608 548 127060 0% /tmp
/dev/mtdblock4 10560 8180 2380 77% /overlay
overlayfs:/overlay 10560 8180 2380 77% /
tmpfs 512 0 512 0% /dev
/dev/sda3 55082232 53272 52201236 0% /data

As you can see /data partition was reconnected successfully instead /overlay - it was dropped.
Is here any additional tricks for newest releases?

I don't see any mistake in your configuration. Is there anything in dmesg or syslog?
swap on USB doesn't look like a good idea. Too slow and will wear out the flash if used.

Nope, logs contains only records about "mtdblockX already connected" after about 6 seconds after boot. Same was googled in other cases.
Sure, SWAP was used only for problem identification. It's reconnected after reboot too.

option delay_root '45'

That's one massive delay!

Don't worry about reboot.... to test.... just fire up the mount process.... then check your logs.....

There is a reason.... and we need a sure fire way to see what it is....

Yes, but such big delay was covered in some situations as possible to fix overlay automount after reboot. For exampe in native manual:

  • Do not use vfat (FAT/FAT32); it does not work. If you have a FAT preformatted USB drive, you cannot use it for extroot without reformatting. Use e.g. ext4 (install e2fsprogs, then format your FAT formatted USB drive using mkfs.ext4 /dev/sda1 as per the example).

  • If the partition containing your extroot isn't mounted during boot, but you can mount it without problems from a shell, you should try to increase config 'global' / option delay_root . On my system I had to set it to 15 seconds to get extroot working. Another hint to this being the culprit is having a working swap or other partitions mounted after booting, but not your extroot.

  • Another possibility to consider and try is to include in /etc/rc.local the commands: export PREINIT = 1 ; mount_root , as described in 14946 ticket, which in the case of running Chaos Calmer r44266 in the Comtrend AR-5387un, has been the only thing that allowed me to achieve extroot.

Yup been there, and I commend your adherence to the docs.... I even spent a few weeks in the procd etc. source.....

There have been changes over the last few releases....

There is another obscure tip about changing where is says mount for the root partition to say overlay or something like that.....

But for now....

Keep it simple.....

-Disable the other mounts ( 0 )....

-Manullly fsck and restart block mount or whatever the current command is to force a remount based on /etc/config/fstab

-Try changing the UUID.... to /dev/sdX ( make sure blkid is installed )

If it works on the live system.... then you can return to the fiddly bits above....

But the thing is to inspect / interrogate the OS until you find the cause....

-running daemons in foreground
-double check the drive FS on another PC ( including files present )

etc. etc. etc.

Lastly..... I have some drives that just don't work..... Given your this far down the path.... that's probably the first thing on the list to try ( another drive ).....

Like explain in the manual you reffered to, have you copy the root to your overlay ?

Then we transfer the content of the current overlay inside the external drive

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

Also, look at your dmesg near the preinit if you get any errors

Problem solved. It was fixed after clean firmware reinstallation without saving settings. After that /overlay was mounted permanently, no any issues with automounting after reboot.

1 Like

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