Pivot overlay is not mounted on startup (Huawei E392)

Hi everybody
Trying to migrate to LEDE from OW ChaosCalmer

Found some issues with system load in comparison to CC
But the main issue with pivot overlay.

  1. Did everything according to manual (the same like in CC)
  2. system even start first time and mount my /dev/sda1 to /overlay
  3. but if i restart it will never mount it (/dev/sda1) again
  4. I fount link in the root of /dev/sda1 (some thing like fs_check->2)
  5. Decided that someting wrong with FS on /dev/sda1
  6. Did a fschk.ext4 and reboot again
  7. Several time it started (and mounted /dev/sda1 to /overlay)
  8. but then again didn't mount it after reboot

Any ideas or advise what to do?

Configuration

  • LEDE 17.01.2 (miwifi-mini-squashfs-sysupgrade.bin)
  • Mi mini router
  • Default config
    -- Wifi
    -- LTE (uqmi mode)
    -- vnstat

Did you try to configure a/put a higher delay to allow your /dev/sda to be detected ? I think that it's done in fstab, option delay_root '5' or something like that (wild guess here - not an expert on that domain).

Sure I tried (up to 40 seconds)
The current /etc/config/fstab
config global
option anon_swap '0'
option anon_mount '0'
option auto_swap '1'
option auto_mount '1'
option delay_root '20'
option check_fs '0'

config mount
option target '/overlay'
option uuid '5b23308f-261c-40c5-a896-3b606ee00743'
option fstype 'ext4'
option enabled '1'
option enabled_fsck '1'

the same result - didn't mount on boot :frowning:

Did you come across this OpenWrt bug (some fixes suggestions):
https://dev.openwrt.org/ticket/14946

And also in LEDE Extroot configuration documentation (troubleshooting):
https://lede-project.org/docs/user-guide/extroot_configuration#troubleshooting

In that documentation there is something about (...) format the external drive as f2fs or ext4, so I would try formatting it f2fs just to see if it makes any difference.

did read these topics... will try now...
do you mean format to ext2 vs ext4? what is f2fs

thanx

strange thing that it starts one or two times after configuration and then fails... without any reasons

I really don't know sorry :confused:
After reading Wikipedia it's some kind of file system for flash (Flash Friendly File System)

Weird indeed, I have a feeling that it is due to an internal sequence of initialization of some sort. Are you using some kind of USB concentrator or USB thumb ?

it seems you are close to true.
mine issue was with reader in LTE modem (microSD installed)
I did tests with regular USB stick - and it works fine after 5 restarts...

so, the right is somewhere in sequence of boot...
but in CC it works fine without any secrets...

will continue studying

Keep in mind that since CC there has been a lot of changes in LEDE, maybe there was a regression of some sort. If you can pinpoint the problem maybe it will be possible to identify the commit and/or report a bug.

If I understand, you are using the microSD card of your USB LTE modem as extroot ?

correct
I'm using Huawei E392 modem with embeded SD card reader
it works perfect in CC and LEDE in (qmi mode)
I did a pivot overlay to this SD card and it works fine with CC but starts one or two times in LEDE and then doesn't

now i'm trying somehow get access to this modem with AT commands and check that CD is disabled on it (to confirm situation with reinit by sub-modeswitch (I remember that i've disabled it, but when i plug it to computer it shows CD)
so may be somehow it was reseted and returned to default configuration with enabled CD and usb-modeswith reinit devices and doesn't allow to mount /overlay on boot.

but can't get access to it now... there are now /dev/ttyUSB devices... :frowning:
and on laptop can't find program for acccess with terminal

Did check modem configuration
The CD it on on startup mode and off in working
But there are no option to off it in startup
AT^SETPORT:;1,2,7,A2 returns error
no it in folowing mode
AT^SETPORT="A1,A2;2,3,7,A2

will try f2fs... but not sure it will help

Finaly i found the point of issue...

And the first conclusion - it's not the problem if LEDE it's problem of OW/LEDE architect (or whatever)

So, this E392 has 2 modes (initial and after initialization)
By default in initial mode only 2 devices are enabled (CD and SDcard)
Then on initialization E392 is switching to working mode where by default additions devices are on (CD+SD+Modem+Net+PCdiag+Command) - mode AT^SETPORT="A1,A2;1,2,3,7,A1,A2"

this initial and second modes can be adjusted with AT commands, but unfortunately with limitation
You can't switch off CD (A1) in initial mode so, you can't disable mode swithing and suggested in post HERE

So there are 2 options to setup the initian mode of E392 -

  1. A1, A2 (CD + SDcard)
  2. A1 (CD)

Option 1.
In this case on boot process system will find your device (SDcard) and will make exroot, but on next steps will start usb-modeswitch and you'll get kernel panic (i suppose this, since it's impossible to login to system neither ssh nor web).

Option 2
In this case on boot process system won't find your device (since only CD is enabled in initial mode) and will start with overlay in jffs2

So the solution can be somehow start usb-modeswitch before mount /overlay (but i'm not sure it's possible from point of architect)

Although, i found some workaround that probably can play. All below is my assumptions...
if you use soft reboot (i.e. run reboot command in shell) in this case E392 stays in initialized mode
then after reboot system finds SDcard and mount it to /overlay
and usb-modeswitch won't switch the modes (since mode is already switched)
So the workaround can be the following

  1. Switch E392 to option 2 (AT^SETPORT="A1;2,7,A2"
  2. System will start and mount /overlay from jffs2 partiotion
  3. White a script that runs on final step of system initialization (this script will check if /overlay is mounted from jfss2 of SDcard and execute "reboot" in case of jfss2
  4. After this reboot system will start with initialized E392 and /overlay will be mounted from SDcard

So, system will start twice, but will get pivot overlay from SDcard finaly

any comments?
any ideas about such a scripts?

the assumption in post above is incorrect :frowning:
i did more tests...
sometime after "reboot" E392 starts in "initial" mode CD enabled, sometime - in initialized mode SDcard enabled...
can't find any dependences...
have no idea what to do further...

that's terrible
I've just "export PREINIT=1; mount_root" entries in /etc/rc.local
now it starts and pivot overlay without any reboots... 100% (about 15 restarts)
have no ideas why this options didn't work 2 days ago :confused: