在挂载点目录中运行“df”或“ls”时无响应

在挂载点目录中运行“df”或“ls”时无响应

在我的 Ubuntu 20.04 机器上,有多个外部硬盘通过 16 端口 USB 3.0 集线器连接,所有这些硬盘都安装在一个公共父目录中的自己的目录中/mnt/data。例如,其中一个硬盘安装在/mnt/data/drive001

df有时,运行命令或ls在时终端没有响应/mnt/data

为了让命令返回一些输出,一种有效的方法是手动运行,ls /mnt/data/driveXXX直到我们遇到一个似乎在几秒钟内没有返回任何输出的命令,然后执行Ctrl+ Z,运行sudo umount /mnt/data/driveXXXsudo umount /mnt/data/driveXXX -f,然后继续对所有驱动器执行此操作。

只有这样,df或才能正常ls /mnt/data工作。但是,运行sudo mount -a重新安装所有驱动器的操作将被冻结。重新安装所有驱动器的唯一方法是关闭并打开 USB 集线器,然后运行sudo mount -a

我们如何找出导致此问题的真正原因?


这些是 USB 3.0 驱动器,连接到 USB 3.0 集线器,该集线器连接到主板上的 USB 3.0 端口

该问题出现在不同的驱动器上,并不总是出现在同一个驱动器上。

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-电视:

$ 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 

还注意到sudo blkiud2 个驱动器的输出相同,这有问题吗?/dev/sdi/dev/sdeUUID

编辑:使用以下方法解决重复的 UUIDsudo 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*

无输出。

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

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

smartctl -a /dev/sdxx

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

USB 自动暂停已禁用

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

Ubuntu 20.04 桌面安装

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

答案1

希捷

sudo smartctl -a /dev/sdx

/dev/sde/、/dev/sdi、/dev/sdm,所有 Seagate 硬盘,均出现读取/寻道/ECC 错误。

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 

西部数据

您可能遇到多个问题。

对于您所有的西部数据硬盘,我们都需要离散的 USB 设备代码...

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. 

禁用uas配置文件

我们将尝试禁用 USB3 UAS(USB 连接 SCSI),看看是否有帮助......

# 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

笔记:您可能希望查看hdparm -Bhdparm -J命令。

  -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!).

相关内容