如何找到哪个外部硬盘驱动器未安装/已卸载

如何找到哪个外部硬盘驱动器未安装/已卸载

我有十几个 Western Digital 外置硬盘,Ubuntu 会自动检测并安装它们。偶尔,其中一个硬盘会被“卸载”,我不知道为什么。如果是新硬盘,我当然会知道是哪一个,我只需拔下再重新插上,就可以解决问题,但对于那些不是新的,我不知道哪一个被卸载了。

问题: 我如何知道哪一个或如何指示 Ubuntu 重新安装它?我无法逐个拔下并重新插入它们(反复试验),因为这显然不是正确的方法。另外,请注意,我没有使用/etc/fstab

我发现的最好的方法,但仍然很耗时,是找到已安装硬盘的序列号,并找出哪一个丢失了,显然,我需要有所有硬盘的序列号列表:

sudo smartctl --all /dev/sda | grep -E 'Serial\ Number'

PS 请注意,其他故障排除方法(例如blkid,,,,,等)不起作用,因为我甚至看不到fdisk该驱动器。lsblklshwlsusb/dev/sdxx卸载硬盘不存在。

编辑
grep -i FPDMA /var/log/syslog*
沒有任何反应

grep -i sdr /var/log/syslog*
/var/log/syslog.1:Feb 5 10:25:42 u ntfs-3g[3113891]: 正在卸载 /dev/sdr1 (元素)
/var/log/syslog.1:Feb 5 10:25:42 u ntfs-3g[3113891]: 无法同步设备 /dev/sdr1:输入/输出错误
/var/log/syslog.1:Feb 5 10:25:42 u ntfs-3g[3113891]: 无法关闭卷 /dev/sdr1:输入/输出错误
/var/log/syslog.1:Feb 5 10:28:42 u smartd[2145]: 设备:/dev/sdr [SAT],已移除 ATA 设备:没有此设备
二进制文件 /var/log/syslog.3.gz 匹配

lsusb
总线 002 设备 005:ID 1058:2627 Western Digital Technologies, Inc. My Passport 2627
总线 002 设备 003:ID 0480:0900 Toshiba America Inc MQ04UBF100
总线 002 设备 087:ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
总线 002 设备 081:ID 05e3:0626 Genesys Logic, Inc. My Passport 2627
总线 002 设备 093:ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
总线 002 设备 091:ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
总线 002 设备 088:ID 1058:25a3 Western Digital Technologies, Inc. Elements台式机(WDBWLG)
总线 002 设备 084:ID 1058:25a3 Western Digital Technologies, Inc. Elements 台式
机(WDBWLG)总线 002 设备 079:ID 05e3:0626 Genesys Logic, Inc. 外部 USB 3.0
总线 002 设备 092:ID 1058:25a3 Western Digital Technologies, Inc. Elements 台式机(WDBWLG)
总线 002 设备 089:ID 1058:25a3 Western Digital Technologies, Inc. Elements 台式机(WDBWLG)总线
002 设备 086:ID 1058:25a3 Western Digital Technologies, Inc. Elements 台式机(WDBWLG)
总线 002 设备 083:ID 1058:25a3 Western Digital Technologies, Inc. Elements 台式机(WDBWLG)总线
002 设备 078:ID 05e3:0626 Genesys Logic, Inc.
总线 002 设备 085:ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
总线 002 设备 082:ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
总线 002 设备 080:ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
总线 002 设备 077:ID 05e3:0626 Genesys Logic, Inc. USB3.1 集线器
总线 002 设备 076:ID 05e3:0626 Genesys Logic, Inc. USB3.1 集线器
总线 002 设备 001:ID 1d6b:0003 Linux Foundation 3.0 根集线器 总线
001 设备 003:ID 258a:003a SINO WEALTH Gaming KB
总线 001 设备 009:ID 1058:25ed Western Digital Technologies, Inc.
总线 001 设备 008:ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
总线 001 设备 007:ID 05e3:0610 Genesys Logic, Inc. 4 端口集线器 总线
001 设备 006:ID 05e3:0610 Genesys Logic, Inc. 4 端口集线器 总线
001 设备 005:ID 05e3:0610 Genesys Logic, Inc. 4 端口集线器 总线
001 设备 004:ID 05e3:0610 Genesys Logic, Inc. 4 端口集线器 总线
001 设备 002:ID 05e3:0610 Genesys Logic, Inc. 4 端口
集线器 总线 001 设备 001:ID 1d6b:0002 Linux Foundation 2.0 根集线器

lsusb -tv

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/8p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
    |__ Port 1: Dev 76, If 0, Class=Hub, Driver=hub/4p, 5000M
        ID 05e3:0626 Genesys Logic, Inc. 
        |__ Port 2: Dev 78, If 0, Class=Hub, Driver=hub/4p, 5000M
            ID 05e3:0626 Genesys Logic, Inc. 
            |__ Port 4: Dev 92, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 2: Dev 86, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 3: Dev 89, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 1: Dev 83, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
        |__ Port 3: Dev 79, If 0, Class=Hub, Driver=hub/4p, 5000M
            ID 05e3:0626 Genesys Logic, Inc. 
            |__ Port 3: Dev 91, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 1: Dev 84, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 4: Dev 93, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 2: Dev 88, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
        |__ Port 1: Dev 77, If 0, Class=Hub, Driver=hub/4p, 5000M
            ID 05e3:0626 Genesys Logic, Inc. 
            |__ Port 4: Dev 85, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 2: Dev 80, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
            |__ Port 3: Dev 82, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
        |__ Port 4: Dev 81, If 0, Class=Hub, Driver=hub/4p, 5000M
            ID 05e3:0626 Genesys Logic, Inc. 
            |__ Port 3: Dev 87, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
    |__ Port 3: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        ID 0480:0900 Toshiba America Inc MQ04UBF100
    |__ Port 4: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        ID 1058:2627 Western Digital Technologies, Inc.  /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        ID 05e3:0610 Genesys Logic, Inc. 4-port hub
        |__ Port 3: Dev 6, If 0, Class=Hub, Driver=hub/4p, 480M
            ID 05e3:0610 Genesys Logic, Inc. 4-port hub
        |__ Port 1: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M
            ID 05e3:0610 Genesys Logic, Inc. 4-port hub
        |__ Port 4: Dev 7, If 0, Class=Hub, Driver=hub/4p, 480M
            ID 05e3:0610 Genesys Logic, Inc. 4-port hub
            |__ Port 2: Dev 9, If 0, Class=Mass Storage, Driver=usb-storage, 480M
                ID 1058:25ed Western Digital Technologies, Inc. 
            |__ Port 1: Dev 8, If 0, Class=Mass Storage, Driver=usb-storage, 480M
                ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
        |__ Port 2: Dev 5, If 0, Class=Hub, Driver=hub/4p, 480M
            ID 05e3:0610 Genesys Logic, Inc. 4-port hub
    |__ Port 7: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        ID 258a:003a  
    |__ Port 7: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 12M
        ID 258a:003a

sudo fdisk -l
Disk /dev/sdt: 12.75 TiB, 14000486088704 bytes, 27344699392 sectors
Disk model: Elements 25A3   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 11B03256-64E9-4DDF-B8DC-09C8D167D338

Device     Start         End     Sectors  Size Type
/dev/sdt1   2048 27344697343 27344695296 12.8T Microsoft basic data

答案1

USB 连接 SCSI (UAS) 或 USB 连接 SCSI 协议 (UASP)

点击这里阅读https://en.wikipedia.org/wiki/USB_Attached_SCSI

在下面的脚本中,我列出了您连接的三种不同类型的 WD USB 驱动器。通过试用和测试,您可能能够删除其中 1 或 2 种驱动器类型,如果不是所有 3 种驱动器类型都需要此修改的话。

Bus 002 Device 005: ID 1058:2627 Western Digital Technologies, Inc. My Passport 2627
Bus 002 Device 083: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 001 Device 009: ID 1058:25ed Western Digital Technologies, Inc.

# drop this into /etc/modprobe.d/disable_uas.conf
# should look like this:
# -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 for single/multiple disks:
# options usb-storage quirks=059f:105e:u 
# options usb-storage quirks=059f:105f:u,059f:105e:u,174c:1351:u
#
# commands to complete this install:
# sudo update-initramfs -u
# reboot
#
# WD My Passport, WD Elements Desktop, WD
options usb-storage quirks=1058:2627:u,1058:25a3:u,1058:25ed:u

相关内容