30

I have an external hard-disk with a single Mac OS Extended partition. This disk stopped working couple of days ago. I tried to repair the partition with disk utility but no luck. The error message is the following:

Error: Disk Utility can’t repair this disk. Back up as many of your files as possible, reformat the disk, and restore your backed-up files.

Any ideas or tools I can try to repair my disk?

1
  • Can you be sure the drive is working properly? You should check several things if you haven't already: Is your CRC error count at 0? Is your Pending/Removed/Reallocated Bad Sectors at 0? Have you run random read/write block tests on the drive? Look into a shareware program called SMART Utility if you haven't run any of these checks already. I highly recommend it for basic drive health checks.
    – Fyrefly
    Commented Jul 3, 2014 at 16:30

15 Answers 15

19

There is a chance to repair it with command line (in Terminal) with the terminal utility as described in Apple's support docs, shown below:

Use the command line and the fsck_hfs -l command.

Start up your computer and log in as an administrator.

Open Terminal (/Applications/Utilities).

At the prompt, type the following command and then press Return to determine your filesytem ID:

df -hl

Look for some lines of text that look like this:

Filesystem Size Used Avail Capacity Mounted on
/dev/disk0s3 37G 20G 17G 55% /
/dev/disk0s5 37G 37G 641M 98% /Volumes/Storage

Make a note of the External Disk "disk" name that appears after /dev/, such as "/dev/disk0s3." This is your filesystem ID for your External volume.

At the prompt, type the following command and then press Return:

df -hl

Then type the following command, where "disk1" is your filesystem ID you noted in step 4, then press Return:

sudo fsck_hfs -l /dev/disk1

When prompted, enter your admin password, then press Return to begin the verification.

You should see messages like these during the disk check:

** /dev/rdisk0s3 (NO WRITE)
** Root file system
** Checking HFS Plus volume.
** Checking Extents Overflow file.
** Checking Catalog file.
** Checking multi-linked files.
** Checking Catalog hierarchy.
** Checking Extended Attributes file.
** Checking volume bitmap.
** Checking volume information.
** The volume Macintosh HD appears to be OK.
11
  • @ Buscar - this is the better answer... but fsck is what Disk Utility is actually failing to do. It is likely more effective to apply fsck manually, but I thought maybe you'd be interested in that fact. Nice answer, rock on.
    – chillin
    Commented May 10, 2014 at 17:48
  • 3
    @Buscar My partition is not monted and I am unable to do so. Therefore the df -hl is nt reporting it. Is there any way to apply the fsck_hfs command?
    – gyurisc
    Commented May 12, 2014 at 4:08
  • @gyurisc you do not have to run the df -hl, it is only used to show you your disk partition status.
    – Ruskes
    Commented Feb 2, 2015 at 23:10
  • 3
    I don't get it. What does the second invocation of df -hl accomplish? Commented Apr 18, 2015 at 3:23
  • 2
    @gyurisc If your disk doesn't mount, use diskutil list to get the id of your external disk: apple.stackexchange.com/questions/107953/…
    – pcv
    Commented Sep 21, 2015 at 0:06
10

When you plugin a damaged Apple_HFS disk into Mavericks/Yosemite it runs fsck_hfs on its own.

You can see the output (in Terminal):

tail -f /var/log/fsck_hfs.log

Wait for it to finish before running repair yourself.

Also repair needs to be run repeatedly to repair some errors. I recently needed to launch it 7 times but it repaired the disk successfully in the end. You can use either fsck_hfs or Disk Utility.

2
  • 5
    clicking repair repeatedly has helped me more than once
    – jensph
    Commented Jun 19, 2015 at 1:48
  • specially if keeps throwing differents results..
    – H_7
    Commented Feb 3, 2016 at 2:50
5

I had luck with fsck on the command line using slightly different options from above.

Used df -hl to determine the path of the disk device as above (in my case my first external USB drive, /dev/disk1s1)

Then use

sudo fsck_hfs -r -d /dev/disk1s1

The -r option rebuilds the Catalog B-Tree. Not sure why disk utility doesn't do this automatically. The -d option shows extra debugging information. See Repair disk from single user mode (fsck fails) and the fsck_hfs man page for details.

Before you rebuild the Catalog B-Tree, be sure to run a standard fsck first, as rebuilding the Catalog B-Tree on a corrupted filesystem can lead to further data loss or filesystem corruption.

You can also use sudo fsck_hfs -Race -d /dev/diskid instead of sudo fsck_hfs -r -d /dev/diskid to rebuild the attribute and overflow tree as well.

2
  • 3
    After running your command all the data on my hard drive got erased, so THANK YOU!!
    – Wazery
    Commented Mar 26, 2016 at 5:31
  • @Wazery Try using a data recovery software like Disk Drill. Although the filesystem is corrupted, the file data is likely still intact, so most of them can be repieced together and restored.
    – Joy Jin
    Commented Aug 6, 2021 at 12:00
4

You may not need to repair the disk!

Is this an external drive you're sharing between a Mac and a Windows PC? I've had this issue a few times with a disk formatted FAT32. If you don't unmount your disk properly when you remove it from your Windows PC, the whole volume will be marked as "busy" and you'll be prompted to repair the volume if you look at it in Apple's Disk Utility. However Disk Utility will fail to repair the volume, and report:
Can't open (Resource busy)
File system check exit code is 8.

The fix is easy, just plug that drive back in to a Windows PC, and unmount it properly before plugging it into your Mac.

It's not uncommon for a USB drive to be disconnected by just yanking out the cable, and usually that doesn't cause any trouble, and integrity is verified when you plug it back in. Ideally Macs would recognize this common issue and work around it, but it appears they only trust Microsoft to validate that the filesystem is OK.

1
  • 1
    saved me from a lot of trouble with this comment... sometimes its not that the disk is corrupted..
    – mamonu
    Commented Mar 4, 2017 at 16:33
3

One thing to try that is perhaps extreme is to place the drive in a few layers of freezer bags and cool it in the freezer, and then try to get it to mount, and copy off what data you can until it fails again, and then repeat this process. Its absurd, but it has worked for me and there is a lot of anacdotal evidence that this can help recover data, regardless of the myth-dispelling posts that started to appear on the internet once the idea was picked up by major tech news outlets.

2
  • 21
    Appropriate username :P
    – NReilingh
    Commented May 11, 2014 at 0:17
  • 2
    +1 for the username. the drive works, it is just the partition is not mountable
    – gyurisc
    Commented May 12, 2014 at 4:05
2

I had this issue with an external disk in ExFAT, nothing worked. I was just about to use recovery software but boot into Windows, Windows read it fine. Booted back into OS X and now everything is as it should be. Weird.

1

Honestly, Apple is rather conservative when it comes to reporting errors. Sometimes (some people would say) to a fault. So when they do indicate an issue like this. It MIGHT be fixable with a third party program but honestly the first thing you should do is Backup Your Data. As it is likely that even if the drive is not toast there is a distinct likelihood of data loss.

On rare occasions booting from external media or the recovery partition (COMMAND-R) and running Disk Utility from that, could repair it. Worth a try as it only costs you a little time.

Personally I use DiskWarrior and have recovered drives that Disk Utility can't touch, including that exact error message. No guarantee it will do the trick but it's cheaper than a new HD.

If you own no other commercial software, that is the one you want. And keep it updated and on bootable media that works on all your currently owned Macs. I do.

1
  • I backed up the most important folders fortunately with crashplan. The annoying thing is that not all folders are backed up and that it happened the second time now. Thanks for the suggestion, I will give it a try.
    – gyurisc
    Commented May 12, 2014 at 4:04
1

I had a similar problem with my external Toshiba HD- my macbook wouldn't recognize the HD until after unplugging it and then prompted for a password (which hasn't been applicable for months). I tried all possibilities of a previous password, received the same error message in disk utility when trying to repair the HD, and finally was able to correct this error by utilizing the free OS upgrade to Yosemite. Hope it helps!!

1
  • i am still fighting with this from time to time
    – gyurisc
    Commented Oct 23, 2014 at 6:44
1

You first need to determine whether the problem is with the disk hardware or the filesystem. To learn whether the hardware is failing, you can use a utility that will evaluate the SMART data. Apple's Disk Utility does a limited form of this, but it's not nearly as reliable as a dedicated tool. I use SMART Utility -- the free trial will provide all the info you need for a one-time diagnosis.

If the hardware is bad, you should not try to repair the filesystem. You are in a data recovery situation.

If the drive is OK according to SMART Utility, you should try repairing the filesystem with Alsoft DiskWarrior. DiskWarrior is developed by a team with intimate knowledge of the HFS filesystem, and it's able to fix problems that Disk Utility cannot.

1

I've had good experience fixing volumes (even when disk utility says it can't fix it) using Diskwarrior for HFS/HFS+ and/or TechTool Pro for HFS/HFS+/APFS.

Both of them are paid, there might be freeware alternatives but I don't have personal experience with any.

2
  • 1
    Note 2021: Neither of them are shareware any more, but well worth the money. [DiskWarrior can't handle APFS yet, but is still the best on HFS+]
    – Tetsujin
    Commented Aug 6, 2021 at 13:06
  • I had lots of disk repair tools telling me my HDD is gone but Diskwarrior got me back some b-tree corruption ... Still get some message about smart error but it's been over 2 yrs still all fine
    – becker
    Commented Mar 12 at 14:56
0

For me, Disk Utility on Snow Leopard works at repairing permissions for drives but not on Mavericks. Strange.

0

If Disk Utility can't repair the volume, it means that its directory structure is damaged to point where it can't find all catalogued files any more.

While you can now try copying all files to another disk, this may result in lots of errors, and you may also not get all files that are still theoretically recoverable.

Therefore, I recommend that you use the product Data Rescue for this recovery job. It scans the entire disk (takes a while), searching for "lost fragments" of the catalog, trying its best to recover as much as possible.

With a disk that's marked unrepairable, you should not try to keep writing to it (in fact, it should be made read-only, which is, sadly not as simple any more as it used to be long ago), because any further writes may overwrite valid data, due to the damaged catalog.

So, get a large enough second disk and start rescuing. Do not attempt to fix this volume unless you do not care for more losses.

0

Short Story: Use DiskWarrior

My computer crashed and damaged directory files on my external hard drive. So it wouldn't mount but I could see it in Disk Utility (altho it wouldn't repair). Paid the $120 for the diskwarrior, went thru everything and it was fine. Gives you a preview to grab files too before they go in and fix the bug. Worth the money.

0

Read somewhere about trying to click Repair several times until it worked. It took a while until it took it and I was able to recover the disk , backed it up and format it.

0

Problem with Catalina and NTFS

If you are experiencing this issue with your NTFS disk after upgrading your OS to Catalina, install the Paragon Driver https://www.seagate.com/support/software/paragon/.

I found the answer from a Reddit thread.

You must log in to answer this question.

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