0

I have a 2 TB external USB HDD backup drive. While I was copying some files with nautilus (GUI file explorer) the cord got pulled, but did not come completely out. However, communication was interrupted some how (I'm not sure it ever totally dismounted or totally lost connection). Suffice to say the write failed.

Now I can't seem to mount it again, dmesg shows the following after I authorize the device with usbguard

[  849.092387] usb-storage 4-2:1.0: USB Mass Storage device detected
[  849.092639] scsi host0: usb-storage 4-2:1.0
[  849.092739] usb 4-2: authorized to connect
[  850.104040] scsi 0:0:0:0: Direct-Access     WD       Drive 2657       1030 PQ: 0 ANSI: 6
[  850.104233] sd 0:0:0:0: Attached scsi generic sg0 type 0
[  850.105371] sd 0:0:0:0: [sda] Spinning up disk...
[  851.127185] ......
...
[  858.295189] ......not responding...

I hear the device spinning then making a rather nasty (but fairly quitet) noise about 3 times

I do not see it in /media and I don't even see anything with the label sda in /dev. I tried plugging the drive in while I was booted into Windows and trying to diagnose it but did not really get anything. I know some people here have said sometimes these devices create a trash file that has a bad write to it or something when unplugging and causes problems. I have seen the file before, but if it is the problem I can't even get too it because I can't even see the folder for the disk!

This message is practically all I have, according too the computer, that it even exists

UPDATE 0:

I do see this in /sys/kernel/debug/usb/devices thanks to this answer:

T:  Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  6 Spd=5000 MxCh= 0
D:  Ver= 3.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
P:  Vendor=1058 ProdID=2657 Rev=10.30
S:  Manufacturer=Western Digital
S:  Product=Drive 2657
S:  SerialNumber=i removed it from here
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=896mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms

I have identified the place in /dev the device is, but it won't mount and it says it is not a block device (I put in XYZ in place of the numbers)

mount: /dev/bus/usb/XYZ/XYZ: /tmp/fix-drive is not a block device.

UPDATE 1:

I think the hardware is okay, @Brad, below pointed out a way to verify that, if I do a lsblk it shows up as an sda and it shows up with lsusb. I don't know how to get it to show up as a block device under something like /dev/sda though (apparently only top level directories in /dev/ are block devices).

UPDATE 2:

If I leave it for a while, lsblk sees it in /dev/sda and the folder appears in /dev/sda. If I try to mount it I get: mount: /tmp/fix-drive: can't read superblock on /dev/sda.

If I run sudo fdisk -l /dev/sda I get fdisk: cannot open /dev/sda: No such file or directory

Output of lsblk is:

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0     0B  0 disk 
nvme0n1     259:0    0 476.9G  0 disk 
├─nvme0n1p1 259:1    0   260M  0 part 
├─nvme0n1p2 259:2    0    16M  0 part 
├─nvme0n1p3 259:3    0  78.3G  0 part 
├─nvme0n1p4 259:4    0   500M  0 part /boot/efi
├─nvme0n1p5 259:5    0 392.5G  0 part /
├─nvme0n1p6 259:6    0   4.4G  0 part 
└─nvme0n1p8 259:7    0  1000M  0 part 

Additional logs from dmesg continued from before

[10321.876237] .............not responding...
[10514.168814] sd 0:0:0:0: [sda] tag#0 timing out command, waited 180s
[10694.180757] sd 0:0:0:0: [sda] tag#0 timing out command, waited 180s
[10874.188908] sd 0:0:0:0: [sda] tag#0 timing out command, waited 180s
[10874.188970] sd 0:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=DID_OK driverbyte=DRIVER_OK
[10874.188988] sd 0:0:0:0: [sda] Sense Key : Hardware Error [current] 
[10874.189020] sd 0:0:0:0: [sda] ASC=0x44 <<vendor>>ASCQ=0x81 
[10874.189043] sd 0:0:0:0: [sda] 0 512-byte logical blocks: (0 B/0 B)
[10874.189053] sd 0:0:0:0: [sda] 0-byte physical blocks
[11054.200777] sd 0:0:0:0: [sda] tag#0 timing out command, waited 180s
[11054.200829] sd 0:0:0:0: [sda] Test WP failed, assume Write Enabled
[11234.212778] sd 0:0:0:0: [sda] tag#0 timing out command, waited 180s
[11234.212810] sd 0:0:0:0: [sda] Asking for cache data failed
[11234.212815] sd 0:0:0:0: [sda] Assuming drive cache: write through
[11234.213392] sd 0:0:0:0: [sda] Attached SCSI disk
[11264.324770] sd 0:0:0:0: [sda] tag#0 timing out command, waited 30s
[12373.688612] /tmp/fix-drive: Can't open blockdev
[12381.408079] sd 0:0:0:0: [sda] tag#0 access beyond end of device
[12381.408086] I/O error, dev sda, sector 2 op 0x0:(READ) flags 0x1000 phys_seg 1 prio class 3
[12381.408102] EXT4-fs (sda): unable to read superblock

It seems to think the drive is 0b in size

UPDATE 3:

I disassembled the enclosure, which for this model was a messy process which necessitated breaking part of the plastic housing. I took the PCB out and tested continuity between the pins on the connector and their mounting/solder locations on the board. They all seemed to have continuity. To be sure I then tested the continuity between the pins and surface mount resistors which also seemed to have connectivity. They all seemed to have continuity with some surface mount circuit components. Most had resistors that seemed to be assigned too them and had continuity with them.

Anything else I could do to diagnose the board?

UPDATE 3.1:

More complete log (but without attempt to mount)

[  138.351630] sd 0:0:0:0: [sda] Spinning up disk...
[  236.649461] sd 0:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[  236.649467] sd 0:0:0:0: [sda] Sense not available.
[  236.649473] sd 0:0:0:0: [sda] 0 512-byte logical blocks: (0 B/0 B)
[  236.649474] sd 0:0:0:0: [sda] 0-byte physical blocks
[  236.649478] sd 0:0:0:0: [sda] Write Protect is off
[  236.649480] sd 0:0:0:0: [sda] Mode Sense: 00 00 00 00
[  236.649482] sd 0:0:0:0: [sda] Asking for cache data failed
[  236.649487] sd 0:0:0:0: [sda] Assuming drive cache: write through
[  236.649920] sd 0:0:0:0: [sda] Attached SCSI disk
[  243.591423] sd 0:0:0:0: [sda] Spinning up disk...
[  262.021407] sd 0:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[  262.021410] sd 0:0:0:0: [sda] Sense not available.
[  262.021415] sd 0:0:0:0: [sda] 0 512-byte logical blocks: (0 B/0 B)
[  262.021416] sd 0:0:0:0: [sda] 0-byte physical blocks
[  262.021419] sd 0:0:0:0: [sda] Write Protect is off
[  262.021421] sd 0:0:0:0: [sda] Mode Sense: 00 00 00 00
[  262.021424] sd 0:0:0:0: [sda] Asking for cache data failed
[  262.021431] sd 0:0:0:0: [sda] Assuming drive cache: write through
[  262.021874] sd 0:0:0:0: [sda] Attached SCSI disk
[  296.295799] sd 0:0:0:0: [sda] Spinning up disk...
[  524.427980] sd 0:0:0:0: [sda] tag#0 timing out command, waited 180s
[  704.434027] sd 0:0:0:0: [sda] tag#0 timing out command, waited 180s
[  884.451408] sd 0:0:0:0: [sda] tag#0 timing out command, waited 180s
[  884.451448] sd 0:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=DID_OK driverbyte=DRIVER_OK
[  884.451452] sd 0:0:0:0: [sda] Sense Key : Hardware Error [current] 
[  884.451455] sd 0:0:0:0: [sda] ASC=0x44 <<vendor>>ASCQ=0x81 
[  884.451459] sd 0:0:0:0: [sda] 0 512-byte logical blocks: (0 B/0 B)
[  884.451461] sd 0:0:0:0: [sda] 0-byte physical blocks
[ 1064.460333] sd 0:0:0:0: [sda] tag#0 timing out command, waited 180s
[ 1064.460378] sd 0:0:0:0: [sda] Test WP failed, assume Write Enabled
[ 1244.464759] sd 0:0:0:0: [sda] tag#0 timing out command, waited 180s
[ 1244.464803] sd 0:0:0:0: [sda] Asking for cache data failed
[ 1244.464809] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 1244.465165] sd 0:0:0:0: [sda] Attached SCSI disk
[ 1274.533228] sd 0:0:0:0: [sda] tag#0 timing out command, waited 30s
13
  • 1
    post the full output of the following: lsblk and sudo fdisk -l /dev/sda
    – Brad
    Commented Jan 6, 2023 at 22:57
  • @Brad I posted it, its weird Commented Jan 7, 2023 at 6:10
  • 1
    the fact that sda is intermittently showing up is definitely suggestive of a hardware fault, as if the hardware was good, you would definitely see /dev/sda ALL THE TIME. i would buy that 3rd party USB-SSD connector and break the physical drive out of the enclosure and then try again at this point.
    – Brad
    Commented Jan 7, 2023 at 9:11
  • 1
    you could try something like this to set up a basic monitor in a terminal window that shows the kernel logs -- you might be able to see the intermittent connecting/disconnecting better like this: tail -F /var/log/messages | grep sda
    – Brad
    Commented Jan 7, 2023 at 9:16
  • @Brad Unfortunately No file in /var/log called messages, any other file I may want too look at in there? Commented Jan 10, 2023 at 19:06

1 Answer 1

1

Not an easy one, but here are some suggestions:

Forget about trying to mount it until you can first ensure that the hardware (block device) is visible to the kernel. To do this, plug it in without mounting it. Then:

  • Try lsblk and see if you can see the sda there.
  • Try lsusb and see if it shows up there.

If neither of these show the block device (e.g., sda), then you might have broken the hardware. Depending on how important it is to recover, you might want to try another cable (did it break?) or, open up the external drive and extract the actual drive from the housing. Then try with an alternative USB connector to the one that shipped with the external drive -- something like this perhaps.

Ultimately, you want to be able to see /dev/sda first. Once you've gotten to that point, then the challenge around mounting starts... If you can see the device, but it still won't mount, then you could try using a tool called ddrescue. This will do a very low level copy of the data on the block device onto another drive (e.g., the main drive in the PC, or maybe another external drive). It is clever enough to jump over dodgy sections on the block device, and then provides tools for recovering the files off the drive onto another drive.

Ultimately, a lot of this depends on how valuable the data on the drive is. If you don't care about it, you could just try to reformat the drive with fdisk once you can see the block device, otherwise you may be in for a slog.

There are other tools that could be used alongside ddrescue that could help recovering certain types of files -- for example photorec could be used to recover images from the image the ddrescue produces.

Good luck with it!

18
  • 1
    if lsblk shows it then it should be in /dev/sda as that is what lsblk is looking at. try ls -la /dev/sda and see what it outputs.
    – Brad
    Commented Jan 6, 2023 at 22:53
  • 1
    hrm could be dodgy cable -- if its coming up and down, could be a connection in the cable is not connected properly...
    – Brad
    Commented Jan 6, 2023 at 23:00
  • 1
    looks can be deceiving - it could literally be a micro-fracture in 1 wire in that cable, or the connector, or even the USB port -- its a matter of process of elimination -- so try a different USB port, a different cable (if you have a spare) and work through all the possible variables methodically.
    – Brad
    Commented Jan 6, 2023 at 23:05
  • 1
    possibly, but it might not even be needed. you need to approach this systematically. Step 1: make sure the hardware is consistently presented, Step 2: make sure the block device (/dev/sda) is okay and visible, Step 3: validate partitions (/dev/sda1, /dev/sda2) etc, Step 4: attempt to mount it in RO mode. If, at any point, one of these steps fails, you can then try dd or ddrescue to copy the raw data off the disk onto another disk, or your local machine - you would create an image file, e.g, ~/sda.img.
    – Brad
    Commented Jan 10, 2023 at 19:21
  • 1
    Then you can run additional tools on that .img file rather than on the (possibly faulty) drive to attempt to recover the data. Note that none of this is guaranteed to work.
    – Brad
    Commented Jan 10, 2023 at 19:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .