USB device names are not created after reboot

I am using the MobiPromo CM520-79F on OpenWrt 22.03.0. It is IPQ4019 based and has a single USB 3.0 port. I plugged a Seagate GoFlex Desk 3.5" HDD adapter into it.

Everything works well, until I issue a reboot command. After a reboot, there is no /dev/sdaX anymore:

root@OpenWrt:~# ls /dev/sd*
ls: /dev/sd*: No such file or directory

To make it shows up, I have to either:

  1. Unplug and replug the storage device USB cable...
  2. ... or unplug and replug the router power cable

Why don't the device names show up? Isn't it the job of procd to create the device file names under /dev?

P.S: there is also another small issue with this device -- it cannot be turned off. A poweroff command will result in a reboot.

Here is the kernel log:

[    4.285606] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    4.285678] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
[    4.290328] xhci-hcd xhci-hcd.0.auto: hcc params 0x0228f665 hci version 0x100 quirks 0x0000000002010010
[    4.297625] xhci-hcd xhci-hcd.0.auto: irq 102, io mem 0x08a00000
[    4.307886] hub 1-0:1.0: USB hub found
[    4.317983] hub 1-0:1.0: 1 port detected
[    4.318372] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    4.321033] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
[    4.326285] xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed
[    4.333958] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    4.341098] hub 2-0:1.0: USB hub found
[    4.348704] hub 2-0:1.0: 1 port detected
[    4.352784] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[    4.356328] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 3
[    4.361865] xhci-hcd xhci-hcd.1.auto: hcc params 0x0220f665 hci version 0x100 quirks 0x0000000002010010
[    4.369235] xhci-hcd xhci-hcd.1.auto: irq 103, io mem 0x06000000
[    4.380282] hub 3-0:1.0: USB hub found
[    4.384826] hub 3-0:1.0: 1 port detected
[    4.388683] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[    4.392460] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 4
[    4.397724] xhci-hcd xhci-hcd.1.auto: Host supports USB 3.0 SuperSpeed
[    4.405390] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
[    4.412497] hub 4-0:1.0: USB hub found
[    4.420176] hub 4-0:1.0: config failed, hub doesn't have any ports! (err -19)
[    4.426467] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    4.433775] init: - preinit -
[    4.802876] random: crng init done
[    5.449631] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[    5.869683] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   10.209633] UBIFS (ubi0:2): Mounting in unauthenticated mode
[   10.209866] UBIFS (ubi0:2): background thread "ubifs_bgt0_2" started, PID 219
[   10.258529] UBIFS (ubi0:2): recovery needed
[   10.372311] UBIFS (ubi0:2): recovery completed
[   10.372520] UBIFS (ubi0:2): UBIFS: mounted UBI device 0, volume 2, name "rootfs_data"
[   10.375700] UBIFS (ubi0:2): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[   10.383744] UBIFS (ubi0:2): FS size: 106913792 bytes (101 MiB, 842 LEBs), journal size 5332992 bytes (5 MiB, 42 LEBs)
[   10.393589] UBIFS (ubi0:2): reserved for root: 4952683 bytes (4836 KiB)
[   10.404152] UBIFS (ubi0:2): media format: w5/r0 (latest is w5/r0), UUID 04B88E9E-351B-4AAE-A4FB-580128045056, small LPT model
[   10.421766] mount_root: loading kmods from internal overlay
[   10.871309] kmodloader: loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
[   10.918725] Key type encrypted registered
[   10.950082] device-mapper: ioctl: 4.43.0-ioctl (2020-10-01) initialised: dm-devel@redhat.com
[   10.988319] raid6: skip pq benchmark and using algorithm neonx8
[   10.988365] raid6: using neon recovery algorithm
[   10.995419] xor: measuring software checksum speed
[   11.008460]    arm4regs        :   940 MB/sec
[   11.025440]    8regs           :   582 MB/sec
[   11.040271]    32regs          :   665 MB/sec
[   11.050184]    neon            :   996 MB/sec
[   11.050207] xor: using function: neon (996 MB/sec)
[   11.298606] Btrfs loaded, crc32c=crc32c-generic
[   11.456368] SCSI subsystem initialized
[   11.480612] usb-storage 2-1:1.0: USB Mass Storage device detected
[   11.481295] scsi host0: usb-storage 2-1:1.0
[   11.486258] usbcore: registered new interface driver usb-storage
[   11.492883] usbcore: registered new interface driver uas
[   11.496323] kmodloader: done loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
[   11.583415] block: attempting to load /tmp/ubifs_cfg/upper/etc/config/fstab
[   11.587741] block: extroot: not configured
[   11.591542] mount_root: switching to ubifs overlay
[   11.603911] urandom-seed: Seeding with /etc/urandom.seed
[   11.855100] procd: - early -
[   11.855364] procd: - watchdog -
[   12.505879] procd: - watchdog -
[   12.508664] procd: - ubus -
[   12.649728] usb 2-1: reset SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[   12.662323] procd: - init -
[   12.869859] usb 2-1: reset SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[   13.089803] usb 2-1: reset SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[   13.309958] usb 2-1: reset SuperSpeed Gen 1 USB device number 2 using xhci-hcd

And here is the result of lsusb -t:

/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/0p, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    |__ Port 1: Dev 2, If 0, Class=, Driver=usb-storage, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M

And partial result of lsusb -v:

Bus 002 Device 002: ID 0bc2:50a0 Seagate    FA GoFlex Desk
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         9
  idVendor           0x0bc2 
  idProduct          0x50a0 
  bcdDevice            1.00
  iManufacturer           2 Seagate
  iProduct                3    FA GoFlex Desk
  iSerial                 1 12398888
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x002c
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 
      bInterfaceSubClass      6 
      bInterfaceProtocol     80 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x0016
  bNumDeviceCaps          2
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000000
      (Missing must-be-set LPM bit!)
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x00
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat        2047 micro seconds
Device Status:     0x0001
  Self Powered

Do you have the "block-mount" package? I plugged a USB stick on my NanoPi R4S with LXC container inside, it is able to survive a reboot.

This looks like a bug in the USB drivers; please, report it.

How would you turn it back on if it powered off?

This is quite common, as many of the supported devices lack the hardware for a real shut down.