External storage not recognised (USB 3.0)

Hi all,

In an effort to mount an USB3.0 external storage device (2TB) on balenaOS 2.29.2+rev1 with an UP2 board the OS crashes and goes offline when using the procedure mounting-external-storage-media.

The device shows up in lsusb on Bus 002 Device 002;

root@32f812a:~# lsusb
Bus 001 Device 003: ID 1bcf:2286 Sunplus Innovation Technology Inc. 
Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 002 Device 002: ID 1058:25a2 Western Digital Technologies, Inc. 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

However, blkid doesn’t list the device

root@32f812a:~# blkid
/dev/mmcblk0p6: LABEL="resin-data" UUID="0b4733b6-de69-4241-a0ec-670aa4c929ca" TYPE="ext4"
/dev/mmcblk0p5: LABEL="resin-state" UUID="1410b587-9e20-4eae-838b-3d0b2e187c71" TYPE="ext4"
/dev/mmcblk0p3: LABEL="resin-rootB" UUID="acd590cb-8c56-4e9d-8ba5-fd88f68be3bb" TYPE="ext4"
/dev/mmcblk0p2: LABEL="resin-rootA" UUID="9c7144d7-65c4-47fd-a8a0-8c8161dd7d0a" TYPE="ext4"
/dev/mmcblk0p1: LABEL="resin-boot" UUID="C000-7CE0" TYPE="vfat"

diving a bit deeper into the HostOs with dmesg shows the following output;

[  182.354297] sd 2:0:0:0: timing out command, waited 180s
[  362.371308] sd 2:0:0:0: timing out command, waited 180s
[  542.383967] sd 2:0:0:0: timing out command, waited 180s
[  542.384143] sd 2:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=0x00 driverbyte=0x08
[  542.384312] sd 2:0:0:0: [sda] Sense Key : 0x4 [current] 
[  542.384406] sd 2:0:0:0: [sda] ASC=0x44 <<vendor>>ASCQ=0x81 
[  722.399873] sd 2:0:0:0: timing out command, waited 180s
[  722.400043] sd 2:0:0:0: [sda] Test WP failed, assume Write Enabled
[  902.410337] sd 2:0:0:0: timing out command, waited 180s
[  902.410496] sd 2:0:0:0: [sda] Asking for cache data failed
[  902.410619] sd 2:0:0:0: [sda] Assuming drive cache: write through
[  902.414969] sd 2:0:0:0: [sda] Unit Not Ready
[  902.415075] sd 2:0:0:0: [sda] Sense Key : 0x4 [current] 
[  902.415168] sd 2:0:0:0: [sda] ASC=0x44 <<vendor>>ASCQ=0x81 
[  962.688999] systemd-udevd[28]: seq 3351 '/devices/pci0000:00/0000:00:15.0/usb2/2-2/2-2:1.0/host2/target2:0:0/2:0:0:0/block/sda' is taking a long time
[ 1082.429308] sd 2:0:0:0: timing out command, waited 180s
[ 1082.695739] systemd-udevd[28]: seq 3351 '/devices/pci0000:00/0000:00:15.0/usb2/2-2/2-2:1.0/host2/target2:0:0/2:0:0:0/block/sda' killed
[ 1082.696571] systemd-udevd[28]: worker [72] terminated by signal 9 (Killed)
[ 1082.696709] systemd-udevd[28]: worker [72] failed while handling '/devices/pci0000:00/0000:00:15.0/usb2/2-2/2-2:1.0/host2/target2:0:0/2:0:0:0/block/sda'
[ 1262.447029] sd 2:0:0:0: timing out command, waited 180s
[ 1442.464204] sd 2:0:0:0: timing out command, waited 180s
[ 1442.464371] sd 2:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=0x00 driverbyte=0x08
[ 1442.464543] sd 2:0:0:0: [sda] Sense Key : 0x4 [current] 
[ 1442.464635] sd 2:0:0:0: [sda] ASC=0x44 <<vendor>>ASCQ=0x81 
[ 1472.466911] sd 2:0:0:0: timing out command, waited 30s
[ 1622.481334] sd 2:0:0:0: timing out command, waited 180s
[ 1802.499324] sd 2:0:0:0: timing out command, waited 180s
[ 1802.499492] sd 2:0:0:0: [sda] Attached SCSI disk

It seems the device is not recognised as storage, what are we missing here?

Hi @remsol,

Can you please send us the link to your device and grant support access so we can have a look into it?

@nghiant2710, thanks for your prompt reply. I have granted support access and the UUID is 32f812aed23125942fd9cc6de7acfc79. Please be aware the device is running the simple-node-server application for the time being. Our custom application will crash the device by trying to mount the disk and will go offline such that it becomes unreachable.

Hello @remsol
Does this external hard drive work with other computers?
Does it have an external power supply or is it usb powered?
Can you try a hard drive with an external power supply?

The USB powered external drive (WDBU6Y0020BBK-WESN) has been formatted in EXT4 and works on other Ubuntu systems.

We got a duplicate setup here at the office except for the harddrive we use a 32GB SanDisk USB which works perfectly fine (EXT4 formatted). I’ve granted support for this device with UUID: 5e875a7061476afa83e6830d6de27b12

Unfortunately, I don’t have a 2TB externally powered drive at my disposal right now.

The dmesg output looks like the drive is not working correctly (most probably because it is underpowered if it works on other computers).
Are you using a double usb cable (like this https://i.ebayimg.com/images/i/202403049004-0-1/s-l1000.jpg ) ?

The 5e875a7061476afa83e6830d6de27b12 appears to be working correctly.

@zvin, we have replaced the power source of the UP2 board. Now everything works fine… Thanks for the excellent support