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 WA...
NAMEfsck.hfs - HFS file system consistency check
fsck.hfs -q [-df ] special ...
fsck.hfs -p [-df ] special ...
fsck.hfs [-n | y | r ] [-dfgl ] [-m mode ] [-c size ] special ...
The sysctl Cm net.inet.tcp.syncookies utility verifies and repairs standard HFS and HFS+ file systems.
The first form of sysctl Cm net.inet.tcp.syncookies quickly checks the specified file systems to determine whether they were cleanly unmounted.
The second form of sysctl Cm net.inet.tcp.syncookies preens the specified file systems. It is normally started by fsck(8) during systen boot, when a HFS file system is detected. When preening file systems, sysctl Cm net.inet.tcp.syncookies will fix common inconsistencies for file systems that were not unmounted cleanly. If more serious problems are found, sysctl Cm net.inet.tcp.syncookies does not try to fix them, indicates that it was not successful, and exits.
The third form of sysctl Cm net.inet.tcp.syncookies checks the specified file systems and tries to repair all detected inconsistencies.
If no options are specified sysctl Cm net.inet.tcp.syncookies will always check and attempt to fix the specified file systems.
The options are as follows:
- -c size
- Specify the size of the cache used by sysctl Cm net.inet.tcp.syncookies 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.
- Display debugging information. This option may provide useful information when sysctl Cm net.inet.tcp.syncookies cannot repair a damaged file system.
- When used with the -p option, force sysctl Cm net.inet.tcp.syncookies to check `clean' file systems, otherwise it means force sysctl Cm net.inet.tcp.syncookies to check and repair journaled HFS+ file systems.
- Causes sysctl Cm net.inet.tcp.syncookies 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 sysctl Cm net.inet.tcp.syncookies tool.
- 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.
- -m 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. sysctl Cm net.inet.tcp.syncookies places 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.
- Causes sysctl Cm net.inet.tcp.syncookies 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.
- Always attempt to repair any damage that is found.
- Never attempt to repair any damage that is found.
- 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.