test veritas logo



fsck_vxfs - check and repair a VxFS file system


fsck [ -t vxfs ] [ -mNnYyV ] [ generic_options ] [ -o specific_options ] special...




fsck examines VxFS file systems for consistency. Because Veritas File Systems record pending file system updates in an intent log, fsck typically replays the intent log instead of doing a full structural file system check.

special specifies one or more block or special character devices, for example, /dev/sdb1.

If multiple devices are specified, each device is checked in turn unless the -o p suboption is also specified, in which case the devices are checked in parallel.


Checking the raw device is almost always faster.

If a structural flaw is detected during the intent log replay, the full fsck flag is set on the file system without operator interaction.

If fsck encounters a large file on an older OS version, the command stops without completing the file system check.

Due to a behavioral issue with the Linux fsck wrapper, you must run the VxFS fsck command, /opt/VRTS/bin/fsck, when specifying any option with an equals sign ("=") in it, such as -o zapvol=volname.

The mount command automatically runs the VxFS fsck command to clean up the intent log if the mount command detects a dirty log in the file system. This functionality is only supported on file systems mounted on a Veritas Volume Manager (VxVM) volume.

Cluster File System Issues

The fsck command reserves a shared volume when invoked, unless the -n option is specified. If the shared volume is in use by another command, the fsck command will fail.

Be careful when accessing shared volumes with other utilities, such as dd, that can write data to disk. It is possible to destroy data being accessed from other nodes.


  Supported by the generic fsck command. See the fsck(8) manual page. generic_options include the options listed below.
-t vxfs Specifies the VxFS file system type.
-m Reports whether the file system was marked clean and returns an exit code. A zero indicates the file system is clean, a 32 indicates that the file system needs checking. This option does not validate the file system.
-n | N Assumes a no response to all prompts by fsck. fsck does not open the file system for writing, does not replay the intent log, and performs a full file system check. Use this option to test for file system corruption.
-V Echoes the expanded command line, but does not execute the command.
-y | Y Assumes a yes response to all prompts by fsck. Additionally, if the file system requires a full file system check after the log replay, or if the nolog suboption causes the log replay to be skipped and the file system is not clean, a full file system check is performed. For troubleshooting purpose, it is strongly recommended to take a backup or copy of the volume where file system resides before running fsck with -y | Y option.
-o Specifies VxFS file system-specific options. These options can be a combination of the following in a comma-separated list:
full Performs a full file system check.
  The default progress status interval is 10 seconds. With this option, the interval is set to N seconds. You can specify this option only with the -o status option.
  This option is used internally by cluster-mounted file systems. Never use this option directly.
metasave=[metasave binary location]
  This option is used to collect metasave before doing log replay or fullfsck. Please specify the location of Metasave binary with this option. If VRTSspt is installed on the server, metasave binary is placed at /opt/VRTSspt/FS/MetaSave. By default it will store the collected metasave inside /var/VRTS/vxfs/ directory. If /var does not have sufficient space then use target option to provide the location to store collected metasave. For a larger Filesystem, it is recommended to use target option. If collection of metasave fails, fsck operation would be aborted.
target=[target directory]
  This option is used to provide the target directory where metasave file would be stored. This option can only be used with metasave option.
nolog Do not perform a log replay. Use this option only if the log area was physically damaged or fsck cannot read the log’s layout.
Use the -n option to verify whether there are file system inconsistencies. Use fsck -o full,nolog to fix a corrupted file system and avoid a log replay. If you run fsck -o full without nolog on a clean file system, it replays the intent log and performs a full file system check.
p Allows parallel log replay for several VxFS file systems. Each message from fsck is prefixed with the device name to identify the device. This suboption does not perform a full file system check in parallel; that is still done sequentially on each device, even when multiple devices are specified. This option is compatible only with the -y|Y option (that is, non-interactive full file system check), in which case a log replay is done in parallel on all specified devices. A sequential full file system check is performed on devices where needed. The number of devices that can be checked in parallel is determined by the amount of physical memory in the system. One instance of fsck on a single file system can consume memory equivalent to twice the size of that file system’s intent log. For example, a file system with a 16 megabyte intent log can cause fsck to consume up to 32 megabytes of memory.
This option is mutually exclusive with all other VxFS file system-specific options, except for the status option.
status Enables progress status reporting. The status is reported as the percentage of processed file system objects to the total number of file system objects for each pass. The status is refreshed on the same line.
When the progress status reporting is enabled, the fsck command can take a slightly longer amount of time to complete, depending on the number of validations done during the file system check.
  This option will remove all checkpoints from the file system, all of the data contained in the checkpoints will therefore be lost and cannot be recovered after operation has been performed
  Forcibly removes a volume from a multi-volume file system. All inodes that refer to this volume are cleared.
Because VxFS maintains an intent log, a complete check is generally not required. The default is to perform an intent log replay only. If fsck or the log replay detects file system damage, an indication that a complete check is required is placed in the super-block. In this case, if you specified the -y option, the full check runs after the log replay. If you did not specify the -y option, run fsck -o full to perform the full structural check.

A full file system check validates all file system metadata by looking for both invalid values and metadata elements that should be mutually consistent but are not. If fsck finds any inconsistencies, fsck resolves the inconsistencies either by removing the affected files or by adjusting metadata elements to match others, as appropriate. After a successful check and repair, requests to mount the file system should succeed.

Orphaned files and directories (allocated but unreferenced) are, with the user’s agreement, reconnected by placing them in the lost+found directory. The name assigned is the inode number. The only restriction is that the directory lost+found must already exist in the file system’s root directory.


Structural errors discovered during a full check are displayed on the standard output. Responses required during a full check are read from standard input.

The following return codes are used for the -m (generic) option:

0 The file system is unmounted and clean.
32 The file system is unmounted and needs checking.
33 The file system is mounted.
34 The stat of the device failed.
Other The state could not be determined because of an error.

In most cases, fsck prints the following messages:

log replay in progress replay complete - marking super-block as CLEAN

If the file system is already clean, fsck prints the following message instead:

file system is clean - log replay is not required

If fsck prints any other messages, a full structural check is needed. If the -y option is specified, fsck performs (if necessary) a full check after running the intent log replay. If the -y option is not used, fsck must be invoked with the -o full option to perform a full structural check.

If -o p is specified, fsck prints the following messages for a device, for example /dev/sdb1:

/dev/sdb1:log replay in progress /dev/sdb1:replay complete - marking super-block as CLEAN


To collect metasave through fsck inside /root directory:

# fsck -t vxfs -y -o full,metasave=/opt/VRTSspt/FS/MetaSave/metasave,target=/root/ /dev/vx/dsk/dg1/vol1


All error messages that relate to the contents of a file system produced during a log replay are displayed on the standard output. All I/O failures and exit messages are displayed on standard error.


fs_vxfs(4), fsck(8), mkfs(8)

VxFS 8.0 fsck_vxfs(1M)