|FSCK_HFS(8)||System Manager's Manual||FSCK_HFS(8)|
fsck_hfsutility verifies and repairs standard HFS and HFS+ file systems.
The first form of
fsck_hfs quickly checks
the specified file systems to determine whether they were cleanly
The second form of
fsck_hfs preens the
specified file systems. It 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_hfs will fix common inconsistencies for file
systems that were not unmounted cleanly. If more serious problems are found,
fsck_hfs does not try to fix them, indicates that it
was not successful, and exits.
The third form of
fsck_hfs checks the
specified file systems and tries to repair all detected inconsistencies.
If no options are specified
always check and attempt to fix the specified file systems.
The options are as follows:
- Specify the size of the cache used by
fsck_hfsinternally. Bigger size can result in better performance but can result in deadlock when used with
-loption. 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.
- Display debugging information. This option may provide useful information
fsck_hfscannot repair a damaged file system.
- Print extra debugging information. The flags are a
bitmap that control which kind of debug information is printed. The
following values are currently implemented:
- Informational messages
- Error messages
- Extended attributes related messages
- Overlapped extents related messages
- Specify the size, in bytes, of the physical blocks used by the
- 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
-boption; the default is 512 bytes per block.
- When used with the
fsck_hfsto check `clean' file systems, otherwise it means force
fsck_hfsto check and repair journaled HFS+ file systems.
fsck_hfsto 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_hfsto generate its output strings in XML (plist) format. This option implies the
- 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.
- 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
fsck_hfsplaces orphaned files and directories into the lost+found directory (located at the root of the volume). The default mode is 01777.
- Preen the specified file systems.
fsck_hfsto 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.
- Always attempt to repair any damage that is found.
- Never attempt to repair any damage that is found.
fsck_hfsto 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
- Rebuilds the requested btree. The following flags are supported:
- Attribute btree
- Catalog btree
- Extents overflow btree
fsck_hfsis able to traverse each of the nodes in the requested btree successfully. Rebuilding btrees is not supported on HFS Standard volumes.
- Rebuild the catalog btree. This is synonymous with
Because of inconsistencies between the block device and the buffer cache, the raw device should always be used.
fsck_hfsindicates some status by exit value. The current list of exit status results is:
- No errors found, or successfully repaired.
- A quick-check (the
-noption) found a dirty filesystem; no repairs were made.
- During boot, the root filesystem was found to be dirty; repairs were made, and the filesystem was remounted. The system should be rebooted.
- A corrupt filesystem was found during a check, or repairs did not succeed.
- A major error was found with
fsck_hfsis not able to fix some inconsistencies that it detects.
fsck_hfscommand appeared in Mac OS X Server 1.0 .
|August 5, 2008||Mac OS X|