HDD on the Verge of Dying? How to Diagnose and Fix

hard drivekernel-panicmacosreboot

So, I've found myself in a quite tight spot regarding my internal HDD.

I've got a 13" Late 2011 MBP, running macOS 10.12.1, which is behaving very strangely lately: Mail will refuse to open, with an error message complaining about network and home folder problems; Finder won't let me create new directories (they appear and then instantly vanish – they weren't created at all, according to my Dropbox log); and Disk Utility gives inconsistent results: sometimes it will say everything's fine, while other times it indicates disk corruption.

Stranger still, is that no external storage appears on my Desktop. They do show in System Information under the respective USB controller, but no signs of life either from Finder or Disk Utility.

I've tried rebooting the system to see if things would come back to normal; instead, I was greeted to a Kernel Panic at startup, complete with white text under a black background. After trying to use the recovery partition to run Disk Utility again, a second attempt would result in a "block sign" being displayed if I tried accessing said partition, and Internet Recovery's Disk Utility just hang up after an hour checking the Catalog File.

I was only able to boot back into macOS by trying to boot into verbose mode (Cmd+Shift+V), and for some reason the system came back to life. It still has the exact same problems as before, with the addition that, after choosing to send Apple a Crash Report, the "ReportCrash" process is now taking an entire processing core for about an hour, with no signs of high disk activity.

This is quite frustrating, given that it's been about 6 months I've replaced its original 750GB HDD for a 1TB Toshiba hybrid drive (1TB disk; 8GB flash), and things were working very smoothly until then.

Before I reboot my Mac again, I'd like to know if anyone has ever encountered a similar isse, and what can be done to minimize the damage. I have a 30-day-old Time Machine backup, and can read the drive using a secondary Linux machine in order to not lose more data, but as-is, what is the best course of action?

EDIT: After following @Allan's suggestion and running the Apple Hardware Test (online version) on extended mode, the HDD is indeed reported. The output is as follows:

Test Results
________________________________________

Alert! Apple Hardware Test has detected an error.

4HDD/11/40000004: SATA(0,0)


Pass Number: 1,
Total Time Testing: 44 mins 53 secs

Guess I'll try to image the HDD this night under Linux, using ddrescue, and restore to the older 750GB HDD; I'll follow up with more progress later. Thanks to @jksoegaard and @Allan for the moment!

EDIT 2: On trying ddrescue the drive oddly reported no read errors, even though almost every time I run it through fsck.hfsplus the reported results are different. I've also decided to check its S.M.A.R.T. data; to my surprise, it reports no reallocated sectors, but an alarmingly high rate of UDMA CRC Errors (11752, out of a 253 worst-recommended value).

I've decided to try to save as most as I could from my home directory using the Linux machine (fortunately only a couple uninportant files seemed corrupt, even though macOS refused to read the disk through an external SATA<->USB converter), and put back the original 750GB HDD on the MacBook, which is being currently restored from the aforementioned Time Machine Backup.

Next step is to return the HDD under warranty and try to claim a new one, I suppose. Thanks so much to everybody for the help!

Best Answer

The best course of action is to use the secondary Linux machine to read the drive and make a bit-for-bit copy as soon as possible. Use a program such as ddrescue to ensure you get as possible out.

After you've made the copy, do any recovery attempts of file contents on the image you've created with ddrescue.

Your hybrid drive is most probably failing and failing fast. Hybrid drives have a lot more failure modes than a regular hard drive or SSD drive, so that's why you can experience very odd things happening - without for example it being the same sectors that are "bad" all the time.

You'll need to replace the drive. As it is only 6 months, perhaps you can get it replaced under warranty from the drive manufacturer or seller.