.\" Copyright (c) 2002 Apple Computer, Inc. All rights reserved. .\" .\" The contents of this file constitute Original Code as defined in and .\" are subject to the Apple Public Source License Version 1.1 (the .\" "License"). You may not use this file except in compliance with the .\" License. Please obtain a copy of the License at .\" http://www.apple.com/publicsource and read it before using this file. .\" .\" This Original Code and all software distributed under the License are .\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER .\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, .\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, .\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the .\" License for the specific language governing rights and limitations .\" under the License. .\" .\" @(#)fsck_hfs.8 .Dd November 21, 2002 .Dt FSCK_HFS 8 .Os "Mac OS X" .Sh NAME .Nm fsck.hfs .Nd HFS file system consistency check .Sh SYNOPSIS .Nm fsck.hfs .Fl q .Op Fl df .Ar special ... .Nm fsck.hfs .Fl p .Op Fl df .Ar special ... .Nm fsck.hfs .Op Fl n | y | r .Op Fl dfgl .Op Fl m Ar mode .Op Fl c Ar size .Ar special ... .Sh DESCRIPTION .Pp The .Nm utility verifies and repairs standard HFS and HFS+ file systems. .Pp The first form of .Nm quickly checks the specified file systems to determine whether they were cleanly unmounted. .Pp The second form of .Nm preens the specified file systems. It is normally started by .Xr fsck 8 during systen boot, when a HFS file system is detected. When preening file systems, .Nm will fix common inconsistencies for file systems that were not unmounted cleanly. If more serious problems are found, .Nm does not try to fix them, indicates that it was not successful, and exits. .Pp The third form of .Nm checks the specified file systems and tries to repair all detected inconsistencies. .Pp If no options are specified .Nm will always check and attempt to fix the specified file systems. .Pp The options are as follows: .Bl -hang -offset indent .It Fl c Ar size Specify the .Ar size of the cache used by .Nm internally. Bigger .Ar size can result in better performance but can result in deadlock when used with .Fl 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. .It Fl d Display debugging information. This option may provide useful information when .Nm cannot repair a damaged file system. .It Fl f When used with the .Fl p option, force .Nm to check `clean' file systems, otherwise it means force .Nm to check and repair journaled HFS+ file systems. .It Fl g Causes .Nm 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 .Nm tool. .It Fl 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. .It Fl m Ar 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. .Nm places orphaned files and directories into the lost+found directory (located at the root of the volume). The default mode is 01777. .It Fl p Preen the specified file systems. .It Fl q Causes .Nm 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. .It Fl y Always attempt to repair any damage that is found. .It Fl n Never attempt to repair any damage that is found. .It Fl r Rebuild the catalog file on the specified file system. This option currently will only work if there is enough contiguous space on the specified file system for a new catalog file and if there is no damage to the leaf nodes in the existing catalog file. .El .Pp .Sh SEE ALSO .Xr fsck 8 .Sh BUGS .Nm is not able to fix some inconsistencies that it detects. .Sh HISTORY The .Nm command appeared in Mac OS X Server 1.0 .