FSCK_HFS(8)

๐ŸŒธ FSCK_HFS(8) โ€” aka fsck.hfsplus ๐ŸŒธ

okay so bestie, welcome to the manual page for fsck.hfsplus โ€” your friendly neighborhood HFS file system consistency check ๐Ÿ’– she verifies and repairs standard HFS and HFS+ file systems, and honestly? she's iconic for it โœจ


โœจ SYNOPSIS โœจ

fsck.hfsplus -q [-df] special ...
fsck.hfsplus -p [-df] special ...
fsck.hfsplus [-n | -y | -r] [-dfgxlE] [-D flags] [-b size] [-B path]
             [-m mode] [-c size] [-R flags] special ...

๐Ÿ’… DESCRIPTION ๐Ÿ’…

so fsck.hfsplus verifies and repairs standard HFS and HFS+ file systems. that's the whole vibe. ๐Ÿซถ

there are three forms, and lowkey they're like three different moods:

first form โ€” she quickly checks the file systems you gave her to figure out whether they were cleanly unmounted. speed check, no cap. โšก

second form โ€” she preens the specified file systems. this one is normally started by fsck(8) run from /etc/rc.boot during automatic reboot, when a HFS file system is detected. when preening file systems, fsck.hfsplus will fix common inconsistencies for file systems that were not unmounted cleanly. but if more serious problems are found, she does not try to fix them โ€” she indicates that she was not successful, and exits. boundaries, bestie. ๐Ÿ™ˆ

third form โ€” she checks the specified file systems and tries to repair all detected inconsistencies. full send. ๐Ÿ”ฅ

if no options are specified, fsck.hfsplus will always check and attempt to fix the specified file systems. periodt.


๐ŸŽ€ OPTIONS ๐ŸŽ€

the options are as follows, and yes we're going through every single one ๐Ÿ‘‘

  • -c size โ€” specify the size of the cache used by fsck.hfsplus internally. bigger size can result in better performance, but heads up ๐Ÿ‘€ it can result in deadlock when used with the -l option. size can be specified as a decimal, octal, or hexadecimal number. if the number ends with a `k', `m', or `g', the number is multiplied by 1024 (1K), 1048576 (1M), or 1073741824 (1G), respectively. math slay ๐Ÿงฎ
  • -d โ€” display debugging information. this option may provide useful information when fsck.hfsplus cannot repair a damaged file system. detective mode fr ๐Ÿ”
  • -D flags โ€” print extra debugging information. the flags are a bitmap that control which kind of debug information is printed. the following values are currently implemented:
    • 0x0001 โ€” informational messages
    • 0x0002 โ€” error messages
    • 0x0010 โ€” extended attributes related messages
    • 0x0020 โ€” overlapped extents related messages
  • -b size โ€” specify the size, in bytes, of the physical blocks used by the -B option.
  • -B path โ€” print the files containing the physical blocks listed in the file path. the file should contain one or more decimal, octal (with leading 0) or hexadecimal (with leading 0x) numbers separated by white space. the physical block numbers are relative to the start of the partition, so if you have block numbers relative to the start of the device, you will have to subtract the block number of the start of the partition. the size of a physical block is given with the -b option; the default is 512 bytes per block. ๐Ÿงฑ
  • -f โ€” when used with the -p option, force fsck.hfsplus to check `clean' file systems; otherwise it means force fsck.hfsplus to check and repair journaled HFS+ file systems. forcibly ๐Ÿ’ช
  • -g โ€” causes fsck.hfsplus to generate its output strings in GUI format. this option is used when another application with a graphical user interface (like Mac OS X Disk Utility) is invoking the fsck.hfsplus tool. aesthetic output bestie ๐Ÿ–ฅ๏ธ
  • -x โ€” causes fsck.hfsplus to generate its output strings in XML (plist) format. this option implies the -g option. two-for-one, we love to see it โœจ
  • -l โ€” lock down the file system and perform a test-only check. this makes it possible to check a file system that is currently mounted, although no repairs can be made. look but don't touch ๐Ÿšซ
  • -m mode โ€” mode is an octal number that will be used to set the permissions for the lost+found directory when it is created. the lost+found directory is only created when a volume is repaired and orphaned files or directories are detected. fsck.hfsplus places orphaned files and directories into the lost+found directory (located at the root of the volume). the default mode is 01777. ๐Ÿ 
  • -p โ€” preen the specified file systems.
  • -q โ€” causes fsck.hfsplus to quickly check whether the volume was unmounted cleanly. if the volume was unmounted cleanly, then the exit status is 0. if the volume was not unmounted cleanly, then the exit status will be non-zero. in either case, a message is printed to standard output describing whether the volume was clean or dirty. the โœจvibe checkโœจ of volume checks ๐Ÿ’…
  • -y โ€” always attempt to repair any damage that is found. yes yes yes ๐Ÿ™Œ
  • -n โ€” never attempt to repair any damage that is found. no no no ๐Ÿ™…
  • -E โ€” cause fsck.hfsplus to exit (with a value of 47) if it encounters any major errors. a `major error' is considered one which would impact using the volume in normal usage; an inconsistency which would not impact such use is considered `minor' for this option. only valid with the -n option. โš ๏ธ
  • -R flags โ€” rebuilds the requested btree. the following flags are supported:
    • a โ€” attribute btree
    • c โ€” catalog btree
    • e โ€” extents overflow btree

rebuilding a btree will only work if there is enough free space on the file system for the new btree file, and if fsck.hfsplus is able to traverse each of the nodes in the requested btree successfully. rebuilding btrees is not supported on HFS Standard volumes. rebuild era ๐ŸŒฑ

  • -r โ€” rebuild the catalog btree. this is synonymous with -Rc. same thing, shorter name ๐ŸŽ€

โš ๏ธ real talk: because of inconsistencies between the block device and the buffer cache, the raw device should always be used. no cap, this one matters ๐Ÿซถ

๐ŸŒˆ EXIT VALUES ๐ŸŒˆ

fsck.hfsplus indicates some status by exit value. the current list of exit status results is:

  • 0 โ€” no errors found, or successfully repaired. clean queen ๐Ÿ‘‘
  • 3 โ€” a quick-check (the -n option) found a dirty filesystem; no repairs were made. spotted it, didn't touch it ๐Ÿ‘€
  • 4 โ€” during boot, the root filesystem was found to be dirty; repairs were made, and the filesystem was remounted. the system should be rebooted. ๐Ÿ”„
  • 8 โ€” a corrupt filesystem was found during a check, or repairs did not succeed. ๐Ÿ˜ญ
  • 47 โ€” a major error was found with -E. ๐Ÿ’€

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

fsck(8) โ€” go give her a read too bestie ๐Ÿซถ


๐Ÿ’€ BUGS ๐Ÿ’€

fsck.hfsplus is not able to fix some inconsistencies that it detects. she's trying her best okay ๐Ÿ˜ญ


๐Ÿงš HISTORY ๐Ÿงš

the fsck.hfsplus command appeared in Mac OS X Server 1.0. a true icon from the start โญ


okay that's the whole page, bestie ๐Ÿ’– this was brought to you by the Mac OS X manual, dated August 5, 2008 โ€” an absolute classic, no notes, we stan a vintage queen ๐ŸŒธโœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from