Can't set up ExtRoot using an SD on an usb modem

Hello group.

I'm trying to install ExtRoot onto my router, a TL-WDR4300 v1. But I'm running into some sort of problem.

I've followed the wiki guide (I had pre partitioned and formated the sd on my workstation, I'm using ext4). I can mount the partition on the router manually, but when it boots, it fails.

This is the output of block info; uci show fstab; logread | sed -n -e "/- preinit -/,/- init -/p" :

/dev/mtdblock3: UUID="2eb897ea-10490959-4c1117cc-fc83a7a7" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock4: MOUNT="/overlay" TYPE="jffs2"
/dev/sda: UUID="1206-1F4A" VERSION="FAT32" MOUNT="/mnt/share" TYPE="vfat"
/dev/sdb1: UUID="2822627c-a3b5-4741-9f5b-3fe1d8730d56" LABEL="router" VERSION="1.0" TYPE="ext4"
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.@global[0].delay_root='18'
fstab.@mount[0]=mount
fstab.@mount[0].enabled='1'
fstab.@mount[0].target='/mnt/share'
fstab.@mount[0].fstype='vfat'
fstab.@mount[0].options='rw,sync,uid=1000,gid=1000'
fstab.@mount[0].uuid='1206-1F4A'
fstab.rwm=mount
fstab.rwm.device='/dev/mtdblock4'
fstab.rwm.target='/rwm'
fstab.overlay=mount
fstab.overlay.uuid='2822627c-a3b5-4741-9f5b-3fe1d8730d56'
fstab.overlay.target='/overlay'
fstab.overlay.enabled='1'
Sun May 15 20:54:13 2022 user.info kernel: [    3.434227] init: - preinit -
Sun May 15 20:54:13 2022 kern.info kernel: [    3.759688] usb 1-1: new high-speed USB device number 2 using ehci-platform
Sun May 15 20:54:13 2022 kern.info kernel: [    4.113258] hub 1-1:1.0: USB hub found
Sun May 15 20:54:13 2022 kern.info kernel: [    4.188765] hub 1-1:1.0: 4 ports detected
Sun May 15 20:54:13 2022 kern.notice kernel: [    4.277190] random: procd: uninitialized urandom read (4 bytes read)
Sun May 15 20:54:13 2022 kern.info kernel: [    4.751437] usb 1-1.1: new high-speed USB device number 3 using ehci-platform
Sun May 15 20:54:13 2022 kern.notice kernel: [    4.936331] random: jshn: uninitialized urandom read (4 bytes read)
Sun May 15 20:54:13 2022 kern.info kernel: [    5.016125] usb 1-1.2: new high-speed USB device number 4 using ehci-platform
Sun May 15 20:54:13 2022 kern.notice kernel: [    5.213499] random: jshn: uninitialized urandom read (4 bytes read)
Sun May 15 20:54:13 2022 kern.notice kernel: [    5.474584] random: jshn: uninitialized urandom read (4 bytes read)
Sun May 15 20:54:13 2022 kern.notice kernel: [    5.604513] random: jshn: uninitialized urandom read (4 bytes read)
Sun May 15 20:54:13 2022 kern.notice kernel: [    5.696863] random: jshn: uninitialized urandom read (4 bytes read)
Sun May 15 20:54:13 2022 kern.info kernel: [    6.844475] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 1 is up
Sun May 15 20:54:13 2022 kern.info kernel: [    6.850925] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 3 is up
Sun May 15 20:54:13 2022 kern.info kernel: [    6.857177] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 4 is up
Sun May 15 20:54:13 2022 kern.info kernel: [    6.863431] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 5 is up
Sun May 15 20:54:13 2022 kern.info kernel: [    6.870949] eth0: link up (1000Mbps/Full duplex)
Sun May 15 20:54:13 2022 kern.info kernel: [    6.904530] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Sun May 15 20:54:13 2022 kern.info kernel: [    6.917743] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
Sun May 15 20:54:13 2022 kern.notice kernel: [   11.169651] jffs2: notice: (586) jffs2_build_xattr_subsystem: complete building xattr subsystem, 62 of xdatum (57 unchecked, 5 orphan) and 133 of xref (39 dead, 0 orphan) found.
Sun May 15 20:54:13 2022 user.info kernel: [   11.195624] mount_root: loading kmods from internal overlay
Sun May 15 20:54:13 2022 user.info kernel: [   11.998081] kmodloader: loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
Sun May 15 20:54:13 2022 kern.notice kernel: [   12.544882] SCSI subsystem initialized
Sun May 15 20:54:13 2022 kern.info kernel: [   12.593821] usb-storage 1-1.1:1.0: USB Mass Storage device detected
Sun May 15 20:54:13 2022 kern.info kernel: [   12.600638] scsi host0: usb-storage 1-1.1:1.0
Sun May 15 20:54:13 2022 kern.info kernel: [   12.605883] usb-storage 1-1.1:1.1: USB Mass Storage device detected
Sun May 15 20:54:13 2022 kern.info kernel: [   12.614195] scsi host1: usb-storage 1-1.1:1.1
Sun May 15 20:54:13 2022 kern.info kernel: [   12.619269] usb-storage 1-1.2:1.0: USB Mass Storage device detected
Sun May 15 20:54:13 2022 kern.info kernel: [   12.627317] scsi host2: usb-storage 1-1.2:1.0
Sun May 15 20:54:13 2022 kern.info kernel: [   12.632375] usbcore: registered new interface driver usb-storage
Sun May 15 20:54:13 2022 user.info kernel: [   12.640458] kmodloader: done loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
Sun May 15 20:54:13 2022 user.info kernel: [   12.804042] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
Sun May 15 20:54:13 2022 user.info kernel: [   12.814839] block: extroot: device not present, retrying in 18 seconds
Sun May 15 20:54:13 2022 kern.notice kernel: [   13.618343] scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
Sun May 15 20:54:13 2022 kern.notice kernel: [   13.649883] scsi 2:0:0:0: Direct-Access     Innostor Innostor         1.00 PQ: 0 ANSI: 6
Sun May 15 20:54:13 2022 kern.notice kernel: [   13.660230] scsi 1:0:0:0: Direct-Access     HUAWEI   SD Storage       2.31 PQ: 0 ANSI: 2
Sun May 15 20:54:13 2022 kern.notice kernel: [   13.678888] sd 2:0:0:0: [sda] 62464000 512-byte logical blocks: (32.0 GB/29.8 GiB)
Sun May 15 20:54:13 2022 kern.notice kernel: [   13.688454] sd 2:0:0:0: [sda] Write Protect is off
Sun May 15 20:54:13 2022 kern.debug kernel: [   13.693439] sd 2:0:0:0: [sda] Mode Sense: 23 00 00 00
Sun May 15 20:54:13 2022 kern.notice kernel: [   13.695890] sd 2:0:0:0: [sda] Write cache: disabled, read cache: disabled, doesn't support DPO or FUA
Sun May 15 20:54:13 2022 kern.notice kernel: [   13.706117] sd 1:0:0:0: [sdb] Attached SCSI removable disk
Sun May 15 20:54:13 2022 kern.info kernel: [   13.723980]  sda:
Sun May 15 20:54:13 2022 kern.notice kernel: [   13.728371] sd 2:0:0:0: [sda] Attached SCSI removable disk
Sun May 15 20:54:13 2022 kern.notice kernel: [   30.945381] sd 1:0:0:0: [sdb] 1984000 512-byte logical blocks: (1.02 GB/969 MiB)
Sun May 15 20:54:13 2022 kern.notice kernel: [   30.953986] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Sun May 15 20:54:13 2022 kern.info kernel: [   30.967997]  sdb: sdb1
Sun May 15 20:54:13 2022 user.err kernel: [   30.984169] block: extroot: cannot find device with UUID 2822627c-a3b5-4741-9f5b-3fe1d8730d56
Sun May 15 20:54:13 2022 user.info kernel: [   30.994070] mount_root: switching to jffs2 overlay
Sun May 15 20:54:13 2022 kern.warn kernel: [   31.002069] overlayfs: upper fs does not support tmpfile.
Sun May 15 20:54:13 2022 user.warn kernel: [   31.013488] urandom-seed: Seeding with /etc/urandom.seed
Sun May 15 20:54:13 2022 kern.info kernel: [   31.264842] eth0: link down
Sun May 15 20:54:13 2022 user.info kernel: [   31.289977] procd: - early -
Sun May 15 20:54:13 2022 user.info kernel: [   31.293149] procd: - watchdog -
Sun May 15 20:54:13 2022 user.err kernel: [   31.440006] procd: cannot set group dialout for /dev/ttyS11 (getgrnam: 0)
Sun May 15 20:54:13 2022 user.err kernel: [   31.448414] procd: cannot set group dialout for /dev/ttyS8 (getgrnam: 0)
Sun May 15 20:54:13 2022 user.err kernel: [   31.456905] procd: cannot set group dialout for /dev/ttyS6 (getgrnam: 0)
Sun May 15 20:54:13 2022 user.err kernel: [   31.464894] procd: cannot set group dialout for /dev/ttyS4 (getgrnam: 0)
Sun May 15 20:54:13 2022 user.err kernel: [   31.472900] procd: cannot set group dialout for /dev/ttyS2 (getgrnam: 0)
Sun May 15 20:54:13 2022 user.err kernel: [   31.480898] procd: cannot set group dialout for /dev/ttyS14 (getgrnam: 0)
Sun May 15 20:54:13 2022 user.err kernel: [   31.488968] procd: cannot set group dialout for /dev/ttyS0 (getgrnam: 0)
Sun May 15 20:54:13 2022 user.err kernel: [   31.496963] procd: cannot set group dialout for /dev/ttyS12 (getgrnam: 0)
Sun May 15 20:54:13 2022 user.err kernel: [   31.505287] procd: cannot set group dialout for /dev/ttyS9 (getgrnam: 0)
Sun May 15 20:54:13 2022 user.err kernel: [   31.513269] procd: cannot set group dialout for /dev/ttyS10 (getgrnam: 0)
Sun May 15 20:54:13 2022 user.err kernel: [   31.521336] procd: cannot set group dialout for /dev/ttyS7 (getgrnam: 0)
Sun May 15 20:54:13 2022 user.err kernel: [   31.529308] procd: cannot set group dialout for /dev/ttyS5 (getgrnam: 0)
Sun May 15 20:54:13 2022 user.err kernel: [   31.537494] procd: cannot set group dialout for /dev/ttyS3 (getgrnam: 0)
Sun May 15 20:54:13 2022 user.err kernel: [   31.545505] procd: cannot set group dialout for /dev/ttyS15 (getgrnam: 0)
Sun May 15 20:54:13 2022 user.err kernel: [   31.553549] procd: cannot set group dialout for /dev/ttyS1 (getgrnam: 0)
Sun May 15 20:54:13 2022 user.err kernel: [   31.561954] procd: cannot set group dialout for /dev/ttyS13 (getgrnam: 0)
Sun May 15 20:54:13 2022 kern.notice kernel: [   31.791283] random: crng init done
Sun May 15 20:54:13 2022 kern.notice kernel: [   31.794783] random: 2 urandom warning(s) missed due to ratelimiting
Sun May 15 20:54:13 2022 user.info kernel: [   32.081827] procd: - watchdog -
Sun May 15 20:54:13 2022 user.info kernel: [   32.086917] procd: - ubus (running as root!) -
Sun May 15 20:54:13 2022 user.info kernel: [   32.223104] procd: - init -

If you see at second 30.984169 the system gives up tryign to find ExtRoot, but the interesting thing here is this is second 30.984169 because I've set the timeout for root_mount to 18 seconds.

I did so because I originally saw that recognition of sdb1 took a long time... but when I incremented wait to 15 seconds, and then 18 I noticed that the time on this line:

Sun May 15 20:54:13 2022 kern.notice kernel: [ 30.945381] sd 1:0:0:0: [sdb] 1984000 512-byte logical blocks: (1.02 GB/969 MiB)

Increases alongside the root wait time... so the more I wait the longer this recognition of the device takes and it hapens some millisecons before the system giving up on finding the ExtRoot fs uuid, which is inside this device just identified.

Since my usb ports are full, I'm using a 1GB microSD card inserted in an usb 3G modem in the USB port for the storage for ExtRoot, and I wonder if there's a module, or maybe script, that sets up the modem in the right state or something, that runs/ocurrs right after block mount has given up... and if so, if there's any way to move this process to before /etc/init.d/fstab so that the FS is recognized and mounted for ExtRoot.

Do you get extroot using a normal card reader (without 3g modem)? If so, you could add a usb hub like the one here.

It's been a while since setting up extroot on my router. I barely recall having a problem where extroot did not automatically detect that the filesystem was ext4 or took it's sweet time so I added option fstype 'ext4' to /rwm/etc/config/fstab in the overlay section. I was then able to use option delay_root '5' in the global section to speed up boot time without isssue.