FSCK_HFS(8) | System Manager's Manual | FSCK_HFS(8) |
fsck_hfs
— HFS
file system consistency check
fsck_hfs |
-q [-df ]
special ... |
fsck_hfs |
-p [-df ]
special ... |
fsck_hfs |
[-n | -y |
-r ] [-dfgxlES ]
[-D flags]
[-b size]
[-B path]
[-m mode]
[-c size]
[-R flags]
special ... |
The fsck_hfs
utility verifies and repairs
HFS+ file systems.
The first form of fsck_hfs
quickly checks
the specified file systems to determine whether they were cleanly
unmounted.
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 fsck_hfs
will
always check and attempt to fix the specified file systems.
The options are as follows:
-c
sizefsck_hfs
internally. Bigger
size can result in better performance but can result
in deadlock when used with -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.-d
fsck_hfs
cannot repair a damaged file
system.-D
flags-b
size-B
option.-B
path-b
option; the default is 512 bytes per
block.-f
-p
option, force
fsck_hfs
to check `clean' file systems, otherwise
it means force fsck_hfs
to check and repair
journaled HFS+ file systems.-g
fsck_hfs
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_hfs
tool.-x
fsck_hfs
to generate its output strings in
XML (plist) format. This option implies the -g
option.-l
-m
modefsck_hfs
places orphaned files and
directories into the lost+found directory (located at the root of the
volume). The default mode is 01777.-p
-q
fsck_hfs
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.-y
-n
-E
fsck_hfs
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.-S
fsck_hfs
to scan the entire device looking
for I/O errors. It will attempt to map the blocks with errors to names,
similar to the -B
option.-R
flagsfsck_hfs
is
able to traverse each of the nodes in the requested btree
successfully.-r
-Rc
.Because of inconsistencies between the block device and the buffer cache, the raw device should always be used.
fsck_hfs
indicates some status by exit
value. The current list of exit status results is:
-n
option) found a dirty
filesystem; no repairs were made. There is a potential corruption in the
filesystem, and either the journal could not be read, or a runtime
corruption was present so the HFS Volume Inconsistent bit was set.-E
.fsck_hfs
is not able to fix some
inconsistencies that it detects.
The fsck_hfs
command appeared in Mac OS X
Server 1.0 .
October 27, 2020 | Mac OS X |