3

There is an I/O error in the hard disk in my MacBook Pro running Mountain Lion and as I start it up, a progress bar fills up and then it shuts down on its own. I attempted to recover the files in single-user mode and try to fix it by rebuilding the catalog btree as in this answer:

fsck_hfs -Rc -d /dev/disk0s2

Unfortunately it encountered numerous errors as it approached the part with a disk error. Since then the Macintosh HD does not mount in single-user mode and I am only left with the Mac OS X Base System.

Running df -hl on the 500GB drive gives the following:

Filesystem    Size   Used  Avail Capacity iused ifree %iused  Mounted on
root_device  1.2Gi  1.1Gi  106Mi    92%  280978 27978   91%   /

of which 1.2GB represents the Mac OS X Base System.

fsck_hfs -l /dev/disk0s2 gives:

** Checking catalog file.
   Missing thread record (id = 18)
   File record has hard link chain flag (id = 38468309)
   File has incorrect number of links (id = 38468309)
   (It should be 1 instead of 2)
   ...
   Missing thread record (id = 216712)
   ...
   Incorrect number of thread records
(4, 202)
   Incorrect number of thread records
(4, 202)
** Checking multi-linked files.
   Incorrect number of file hard links
** Checking catalog hierarchy.
** The volume   could not be verified completely.

And /sbin/fsck/ -fy gives:

** The volume Mac OS X Base System appears to be OK.

I tried to manually mount the drive with

mount -t hfs /dev/disk0s2 "/Volumes/Macintosh HD"

but it didn't work:

hfs_mounts: failed to mount non-root inconsistent disk
hfs_mount: hfs_mountfs returned 22
mount_hfs: Invalid argument

How do I correctly rebuild the catalog btree and remount disk0s2 (which is the Macintosh HD)?

  • Some might be in /lost+found – mmmmmm May 15 '13 at 16:08
  • @Mark Where do I find this? cd: /lost+found: No such file or directory – AppleBoy May 15 '13 at 16:11
  • If fsck does find things iy puts them in that dir. If the directory is not there nothing was found – mmmmmm May 15 '13 at 16:15
  • AppleBoy, what have you done this time :( – Ruskes May 15 '13 at 18:35
  • @Buscar웃 I checked again carefully and discovered that I didn't just lose /Users, the whole Macintosh HD was gone. Attempting to mount manually would give errors like failed to mount non-root inconsistent disk and hfs_mountfs returned 22. – AppleBoy May 15 '13 at 18:42
  • It is still talking to you, that is good sign. Do you think there is a chance to boot from USB and work from there. – Ruskes May 15 '13 at 19:11
  • @Buscar웃 I can try, but I doubt if that would work. I couldn't mount the drive in Disk Utility, so I guess this drive is not readable in its current form. – AppleBoy May 15 '13 at 19:18
  • Since you say it works in basic form ..Maybe it is just something banal as... try the repair permissions sudo diskutil repairPermissions / – Ruskes May 15 '13 at 19:21
  • @Buscar웃 I can't run diskutil in single-user mode. – AppleBoy May 15 '13 at 19:24
  • I did not see you trying to reset the PRAM command+option+P+R or sudo nvram boot-args=”-p -r” – Ruskes May 15 '13 at 19:31
  • @Buscar웃 The drive was accessible in single-user mode before. After I tried to rebuild the btree, the drive is gone. I should have tried resetting PRAM beforehand, but now the problem is more serious than that. – AppleBoy May 15 '13 at 19:37
  • Hang on, I lost you, where are you now! In single user mode! if yes try this instructions to mount the drive. http://www.insanelymac.com/forum/topic/232365-guide-how-to-mount-drives-in-os-x-single-user-mode-using-the-command-line/ – Ruskes May 15 '13 at 19:59
  • @Buscar웃 I tried the exact same thing before, and it gave the errors I have mentioned previously: failed to mount non-root inconsistent disk, hfs_mountfs returned 22 and invalid argument. I also tried diskutil repairPermissions disk0s2 in recovery mode. It gives Error starting permissions repair for disk0s2: Couldn't mount disk (-69842) – AppleBoy May 15 '13 at 20:02
  • OK, I should have read your OP bit more carefully. I would suggest you disable the Journaling with /System/Library/Filesystems/hfs.fs/hfs.util -N /dev/partitionName than do the /sbin/fsck_hfs -yprd /dev/partitionName and it should mount your disk. Now do the Disk Utility, selected your partition, and then clicked "Enable Journaling" to get that back up and running again. – Ruskes May 15 '13 at 20:14
  • @Buscar웃 You mean this one? I am actually afraid of running more fsck_hfs commands unless I am completely sure what it does. The manual says it would only perform a repair when it can and would exit on error. Apparently it just wiped out my whole drive without a warning. – AppleBoy May 15 '13 at 20:23
  • Yes that one :) but the decision is yours! I do not know how to help you further without bringing my system in to your state :) – Ruskes May 15 '13 at 20:40
  • It's very expensive but Disk Warrior has a good track record of rebuilding HFS+ structures that diskutil can't – MikelR May 16 '13 at 04:03
  • @Buscar웃 the r in /sbin/fsck_hfs -yprd /dev/partitionName is equivalent to Rc in the original command I issued. It is this catalog btree rebuilding that caused serious failure in my hard drive. – AppleBoy May 16 '13 at 04:29
  • @MikelR If everything fails, this will be my last resort, before sending the drive to some data recovery service. – AppleBoy May 16 '13 at 04:31
  • I see, I did not know that. You can try pinging @Patrix who posted the original and ask him what is it all about. – Ruskes May 16 '13 at 07:38
  • @Buscar웃 I need 50 rep to do that. – AppleBoy May 16 '13 at 07:57
  • I just did it for you with @patrix for HELP :), but you can post few good answers and in no time you have the points. – Ruskes May 16 '13 at 08:15
  • Let's move this discussion to [chat].. Also, we have many questions about general advice on seeking data recovery (see the related questions side of this page) so it's hard to see how this is anything but a guess of "yes - you've lost all chance of recovery and here's why I believe that" and "no - you can always try again to recover the data or bring better tools and training to the problem". Feel free to edit the call to action to make it more clear what problem you face other than looking for troubleshooting assistance. – bmike May 16 '13 at 11:48
  • @bmike I have edited the question. This is not about general advice but about a specific command patrix suggested in an earlier answer that resulted in an unmountable drive. It would also be helpful if he can explain the command and the effect it has on the main volume. – AppleBoy May 16 '13 at 14:02

0 Answers0