1

My primary HDD on my main PC seems to have failed. After a power outage a few days ago, when turning on the PC, I get two beeps from my BIOS and a message saying that a S.M.A.R.T. error on the drive is found. I am unabel to boot into Windows any more.

I have tried plugging in (via a USB adapter) to my Ubuntu machine, but it fails to mount this drive with various errors. (It did let me connect another, working internal HDD so I know it's not an issue with the USB adapter)

I have tried plugging it into other Windows 10 machines, too. When this happens, Disk Management does recognize the disk, but it shows up as empty and uninitialized. If I try to right click and Initialize, I'm asked to choose either MBR or GPT. My first issue is that I don't know what it was before, so I don't know what to choose. If I try MBR, I get a message saying that the device is not ready. If I choose GPT, I get a message saying that there is not enough space for GPT.

I have also tried tools like TestDisk, Recuva, EaseUS Partition Master, DiskPart. All tools fail to recognize the hard disk at all, since it is not mounted and doesn't have a drive letter. Even Diskpart didn't list it as a disk/volume/partition anywhere.


Am I out of options? I can't get Linux or Windows to recognize this drive in the slightest, other than that something is getting plugged in through USB.

I've seen tutorials for setting up a Windows 10 recovery disk/USB and using that to repair the drive, but I'm skeptical that it will work for the same reasons that the aforementioned tools didn't - the drive isn't really even getting recognized.

1
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – DavidPostill
    Dec 15, 2017 at 18:49

2 Answers 2

3

Reading anything from the drive

In Ubuntu (Linux) you couldn't mount the drive, but it sounds like you gave up too easily, there's a world of difference between "filesystem inconsistencies / wasn't cleanly unmounted" that won't let an automatic mount, and "not recognized as a device, can't read a single sector" that you can read data & work with. Mounting can fail if windows is in "fast shutdown" mode, or there's filesystem errors, so it's definitely not a show stopper that it couldn't mount.

If a new /dev/sdX appears then you can read (or at least attempt to read) the drive, and read SMART info & attempt tests. Since it's a USB drive, after connecting it a new device /dev/sdX (X could be any letter) should show up, see dmesg & /var/log/syslog for info (especially errors if there's no new device - without a device it might not be possible to read anything, or even harder to try).

If you can read anything from the /dev/sdd device then it's looking much better that ddrescue (in package named gddrescue) or testdisk / photorec or something can get some data. Probably need root rights too, with sudo. Like sudo testdisk /dev/sdd or sudo photorec /dev/sdd.

  • A very basic "read a little" with dd would be:

    sudo dd if=/dev/sdd of=output-file bs=1M count=1  
    

    reading the first M (=1024*1024 bytes) from the drive, and

    • bs= is how many bytes to read/write in each "block"
    • count= is the number of "blocks" to take
    • skip=N skip N ibs-sized blocks at start of input
    • Just don't mix up the of=, it will overwrite almost anything!
  • To skip 1000M's and then read 1M, use:

    sudo dd if=/dev/sdd of=output-file bs=1M skip=1000 count=1 
    

Data Recovery

See https://wiki.archlinux.org/index.php/file_recovery and/or https://help.ubuntu.com/community/DataRecovery for more info, it can be involved. gddrescue has a great (but dry) GNU ddrescue Manual too, and search the web for lots more info.

testdisk & photorec are the easiest to use IMO, I don't even bother with foremost or scalpel. Their homepages have good guides, see TestDisk's & TestDisk Step By Step and PhotoRec's & PhotoRec Step By Step. If testdisk can read the existing files, then copying them might be fairly easy, photorec doesn't save original filenames or directory structure.

Sometimes errors will show up when attempting reads & they might fail, error messages will probably flood dmesg & /var/log/syslog then, I like to keep a terminal open running dmesg -w &/or tail -f /var/log/syslog to see new errors as they arrive. If you've got the space on another device, making a whole copy with gddrescue might be a good idea, it tries to skip over error sectors and read all the "good stuff" first, then try errors again later (or read "backwards", jump around, etc).


SMART & smartctl

You could use smartctl (in the smartmontools package) to read the SMART data & find out what it's errors are, even run new tests (but if the drive is failing, more tests could run down the clock on it's remaining life, so a backup first might be prudent). Here's my "notes" on smartctl:

Commands to generate reports:

  • sudo smartctl --all /dev/sdX - prints all SMART info
  • sudo smartctl --xall /dev/sdX - prints all SMART and non-SMART info

If you're tracking changes, you could run a test every so often, saving it to a date-named file with:

sudo smartctl --xall /dev/sdX > $(date +"%Y-%m-%d_%H.%M")-sdX-smart-xall

To just get the "stats":

sudo smartctl -A /dev/sdX > $(date +"%Y-%m-%d_%H.%M")-sdX-smart-A

Tests

Use the option -t TYPE where TYPE is one of:

short maybe ~2min
conveyance maybe ~5m
long maybe ~55m
offline maybe ~73m (4380s)
[times are examples from an old drive]

But not all drives support all tests.

The -c option has a "Self-test execution status:" line that tells the current test's % remaining (if a test is running).

To see status could use:

sudo smartctl -c /dev/sda | grep "^Self" -A1
2
  • This is an incrediblly detailed answer. Thank you. smartctl tells me No device connected when I try anythign with the drive, and dmesg has errors like: [sdd] Test WP failed, assume Write Enabled, [sdd] Asking for cache data failed, and [sdd] Assuming drive cache: write through. I'm googling around now to see if there's anything else I can do, but so far it doesn't look to good.
    – neilsimp1
    Dec 15, 2017 at 14:40
  • No problem :) That's not too encouraging a message, but at least it's getting a sdd device & trying. I've always connected drives directly to SATA cables when checking SMART, it's possible the USB is interfering, a direct connection may be worth a try if nothing else works. Or running Linux from a USB/DVD on the main computer (if the Ubuntu one doesn't have SATA ports)
    – Xen2050
    Dec 15, 2017 at 14:54
2

There are services available that will recover a hard drive for you, but they are usually expensive, so you will need to consider the worth of your data before you consider this option. Google "data recovery services".

Some local computer techs can do recovery of dead HDs, and sometimes they offer the same type of forensic recovery that the expensive places offer (but at a lower quality or lower chance it'll be successful).

I've known techs to use circuits off similar HDs to bring up a HD. There's less of a chance of it working these days, since the board is often calibrated to the motor.

You must log in to answer this question.

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