docs:mac:fsck

fsck (Mac)

(hold) command-sstart 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.

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.

  • docs/mac/fsck.txt
  • Last modified: 2008/08/03 00:25
  • by 127.0.0.1