Hi,
I'm new to the forum and OpenWRT.
I have a new WRT32X-B. I installed OpenWrt 19.07.3, r11063-85e04e9f46 and am trying to get a stable extroot functionality in a partition on a Samsung Fit 128GB USB3 Key. Followed the instructions found here and was able to overlay the boot drive with the partition on the USB key.
The problem is, it only works every other reboot.
This router has two physical USB type A ports, a USB2 and a USB3. There are three logical USB busses in this device, one USB2 bus and two USB3 busses. Rebooting the router alternates attaching the USB3 device plugged into the physical USB3 port between logical Bus 02 and logical Bus 03. To be clear, each odd numbered reboot attaches the physical device to logical Bus 02, each even numbered reboot attaches the physical device to logical Bus 03.
On odd numbered reboots:
The physical USB device is linked to logical Bus 02.
The USB key name is mis-identified in the log.
/dev/sda is attached to the file system.
But the partition on the USB key is not attached to the file system at /dev/sda1.
Which means /overlay can't overlay the partition on /dev/sda1.
Thus extroot functionality does not work.
root@OpenWrt:~# lsusb -t
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 480M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=orion-ehci/1p, 480M
root@OpenWrt:~# logread | sed -n -e "/_an apprpriate regex to find the lines below_/p"
scsi 2:0:0:0: Direct-Access SMI USB MEMORY BAR 1000 PQ: 0 ANSI: 5
sd 2:0:0:0: [sda] Attached SCSI removable disk
root@OpenWrt:~# ls -als /dev/sda
0 brw------- 1 root root 8, 0 Jan 1 1970 /dev/sda
root@OpenWrt:~# ls -als /dev/sda1
ls: /dev/sda1: No such file or directory
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 3.3M 3.3M 0 100% /rom
tmpfs 250.0M 96.0K 249.9M 0% /tmp
/dev/ubi0_1 97.8M 4.0M 89.1M 4% /overlay
overlayfs:/overlay 97.8M 4.0M 89.1M 4% /
tmpfs 512.0K 0 512.0K 0% /dev
On even numbered reboots:
The physical USB device is linked to logical Bus 03.
The USB key name is properly identified in the log.
The partition on the USB key is attached to the file system at /dev/sda1.
/overlay is overlaid with /dev/sda1.
So, extroot functions as expected.
root@OpenWrt:~# lsusb -t
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=orion-ehci/1p, 480M
root@OpenWrt:~# logread | sed -n -e "/_an apprpriate regex to find the lines below_/p"
scsi 2:0:0:0: Direct-Access Samsung Flash Drive FIT 1100 PQ: 0 ANSI: 6
sd 2:0:0:0: [sda] 250626566 512-byte logical blocks: (128 GB/120 GiB)
sd 2:0:0:0: [sda] Write Protect is off
sd 2:0:0:0: [sda] Mode Sense: 43 00 00 00
sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sda: sda1 sda2
sd 2:0:0:0: [sda] Attached SCSI removable disk
root@OpenWrt:~# ls -als /dev/sda1
0 brw------- 1 root root 8, 1 Jan 1 1970 /dev/sda1
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 3.3M 3.3M 0 100% /rom
tmpfs 250.0M 96.0K 249.9M 0% /tmp
/dev/sda1 31.2G 54.8M 29.6G 0% /overlay
overlayfs:/overlay 31.2G 54.8M 29.6G 0% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/ubi0_1 97.8M 4.0M 89.1M 4% /rwm
I have some questions.
Is this a known problem? Either with the OpenWrt xhci driver, or with the USB3 hardware on the WRT32X-B or some combination of these?
Are there any suggested workarounds to get the driver to always attach the physical key to logical Bus 03?
If not, are there any suggested workarounds to get the driver to properly identify the device and/or at least attach the partition to /dev/sda1 when it chooses to attach the device on Bus 02?
As this is my first post on this forum, I'll apologize in advance if this is the wrong category to post this kind of question, if so, please be so kind as to point me in the right direction.
I'll also apologize for not knowing how to mark up code or stdout lines above to get them into a scroll box for better readability. I will edit that into this post when I learn the correct markup. I guess I will have to spend some more quality time talking to myself through a proxy in the form of discobot. Of course, some kind soul could help me out and point me to the forum editor's markup manual.