====== fsck (Mac)======
|(hold) command-s|start up in single user mode|
|df |display disk free space, along with disk names (most useful when you are not in single user mode, so you can see the full drive list) |
|/sbin/fsck -fy |run a filesystem consistency check and interactive repair, assuming yes to all questions (the -f means check a disk even if it is clean)|
|/sbin/fsck -fn |run a filesystem consistency check and interactive repair, assuming no to all questions, and do not open the disk for writing|
|reboot |reboot system from the terminal|
|exit |startup without rebooting|
|diskutil verifyVolume /|Verify the disk structure of a volume. Ownership of the affected disk is required.|
===== BAD SUPERBLOCK / MAGIC NUMBER WRONG =====
If you are trying to run fsck on a disk other than the main boot disk, you may see this error:
BAD SUPER BLOCK: MAGIC NUMBER WRONG
...so run this instead:
/sbin/fsck_hfs -fy /dev/rdisk0s3
Other Operating System references talk about using newfs -N /dev/diskname to get a list of super-block backups, any of which can be used with the -b flag of fsck to make things work. This is not the case with Mac / HFS, so use fsck_hfs instead.
===== External Links =====
* [[http://docs.info.apple.com/article.html?artnum=106214|Resolve startup issues and perform disk maintenance with Disk Utility and fsck]]
* [[http://www.osxfaq.com/Tutorials/fsck/index.ws|How To Run fsck To Examine A Non-boot Volume In Mac OS X]]