Recently I had a student whose MacBook Pro would't boot into the OS. Using an bootable OS X 10.9 USB I was able to open Disk Utility and see the 'Macintosh HD' partition greyed out. Clicking 'Mount' resulted in:
The disk “Macintosh HD” could not be mounted.
Try running First Aid on the disk and then retry mounting.
Running 'Repair Disk' failed with:
Disk Utility stopped repairing “Macintosh HD”
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.
Here are the steps to back up user data. First open Terminal under the Utilities menu.
To prevent the Mac from going to sleep type:
pmset sleep 0
Note: The display will still go to sleep, but the rest of the computer won't.
We need to find the disk identifier with:
Next we need to manually create a directory to mount our partition to:
Time to mount the partition as read only:
mount -t hfs -o rdonly /dev/disk0s2 /Volumes/Manual
Note: If you receive a 'mount_hfs: Resource busy' error your disk identifier for Macintosh HD is not disk0s2 or the more likely scenario is the Macintosh HD partition eventually mounted by itself. If Macintosh HD has mounted by itself the next command is replaced with: cd "/Volumes/Macintosh HD/Users/"
If the above mount command was successful you should be able to move into the Users directory:
List available home directories:
Time to copy those irreplaceable documents:
ditto -V USERNAME "/Volumes/EXTERNALDRIVE/USERNAME"
Note: Ditto copies each file individually. It is important that the drive you are copying data to has enough free space, otherwise ditto will give the error “No space left on device” skipping that particular file and going onto the next. The external drive should also be formatted in Disk Utility as 'Mac OS Extended (Journaled).'
Once the copy is complete Terminal will display '-bash-3.2#'.
Now that you have a back up, shutdown and remove the external drive. Connect the external drive to another computer and verify you have a copy of everything important.
At this point you could reformat and reinstall OS X onto the same drive. However, if you believe the disk is faulty and your MacBook is no longer under warranty I recommend having a look at the hard drive replacement guides on iFixIt.com.