Miniguide to fixing Volume-Filesystem errors
Apr 29, '11 07:30:00AM
Contributed by: santa97298
There are many drive/filesystem errors that can occur on a Mac. Here are some common symptoms that are indicative of some of them:
Not able to boot the system: You tried to boot. Apple logo appeared, and wheel spun for about 15-20 seconds, then machine turned off. This repeated every time you tried to boot the system. (REASON: The system does not find your HD and thus the OS to boot).
Everything seems to work fine till your system hangs briefly and in an unpredictable way. You wait for a while, and the system magically comes back to normal. But after another while, the same thing re-occurs! (This cycle repeats in the current session).
You can do these simple things to check for other possible causes:
- Run Activity Monitor to see that this is NOT due to temporarily high CPU and/or Memory usage.
- Check the system log using Console.app or running tail -f /var/log/system.log in Terminal. If your system is having some I/O error then it is sure that there is an HD failure issue.
I don't claim to be an expert on this subject matter, just an (over)enthusiast Mac user. This guide is purely based on my personal experience and is bound to contain errors. So, USE IT AT YOUR OWN RISK! [crarko adds: Consider this hint to also serve as a reminder to check your backups...]
Possible problems:
- Your HD Volume/FileSystem is corrupted
Verification: Use Disk Utility and run "verify" to check it.
- 2. Your HD is dying.
Verification: Use Disk Utility and see the SMART status of your HD, although this isn't always reliable.
Before making any repair of the disk, make sure that you have the latest backups. Repair might let loose the volume/filesystem info all together and then there will be no other choice than to recover the data by some data rescue s/w like Data Rescue!
If you don't have a current backup, you can try booting in Single-User mode by holding Command+S on startup. Then try doing a manual backup using commandline tools like cp or ditto.
Note: The disk usually gets mounted in read-only. This could be good to get a manual backup by cp. But if everything else fails and you want to remove the important/personal data before sending it to repair, you can try mounting it in the write mode by this:
mount -uw /
It might be good to commit the write by running the sync command.
There are other modes to try backups if single-user mode is not available.
- Command+V (Verbose mode): Probably will point you towards the error due to which you are not able to go into Single User mode.
- Shift-key (Safe mode)
- T (Target Disk mode): you whole drive can be seen by another Mac/PC as a HD. This works with FireWire. [crarko adds: And now Thunderbolt as well.]
Clone the disk first if you don't have the backup of data (I use Data Rescue). Not being able to mount the drive, I could not copy my files before trying the fix by any traditional means. What I did do was load Data Rescue from CD and used the clone function to clone the broken HD to a FireWire external - for some reason it could see the drive and execute the clone. I then tried the fix on the clone first.
How to verify/repair the disk:
Using Disk Utility to verify or repair disks
You can repair only from another disk (not the startup disk) so get the (correct) Mac OS X Install DVD to boot or press Command+S (single-user mode) while booting.
Disk Utility can verify your computer's startup disk (volume) without starting up from another volume. Here are Apple's instructions. This feature is called 'Live Verification.' If Disk Utility discovers any issues that require a repair, you will need to start up from your Mac OS X Install DVD and use Disk Utility on that disc to make repairs. (You can't repair your startup volume while your computer is started from it.) The repair can be done by fsck or Disk Utility, however, the later is recommended by Apple if you're using Mac OS X 10.4 or later.
Very important: If you are repairing, then REPEAT the Repair process more than once, to make sure it fixed everything.
The thing which can tell if it works is if you are getting a different output of the Repair in successive runs. So log the successive runs and if the error reported is changing in successive runs, it is likely that REPAIR is fixing some problems in each run and it could be possible that using REPAIR repeatedly could solve your problem.
To repair using fsck Restart in Single User mode (Command+S on boot) OR boot with the Install disc.
At the command line, type:
/sbin/fsck -fy
If fsck found issues and has altered, repaired, or fixed anything, it will display this message:
***** FILE SYSTEM WAS MODIFIED *****
Important: If this message appears, repeat the fsck command you typed until fsck tells you that your volume appears to be OK (first-pass repairs may uncover additional issues, so this is a normal thing to do).
About the -y flag: Tells fsck that you want to answer 'yes' to all questions about fixing, repairing, or salvaging information. This is the optimal approach, as answering 'no' to any question causes fsck to stop. You cannot determine that all necessary repairs have been made until fsck completes and gives its final report.
The -f flag forces fsck to check 'clean' filesystems when preening.
Follow this hint's advice if the above two fail OR/and you are having 'invalid sibling links' error reported by 'verify disk.'
Notes:
Try many times. in above post, people have even used run the above a dozen times to solve the problem!
If Verify/Repair disk fails:
DiskWarrior (might need the BOOTABLE version if you are not able to BOOT your OS) is often recommended as the best tool in fixing drive errors (volume, fs etc.).
DiskWarrior isn't, strictly speaking, a data recovery tool, but it's 'scavenge' mode does an excellent job of retrieving data from a file system even if it can't be entirely repaired. A good data recovery tool is Data Rescue.
Hardware level verification (even if your volume gets fixed by above):
Check the SMART status of your disk (by using Disk Utility or see below). Boot from the Installer disk » Continue » Tools » Disk Utility. Highlight the hard drive (not just 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.
Even if your Disk Volume error is fixed, it is imperative to do the HW test. Newer Macs include the Apple Hardware Test which can be obtained by pressing 'D' while booting.
If AHT fails, there is certainly some problem with HD, but if HW test doesnt fail this doesn't mean there is no error. The bottom-line is that you can never be entirely sure about your H/W functionality, so use redundancy (like backups).
The endgame:
If you need to replace your HD manually, and are out of warranty, try finding a video guide on YouTube for your model. For example, here is one for MacBooks.
Concluding useful info:
Summary of boot options:
- Single user mode: Command+s
- Verbose mode: Command+V
- Safe Mode: Shift-key while booting (see full info here).
- Booting from CD or other boot devices: Use the Option key while starting to see all the boot options
Dealing with the mounting blues:
To know which device was just inserted, at the command line type:
ls -l /dev/disk*
The most recent device (see the timestamps) will be the device just inserted.
To mount an external HD having the FAT32 filesystem (if this is all you have to backup with in an emergency), type:
mount -tmsdos /dev/disk3s1 /Volume/mydisk
You can also enable HFS+ support in most versions of Linux, to use for backup/recovery. Search for the appropriate commands/driver for your distribution.
[crarko adds: OK, this is a long guide, many parts of which may be found in previous hints. It seemed like a good summary of many of them. If you spot any errors, or have handy additions to make, please post them in the Comments.]
Comments (6)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20110216112523818