1FSCK_HFS(8) BSD System Manager's Manual FSCK_HFS(8)
2
4 fsck.hfsplus — HFS file system consistency check
5
7 fsck.hfsplus -q [-df] special ...
8 fsck.hfsplus -p [-df] special ...
9 fsck.hfsplus [-n | -y | -r] [-dfgxlE] [-D flags] [-b size] [-B path]
10 [-m mode] [-c size] [-R flags] special ...
11
13 The fsck.hfsplus utility verifies and repairs standard HFS and HFS+ file
14 systems.
15
16 The first form of fsck.hfsplus quickly checks the specified file systems
17 to determine whether they were cleanly unmounted.
18
19 The second form of fsck.hfsplus preens the specified file systems. It is
20 normally started by fsck(8) run from /etc/rc.boot during automatic
21 reboot, when a HFS file system is detected. When preening file systems,
22 fsck.hfsplus will fix common inconsistencies for file systems that were
23 not unmounted cleanly. If more serious problems are found, fsck.hfsplus
24 does not try to fix them, indicates that it was not successful, and
25 exits.
26
27 The third form of fsck.hfsplus checks the specified file systems and
28 tries to repair all detected inconsistencies.
29
30 If no options are specified fsck.hfsplus will always check and attempt to
31 fix the specified file systems.
32
33 The options are as follows:
34
35 -c size Specify the size of the cache used by fsck.hfsplus inter‐
36 nally. Bigger size can result in better performance but
37 can result in deadlock when used with -l option. Size can
38 be specified as a decimal, octal, or hexadecimal number.
39 If the number ends with a ``k'', ``m'', or ``g'', the num‐
40 ber is multiplied by 1024 (1K), 1048576 (1M), or 1073741824
41 (1G), respectively.
42
43 -d Display debugging information. This option may provide
44 useful information when fsck.hfsplus cannot repair a dam‐
45 aged file system.
46
47 -D flags Print extra debugging information. The flags are a bitmap
48 that control which kind of debug information is printed.
49 The following values are currently implemented:
50 0x0001 Informational messages
51 0x0002 Error messages
52 0x0010 Extended attributes related messages
53 0x0020 Overlapped extents related messages
54
55 -b size Specify the size, in bytes, of the physical blocks used by
56 the -B option.
57
58 -B path Print the files containing the physical blocks listed in
59 the file path. The file should contain one or more deci‐
60 mal, octal (with leading 0) or hexadecimal (with leading
61 0x) numbers separated by white space. The physical block
62 numbers are relative to the start of the partition, so if
63 you have block numbers relative to the start of the device,
64 you will have to subtract the block number of the start of
65 the partition. The size of a physical block is given with
66 the -b option; the default is 512 bytes per block.
67
68 -f When used with the -p option, force fsck.hfsplus to check
69 `clean' file systems, otherwise it means force fsck.hfsplus
70 to check and repair journaled HFS+ file systems.
71
72 -g Causes fsck.hfsplus to generate its output strings in GUI
73 format. This option is used when another application with
74 a graphical user interface (like Mac OS X Disk Utility) is
75 invoking the fsck.hfsplus tool.
76
77 -x Causes fsck.hfsplus to generate its output strings in XML
78 (plist) format. This option implies the -g option.
79
80 -l Lock down the file system and perform a test-only check.
81 This makes it possible to check a file system that is cur‐
82 rently mounted, although no repairs can be made.
83
84 -m mode Mode is an octal number that will be used to set the per‐
85 missions for the lost+found directory when it is created.
86 The lost+found directory is only created when a volume is
87 repaired and orphaned files or directories are detected.
88 fsck.hfsplus places orphaned files and directories into the
89 lost+found directory (located at the root of the volume).
90 The default mode is 01777.
91
92 -p Preen the specified file systems.
93
94 -q Causes fsck.hfsplus to quickly check whether the volume was
95 unmounted cleanly. If the volume was unmounted cleanly,
96 then the exit status is 0. If the volume was not unmounted
97 cleanly, then the exit status will be non-zero. In either
98 case, a message is printed to standard output describing
99 whether the volume was clean or dirty.
100
101 -y Always attempt to repair any damage that is found.
102
103 -n Never attempt to repair any damage that is found.
104
105 -E Cause fsck.hfsplus to exit (with a value of 47) if it
106 encounters any major errors. A ``major error'' is consid‐
107 ered one which would impact using the volume in normal
108 usage; an inconsistency which would not impact such use is
109 considered ``minor'' for this option. Only valid with the
110 -n option.
111
112 -R flags Rebuilds the requested btree. The following flags are
113 supported:
114 a Attribute btree
115 c Catalog btree
116 e Extents overflow btree
117 Rebuilding a btree will only work if there is enough free
118 space on the file system for the new btree file, and if
119 fsck.hfsplus is able to traverse each of the nodes in the
120 requested btree successfully. Rebuilding btrees is not
121 supported on HFS Standard volumes.
122
123 -r Rebuild the catalog btree. This is synonymous with -Rc.
124
125 Because of inconsistencies between the block device and the buffer cache,
126 the raw device should always be used.
127
129 fsck.hfsplus indicates some status by exit value. The current list of
130 exit status results is:
131 0 No errors found, or successfully repaired.
132 3 A quick-check (the -n option) found a dirty filesystem; no
133 repairs were made.
134 4 During boot, the root filesystem was found to be dirty;
135 repairs were made, and the filesystem was remounted. The
136 system should be rebooted.
137 8 A corrupt filesystem was found during a check, or repairs
138 did not succeed.
139 47 A major error was found with -E.
140
142 fsck(8)
143
145 fsck.hfsplus is not able to fix some inconsistencies that it detects.
146
148 The fsck.hfsplus command appeared in Mac OS X Server 1.0 .
149
150Mac OS X August 5, 2008 Mac OS X