1 .\" Copyright (c) 2002,2008 Apple Inc. All rights reserved.
3 .\" The contents of this file constitute Original Code as defined in and
4 .\" are subject to the Apple Public Source License Version 1.1 (the
5 .\" "License"). You may not use this file except in compliance with the
6 .\" License. Please obtain a copy of the License at
7 .\" http://www.apple.com/publicsource and read it before using this file.
9 .\" This Original Code and all software distributed under the License are
10 .\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
11 .\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
12 .\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
13 .\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
14 .\" License for the specific language governing rights and limitations
15 .\" under the License.
23 .Nd HFS file system consistency check
47 utility verifies and repairs standard HFS and HFS+ file systems.
51 quickly checks the specified file systems to determine whether
52 they were cleanly unmounted.
56 preens the specified file systems.
57 It is normally started by
61 during automatic reboot, when a HFS file system is detected.
62 When preening file systems,
64 will fix common inconsistencies for file systems that were not
66 If more serious problems are found,
68 does not try to fix them, indicates that it was not
69 successful, and exits.
73 checks the specified file systems and tries to repair all
74 detected inconsistencies.
76 If no options are specified
78 will always check and attempt to fix the specified file systems.
80 The options are as follows:
81 .Bl -hang -offset indent
89 can result in better performance but can result in deadlock when
92 option. Size can be specified as a decimal, octal, or
93 hexadecimal number. If the number ends with a ``k'', ``m'',
94 or ``g'', the number is multiplied by 1024 (1K), 1048576 (1M),
95 or 1073741824 (1G), respectively.
97 Display debugging information.
98 This option may provide useful information when
100 cannot repair a damaged file system.
102 Print extra debugging information. The
104 are a bitmap that control which kind of debug information is printed.
105 The following values are currently implemented:
106 .Bl -hang -offset indent -compact
108 Informational messages
112 Extended attributes related messages
114 Overlapped extents related messages
117 Specify the size, in bytes, of the physical blocks used by the
121 Print the files containing the physical blocks listed in the file
123 The file should contain one or more decimal, octal (with leading 0) or
124 hexadecimal (with leading 0x) numbers separated by white space. The physical
125 block numbers are relative to the start of the partition, so if you
126 have block numbers relative to the start of the device, you will have to
127 subtract the block number of the start of the partition. The size of a
128 physical block is given with the
130 option; the default is 512 bytes per block.
136 to check `clean' file systems, otherwise it means force
138 to check and repair journaled HFS+ file systems.
142 to generate its output strings in GUI format.
143 This option is used when another application with a graphical user interface
144 (like Mac OS X Disk Utility) is invoking the
150 to generate its output strings in XML (plist) format. This option
155 Lock down the file system and perform a test-only check.
156 This makes it possible to check a file system that is currently mounted,
157 although no repairs can be made.
159 Mode is an octal number that will be used to set the permissions for the
160 lost+found directory when it is created.
161 The lost+found directory is only created when a volume is repaired and orphaned
162 files or directories are detected.
164 places orphaned files and directories into the lost+found directory (located
165 at the root of the volume).
166 The default mode is 01777.
168 Preen the specified file systems.
172 to quickly check whether the volume was unmounted cleanly.
173 If the volume was unmounted cleanly, then the exit status is 0.
174 If the volume was not unmounted cleanly, then the exit status will be non-zero.
175 In either case, a message is printed to standard output describing whether the
176 volume was clean or dirty.
178 Always attempt to repair any damage that is found.
180 Never attempt to repair any damage that is found.
184 to exit (with a value of 47) if it encounters any
185 major errors. A ``major error'' is considered one which
186 would impact using the volume in normal usage; an inconsistency
187 which would not impact such use is considered ``minor'' for this
188 option. Only valid with the
194 to scan the entire device looking for I/O errors. It will
195 attempt to map the blocks with errors to names, similar to
200 Rebuilds the requested btree. The following flags are supported:
201 .Bl -hang -offset indent -compact
207 Extents overflow btree
209 Rebuilding a btree will only
210 work if there is enough free space on the file system for the new btree
213 is able to traverse each of the nodes in the requested btree successfully.
214 Rebuilding btrees is not supported on HFS Standard volumes.
216 Rebuild the catalog btree. This is synonymous with
220 Because of inconsistencies between the block device and the buffer cache,
221 the raw device should always be used.
224 indicates some status by exit value. The current list of exit status results
226 .Bl -hang -offset indent -compact
228 No errors found, or successfully repaired.
232 option) found a dirty filesystem; no repairs were made.
234 During boot, the root filesystem was found to be dirty; repairs were
235 made, and the filesystem was remounted. The system should be rebooted.
237 A corrupt filesystem was found during a check, or repairs did not succeed.
239 A major error was found with
246 is not able to fix some inconsistencies that it detects.
250 command appeared in Mac OS X Server 1.0 .