osx - Partition corruption, still can see files in single user mode, would like to retrieve files

08
2014-07
  • Sam

    The problem started after forcing the mac to shutdown. Since then, when trying to boot, it stays stuck at the grey apple with spinning wheel. I've tried a few generic things to be able to access my data on my internal drive without success. I first tried booting on the restore partition from mountain lion, but the same apple with spinning wheel issue happens, which makes me think that it's the partition that's corrupted and not the volume.

    I've tried booting the iMac in Target mode and do the following:

    1) I've tried using Disk Utility to repair the disk, but when trying to "Repair Disk" on the hardware item (not the volume one), the output gives:

    Verifying and repairing partition map for “AAPL FireWire Target Media”
    Checking prerequisites
    Problems were encountered during repair of the partition map
    Error: Some information was unavailable during an internal lookup
    

    2) Data Rescue and Disk Warrior hang when I open them and when the Target disk is connected, but don't when I disconnect it.

    What make me think that some data can be saved is the following

    3) Using single user mode, I can navigate through the different users’ folders, I can even open their text files. Doing the fsck -fy command outputs: The Volume Macintosh HD appears to be OK.

    Doing the /sbin/mount -uw / command, it outputs

    SATA WARNING: Enable auto-activate failed
    disk0s2: I/0 error.
    

    followed by a few lines of gibberish followed by:

    hfs: cat_delete() failed to delete thread record on volume Macintosh HD
    hfs: Runtime corruption detected on Macintosh HD, fsck will be forced on     next mount
    hfs_remove_orphans: failed to start transaction
    hfs: hfc_btree_open: hfs_getnewvnode error 2
    

    So I can’t mount the internal drive and I can’t seem to be able to mount an external drive to copy my files to it (since I can't create the destination folder for the device to mount to it). It seems that there’s no network connection in single user mode (unless I’m missing something), so I don’t believe I can send the data through networking and my laptop refuses to mount the Target disk.

    There are some important documents I would like to save and I was wondering if there was some way to access the files on the hard drive the same way single user mode does it?

    Thanks a lot for any answers!

  • Answers
  • Ken

    Try to treat the drive as a simple block device and use dd to copy the sectors to the external hard drive. This would bypass any logical errors with the partitions and volumes. The fact that you got an I/O error might indicate a physical problem in a critical area of the internal drive. Then attempt recovery from that external copy, perhaps onto another drive if you have one.

    It would be useful to know if dd fails at some point, especially early where critical structures might be. Unfortunately, getting output on it requires getting its process ID when it starts (e.g. by running it in the background) and then doing a

    kill -SIGINFO process-ID
    

    as needed. (That's SIGINFO and not USR1 which Linux uses.) To skip over trouble spots, include the option conv=noerror,sync. If the copy gets stuck, you can even try seeking on both the input and output to avoid those spots entirely, copying in chunks from the back to the front, etc.

    Note that dd is quite dangerous, so it might be safer to use something like GNU ddrescue (never tried it myself).

  • Sam

    Thanks for the answers, but I was able to simply mount an external drive into the /tmp folder. That way, I was able to copy all my files to it.


  • Related Question

    osx - Unable to Repair Disk using Mac OS X Disk Utility
  • Kristopher Johnson

    My wife has been complaining about her MacBook Air's performance. It seems to work fine, but when I ran Disk Utility and did a "Verify Disk", it reported filesystem errors. The "Repair Disk" button was disabled, because this is the startup drive.

    So, I restarted with the Mac OS X Install Disc and ran Disk Utility again. When I run "Repair Disk", I get this output:

    Verify and Repair volume "Macintosh HD"
    Checking Journaled HFS Plus volume.
    Checking Extents Overflow file.
    Checking Catalog file.
    Invalid node structure.
    Volume check Failed.
    Error: Filesystem verify or repair failed.
    

    Is there anything else I can do to try to repair the filesystem (besides erase and reinstall)?

    Update:

    FWIW, here's what happened after I asked this question:

    1. Restarted in single-user mode (Command-S on boot). "/sbin/fsck -yf" gave more error messages. And when I did "exit", I saw error message "disk0s2: I/O error" followed by "CPU Halted".
    2. Tried to reboot. Apple logo appeared, and wheel spun for about 15-20 seconds, then machine turned off. This repeated every time I tried to reboot with the internal disk.
    3. Tried resetting PRAM (Command-Option-PR on startup). No change.
    4. Called Apple. The expert walked me through SMC reset, which did nothing. Tried to do an "Archive and Install" re-installation, to save original disk contents, but the Installer refused to install on that drive due to filesystem corruption.
    5. Did an erase and re-install. (And my wife now hates me.)

    I'd still be interested to hear if there is anything more I should have done.


  • Related Answers
  • Chealion

    If you ever run into this problem again I highly recommend DiskWarrior - it's worth the price tag over and over. It's saved several systems for me from directory corruption.

  • Benjamin Schollnick

    I second the Disk Warrior answer... But it maybe simply that your hard drive is dying... Boot from the Installer disk -> Continue -> Tools -> Disk Utility. Highlight the hard drive (not the partition), and see if at the bottom of the disk utility window, does it say SMART FAILURE? Or is the disk highlighted in red?

    If so, then the disk is dying, replace the hard drive, and hope your backups are recent... (You do have backups/)...

  • cust0s

    This has happened to me, grab yourself a copy of SuperDuper.

  • Scott Davey

    Before buying DiskWarrier, you should know that the download version of the app cannot burn a bootable DVD. You have to wait for them to ship this out, and this can take weeks. DiskWarrier's website conveniently hides this information.

    If you have AppleCare you can download a program called TechTool Deluxe, which I hear does create boot disks, and also has a bunch of other disk utilities on it and may help.

  • Benjamin Dobson

    Boot from the installer CD. Disk Utility cannot repair the active startup disk. http://kb.wisc.edu/helpdesk/page.php?id=3810

  • Natalia G.

    You never check the disk you are booted from. Boot from another disk and then verify/repair.

    It is like doing open heart surgery while you're ...jogging.

  • user205698

    I am afraid disk warrior isn't a panacea! It CANNOT recover encrypted files, nor can it recover from SD cards despite the claims!