Score:0

How do i find which external hard drive is not being mounted / has been unmounted

ye flag

I have like a dozen of Western Digital external hard drives, that are being automatically detected and mounted by Ubuntu. Occasionally, 1 of them is being "unmounted", i don't know why. If it's a new hard drive, i obviously will know which one, and i just unplug and replug, and that would do the trick, but for those not new, i won't know which one was unmounted.

Question: How do i know which one or how can i instruct Ubuntu to remount it? I can't unplug and replug them 1 by 1(trial and error), as obviously it's not the right approach. Also, note that i did not use /etc/fstab.

The best approach that i found, but which is still time-consuming is to find the serial number of the mounted hard disks, and find which one is missing, which obviously, i would need to have a list of the serial numbers of all my hard disks:

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

P.S Note that other troubleshooting approaches such as blkid, fdisk, lsblk, lshw, lsusb, etc does not work as i can't even see the /dev/sdxx for that drive. The unmounted hard-disk is not there.

EDIT
grep -i FPDMA /var/log/syslog*
Nothing comes up

grep -i sdr /var/log/syslog*
/var/log/syslog.1:Feb 5 10:25:42 u ntfs-3g[3113891]: Unmounting /dev/sdr1 (Elements)
/var/log/syslog.1:Feb 5 10:25:42 u ntfs-3g[3113891]: Failed to sync device /dev/sdr1: Input/output error
/var/log/syslog.1:Feb 5 10:25:42 u ntfs-3g[3113891]: Failed to close volume /dev/sdr1: Input/output error
/var/log/syslog.1:Feb 5 10:28:42 u smartd[2145]: Device: /dev/sdr [SAT], removed ATA device: No such device
Binary file /var/log/syslog.3.gz matches

lsusb
Bus 002 Device 005: ID 1058:2627 Western Digital Technologies, Inc. My Passport 2627
Bus 002 Device 003: ID 0480:0900 Toshiba America Inc MQ04UBF100
Bus 002 Device 087: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 002 Device 081: ID 05e3:0626 Genesys Logic, Inc. My Passport 2627
Bus 002 Device 093: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 002 Device 091: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 002 Device 088: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 002 Device 084: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 002 Device 079: ID 05e3:0626 Genesys Logic, Inc. External USB 3.0
Bus 002 Device 092: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 002 Device 089: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 002 Device 086: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 002 Device 083: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 002 Device 078: ID 05e3:0626 Genesys Logic, Inc.
Bus 002 Device 085: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 002 Device 082: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 002 Device 080: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 002 Device 077: ID 05e3:0626 Genesys Logic, Inc. USB3.1 Hub
Bus 002 Device 076: ID 05e3:0626 Genesys Logic, Inc. USB3.1 Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 258a:003a SINO WEALTH Gaming KB
Bus 001 Device 009: ID 1058:25ed Western Digital Technologies, Inc.
Bus 001 Device 008: ID 1058:25a3 Western Digital Technologies, Inc. Elements Desktop (WDBWLG)
Bus 001 Device 007: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 006: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 005: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 004: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

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
ru flag
Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/133915/discussion-on-question-by-jumping-monkey-how-do-i-find-which-external-hard-drive).
Score:0
ru flag

USB Attached SCSI (UAS) or USB Attached SCSI Protocol (UASP)

Read about it here https://en.wikipedia.org/wiki/USB_Attached_SCSI

In the below script, I've mapped out the three different kinds of WD USB drives that you have connected. Through trial and testing, you may be able to remove 1 or 2 of the drive types, if not all 3 require this mod.

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
jumping_monkey avatar
ye flag
Done(Added only the Elements Desktop - as this is the problematic one), thanks a lot buddy! I don't know if it will solve the problem, but it sounds right. Thanks again!
heynnema avatar
ru flag
@jumping_monkey Remember to lay down a fresh partition table when the drive is new (this will wipe the drive), before creating partitions.
jumping_monkey avatar
ye flag
buddy, thanks a lot for your advice. Normally, when i PnP those external WD Elements, Ubuntu does the right thing for me. I will go google and read a bit about it. If you have a link, at hand, that i can use, that is most welcome too :).
heynnema avatar
ru flag
@jumping_monkey I **never** use the as-is-new formatting for new drives. I always lay down a fresh partition table before creating partitions. There are two different types of partition tables.... MBR and GPT. GPT should be used on 2TB+ drives and/or UEFI computers. Use `sudo fdisk -l` to see what yours are formatted as.
jumping_monkey avatar
ye flag
Interesting, i updated my question with a sample sdX, using the command you suggested. I am seeing `GPT`.
heynnema avatar
ru flag
@jumping_monkey Just curious... what do you use all those disks for?
jumping_monkey avatar
ye flag
Have you heard of the Chia cryptocurrency? They use hard-drives as proof of space, so i am building a few `farms` as they call it. 1 farm is about 108 GB.
heynnema avatar
ru flag
@jumping_monkey What is "proof of space"? Any disk problems since the patch?
jumping_monkey avatar
ye flag
It's a blockchain term, sorry buddy, i am not very qualified to explain it. Go on Chia website, they explain it well there. I have not restarted my ubuntu yet, i am waiting for the week-end to come, so that i have more time to also label the hard drives with the S/N as well, in case i need it.
heynnema avatar
ru flag
@jumping_monkey I Googled chia cryptocurrency and one hit said... Is Chia worth mining? If you recall, Chia mining reduces your SSD lifespan tremendously, as it constantly writes an incredible amount of new data. ... These drives aren't worth much, as Chia plotting can destroy average SSDs in less than two months.Sep 3, 2021
heynnema avatar
ru flag
@jumping_monkey Better to label the drives with a name label, and mark each drive with a tag with that name. Use `tune2fs`.
jumping_monkey avatar
ye flag
Yup, i am using an NVME to plot with quite a high endurance. My main problem here is not the lifespan, but that those external drives(to hold the farms) are expensive. So i cant plot without new hard drives :/
jumping_monkey avatar
ye flag
How do you do a name label? You mean i do it in /etc/fstab? and use the label i use there?
jumping_monkey avatar
ye flag
Ok, i will look for `tune2fs`, thanks buddy.
heynnema avatar
ru flag
@jumping_monkey Use `tune2fs` to label them, and enter each in /etc/fstab using name labels so you can do a `mount -a`.
jumping_monkey avatar
ye flag
Ok great, will search more about what you just recommended. Appreciate it.
heynnema avatar
ru flag
@jumping_monkey Do `man tune2fs` and look for the -L option. Don't use any spaces in the label names... use underscores if you like.
jumping_monkey avatar
ye flag
Ok, great saw it, thanks a lot buddy!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.