Unresponsive when running `df` or `ls` in a Directory of Mount Points

On my Ubuntu 20.04 machine with multiple external hard drives connected via a 16-port USB 3.0 hub, all these drives are mounted into their own directories in a common parent directory /mnt/data. For example, one of the drives is mounted at /mnt/data/drive001.

Sometimes, the terminal is unresponsive when running the commands df or ls in /mnt/data.

In order to get the command returning some output, one method that worked was to manually run ls /mnt/data/driveXXX until we encounter one that appears to not return any output in seconds, then do a Ctrl+Z, and run sudo umount /mnt/data/driveXXX or sudo umount /mnt/data/driveXXX -f, then continue doing this for all the drives.

Only then does df or ls /mnt/data work. However, running sudo mount -a to remount all the drives back will get frozen. The only way to remount all the drives is to power off and on the USB hub, then run sudo mount -a.

How do we find out the real problem causing this?


These are USB 3.0 drives attached to a USB 3.0 hub connected to a USB 3.0 port on the motherboard

The problem occurs with different drives, not always the same drives.

lsusb:

$ lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 055: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 004 Device 053: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 004 Device 049: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 004 Device 044: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 004 Device 039: ID 0bda:0411 Realtek Semiconductor Corp. 
Bus 004 Device 054: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 004 Device 050: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 004 Device 045: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 004 Device 040: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 004 Device 036: ID 0bda:0411 Realtek Semiconductor Corp. 
Bus 004 Device 051: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 004 Device 052: ID 0bc2:ab38 Seagate RSS LLC Backup Plus Hub
Bus 004 Device 046: ID 0bc2:ab45 Seagate RSS LLC 
Bus 004 Device 048: ID 0bc2:ab38 Seagate RSS LLC Backup Plus Hub
Bus 004 Device 041: ID 0bc2:ab45 Seagate RSS LLC USB3.2 Hub
Bus 004 Device 043: ID 0bc2:ab38 Seagate RSS LLC Backup Plus Hub
Bus 004 Device 037: ID 0bc2:ab45 Seagate RSS LLC 
Bus 004 Device 034: ID 0bda:0411 Realtek Semiconductor Corp. USB3.2 Hub
Bus 004 Device 047: ID 1058:264d Western Digital Technologies, Inc. 
Bus 004 Device 042: ID 1058:264d Western Digital Technologies, Inc. 
Bus 004 Device 038: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 004 Device 035: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 004 Device 033: ID 0bda:0411 Realtek Semiconductor Corp. 
Bus 004 Device 032: ID 0bda:0411 Realtek Semiconductor Corp. USB3.2 Hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 071: ID 0bda:5411 Realtek Semiconductor Corp. 
Bus 003 Device 069: ID 0bda:5411 Realtek Semiconductor Corp. 
Bus 003 Device 074: ID 0bc2:ab44 Seagate RSS LLC 
Bus 003 Device 072: ID 0bc2:ab44 Seagate RSS LLC USB2.1 Hub
Bus 003 Device 070: ID 0bc2:ab44 Seagate RSS LLC 
Bus 003 Device 068: ID 0bda:5411 Realtek Semiconductor Corp. USB2.1 Hub
Bus 003 Device 067: ID 0bda:5411 Realtek Semiconductor Corp. 
Bus 003 Device 066: ID 0bda:5411 Realtek Semiconductor Corp. USB2.1 Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 1e71:2007 NZXT 
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lsusb -tv:

$ lsusb -tv
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
    |__ Port 2: Dev 32, If 0, Class=Hub, Driver=hub/4p, 5000M
        ID 0bda:0411 Realtek Semiconductor Corp. 
        |__ Port 1: Dev 33, If 0, Class=Hub, Driver=hub/4p, 5000M
            ID 0bda:0411 Realtek Semiconductor Corp. 
            |__ Port 4: Dev 47, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:264d Western Digital Technologies, Inc. 
            |__ Port 2: Dev 38, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 3: Dev 42, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:264d Western Digital Technologies, Inc. 
            |__ Port 1: Dev 35, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
        |__ Port 2: Dev 34, If 0, Class=Hub, Driver=hub/4p, 5000M
            ID 0bda:0411 Realtek Semiconductor Corp. 
            |__ Port 3: Dev 46, If 0, Class=Hub, Driver=hub/3p, 5000M
                ID 0bc2:ab45 Seagate RSS LLC 
                |__ Port 1: Dev 52, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                    ID 0bc2:ab38 Seagate RSS LLC Backup Plus Hub
            |__ Port 1: Dev 37, If 0, Class=Hub, Driver=hub/3p, 5000M
                ID 0bc2:ab45 Seagate RSS LLC 
                |__ Port 1: Dev 43, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                    ID 0bc2:ab38 Seagate RSS LLC Backup Plus Hub
            |__ Port 4: Dev 51, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 2: Dev 41, If 0, Class=Hub, Driver=hub/3p, 5000M
                ID 0bc2:ab45 Seagate RSS LLC 
                |__ Port 1: Dev 48, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                    ID 0bc2:ab38 Seagate RSS LLC Backup Plus Hub
        |__ Port 3: Dev 36, If 0, Class=Hub, Driver=hub/4p, 5000M
            ID 0bda:0411 Realtek Semiconductor Corp. 
            |__ Port 3: Dev 50, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 1: Dev 40, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 4: Dev 54, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 2: Dev 45, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
        |__ Port 4: Dev 39, If 0, Class=Hub, Driver=hub/4p, 5000M
            ID 0bda:0411 Realtek Semiconductor Corp. 
            |__ Port 1: Dev 44, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 2: Dev 49, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 3: Dev 53, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 4: Dev 55, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 2: Dev 66, If 0, Class=Hub, Driver=hub/4p, 480M
        ID 0bda:5411 Realtek Semiconductor Corp. 
        |__ Port 1: Dev 67, If 0, Class=Hub, Driver=hub/4p, 480M
            ID 0bda:5411 Realtek Semiconductor Corp. 
        |__ Port 2: Dev 68, If 0, Class=Hub, Driver=hub/4p, 480M
            ID 0bda:5411 Realtek Semiconductor Corp. 
            |__ Port 3: Dev 74, If 0, Class=Hub, Driver=hub/3p, 480M
                ID 0bc2:ab44 Seagate RSS LLC 
            |__ Port 1: Dev 70, If 0, Class=Hub, Driver=hub/3p, 480M
                ID 0bc2:ab44 Seagate RSS LLC 
            |__ Port 2: Dev 72, If 0, Class=Hub, Driver=hub/3p, 480M
                ID 0bc2:ab44 Seagate RSS LLC 
        |__ Port 3: Dev 69, If 0, Class=Hub, Driver=hub/4p, 480M
            ID 0bda:5411 Realtek Semiconductor Corp. 
        |__ Port 4: Dev 71, If 0, Class=Hub, Driver=hub/4p, 480M
            ID 0bda:5411 Realtek Semiconductor Corp. 
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
        ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
        ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
        |__ Port 2: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 12M
            ID 1e71:2007 NZXT 

Also noticed in the output of sudo blkiud that 2 drives /dev/sdi and /dev/sde have the same UUID, is this problematic?

Edit: Solved duplicate UUID using sudo ntfslabel --new-half-serial="12345678" /dev/sdi2

/dev/sdi2: LABEL="Seagate Backup Plus Drive" UUID="22E6B3D5E6B3A785" TYPE="ntfs" PTTYPE="atari" PARTLABEL="Basic data partition" PARTUUID="54be5c08-a6d5-4909-85c9-62d6fda3026f"
/dev/sde2: LABEL="Seagate Backup Plus Drive" UUID="22E6B3D5E6B3A785" TYPE="ntfs" PTTYPE="atari" PARTLABEL="Basic data partition" PARTUUID="817ab49f-318e-4a0d-9bac-94f8a9cdca7f"
/dev/sdf1: LABEL="Elements" UUID="6C4646E14646AC20" TYPE="ntfs" PTTYPE="atari" PARTLABEL="Elements" PARTUUID="20cea80d-7d17-4f56-868d-71ee44300381"
/dev/sdj1: LABEL="Elements" UUID="427CE62D7CE61B83" TYPE="ntfs" PTTYPE="atari" PARTLABEL="Elements" PARTUUID="04b6f458-ae99-4c7a-9c00-545e6401212f"
/dev/sdp1: LABEL="Elements" UUID="321C481F1C47DC8B" TYPE="ntfs" PTTYPE="atari" PARTLABEL="Elements" PARTUUID="a273a12d-ab32-4170-ab8d-fc7cca5eba21"
/dev/sdm1: PARTLABEL="Microsoft reserved partition" PARTUUID="284b5e84-19aa-4568-843c-34a5993109ad"
/dev/sdi1: PARTLABEL="Microsoft reserved partition" PARTUUID="7c8f596a-1c06-4e03-9bfb-312f63fbc1b0"
/dev/sde1: PARTLABEL="Microsoft reserved partition" PARTUUID="d0eb2a7f-e163-4a31-89b8-b58696ee625a"

/etc/fstab

UUID=d76411a4-2c0d-4b8b-9fb0-e6eb26e525fd /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=7CF6-00B7  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0

# External USB drives
UUID=FCB2D174B2D1343C   /mnt/data/drive001     ntfs    defaults,nofail      0       0
UUID=6ACE0228CE01ED5F   /mnt/data/drive002     ntfs    defaults,nofail      0       0
UUID=16F0FB81F0FB6581   /mnt/data/drive003     ntfs    defaults,nofail      0       0
UUID=90AA1250AA123368   /mnt/data/drive004     ntfs    defaults,nofail      0       0
UUID=321C481F1C47DC8B   /mnt/data/drive005     ntfs    defaults,nofail      0       0
UUID=6CC82B33C82AFB4A   /mnt/data/drive006     ntfs    defaults,nofail      0       0
UUID=427CE62D7CE61B83   /mnt/data/drive007     ntfs    defaults,nofail      0       0
UUID=6C4646E14646AC20   /mnt/data/drive008     ntfs    defaults,nofail      0       0
UUID=1A8A395A8A39341B   /mnt/data/drive009     ntfs    defaults,nofail      0       0
UUID=70621B4B621B1586   /mnt/data/drive010     ntfs    defaults,nofail      0       0
UUID=C43CED443CED325A   /mnt/data/drive011     ntfs    defaults,nofail      0       0
UUID=0C0616040615EF86   /mnt/data/drive012     ntfs    defaults,nofail      0       0
UUID=0E1CF8691CF84CE9   /mnt/data/drive013     ntfs    defaults,nofail      0       0
UUID=A0C895FBC895D040   /mnt/data/drive014     ntfs    defaults,nofail      0       0
UUID=22E6B3D5E6B3A785   /mnt/data/drive015     ntfs    defaults,nofail      0       0
UUID=12345678E6B3A785   /mnt/data/drive016     ntfs    defaults,nofail      0       0

grep -i FPDMA /var/log/syslog*

No output.

grep -i /dev/sd /var/log/syslog*

https://paste.ubuntu.com/p/Q8TKZX8TCp/

smartctl -a /dev/sdxx

https://paste.ubuntu.com/p/km2YSPc2Pc/

USB autosuspend is disabled

$ cat /sys/module/usbcore/parameters/autosuspend
-1

Ubuntu 20.04 Desktop installation

uname -a
Linux x-pc 5.8.0-53-generic #60~20.04.1-Ubuntu SMP Thu May 6 09:52:46 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Seagate

sudo smartctl -a /dev/sdx

/dev/sde/, /dev/sdi, /dev/sdm, all Seagate drives, have read/seek/ECC errors.

Bus 004 Device 052: ID 0bc2:ab38 Seagate RSS LLC Backup Plus Hub
Bus 004 Device 046: ID 0bc2:ab45 Seagate RSS LLC 
Bus 003 Device 074: ID 0bc2:ab44 Seagate RSS LLC 

Western Digital

You may have multiple problems.

For all of your Western Digital drives, we need the discrete USB device codes...

Bus 004 Device 055: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 004 Device 047: ID 1058:264d Western Digital Technologies, Inc. 

disable_uas.conf

We'll try and disable USB3 UAS (USB Attached SCSI) and see if that helps...

# drop this into /etc/modprobe.d/disable_uas.conf
# -rw-r--r--   1 root root  505 Apr 30 11:36 disable-uas.conf
#
# sources:
# https://unix.stackexchange.com/questions/525290/usb-hdd-not-found
# https://unix.stackexchange.com/questions/239782/connection-problem-with-usb3-external-storage-on-linux-uas-driver-problem
#
# examples:
# options usb-storage quirks=059f:105e:u 
# options usb-storage quirks=059f:105f:u,059f:105e:u,174c:1351:u
#
# commands:
# sudo update-initramfs -u
# reboot
#
# WD drives only
options usb-storage quirks=1058:25a3:u,1058:264d:u
# WD drives and Seagate drives
#options usb-storage quirks=1058:25a3:u,1058:264d:u,0bc2:ab38:u,0bc2:ab45:u,0bc2:ab44:u

Note: You may wish to review the hdparm -B and hdparm -J commands.

  -B     Get/set Advanced Power Management feature, if the drive supports
          it.  A  low  value  means aggressive power management and a high
          value means better performance.  Possible  settings  range  from
          values  1  through  127 (which permit spin-down), and values 128
          through 254 (which do not permit spin-down).  The highest degree
          of  power  management  is  attained with a setting of 1, and the
          highest I/O performance with a setting of 254.  A value  of  255
          tells  hdparm to disable Advanced Power Management altogether on
          the drive (not all drives support disabling it, but most do).

  -J     Get/set  the  Western Digital (WD) Green Drive's "idle3" timeout
          value.  This timeout controls how  often  the  drive  parks  its
          heads and enters a low power consumption state.  The factory de‐
          fault is eight (8) seconds, which is a very poor choice for  use
          with  Linux.   Leaving it at the default will result in hundreds
          of thousands of head load/unload cycles in a very  short  period
          of  time.   The  drive  mechanism  is  only rated for 300,000 to
          1,000,000 cycles, so leaving it at the default could  result  in
          premature  failure, not to mention the performance impact of the
          drive often having to wake-up before doing routine I/O.

          WD supply a WDIDLE3.EXE DOS utility for tweaking  this  setting,
          and you should use that program instead of hdparm if at all pos‐
          sible.  The reverse-engineered implementation in hdparm  is  not
          as  complete  as  the  original official program, even though it
          does seem to work on at a least a few drives.  A full power  cy‐
          cle  is  required  for any change in setting to take effect, re‐
          gardless of which program is used to tweak things.

          A setting of 30 seconds is recommended for Linux use.  Permitted
          values  are  from 8 to 12 seconds, and from 30 to 300 seconds in
          30-second increments.  Specify a value of zero  (0)  to  disable
          the WD idle3 timer completely (NOT RECOMMENDED!).