1xfs_scrub(8) System Manager's Manual xfs_scrub(8)
2
3
4
6 xfs_scrub - check the contents of a mounted XFS filesystem
7
9 xfs_scrub [ -abCemnTvx ] mount-point
10 xfs_scrub -V
11
13 xfs_scrub attempts to check and repair all metadata in a mounted XFS
14 filesystem.
15
16 WARNING! This program is EXPERIMENTAL, which means that its behavior
17 and interface could change at any time!
18
19 xfs_scrub asks the kernel to scrub all metadata objects in the filesys‐
20 tem. Metadata records are scanned for obviously bad values and then
21 cross-referenced against other metadata. The goal is to establish a
22 reasonable confidence about the consistency of the overall filesystem
23 by examining the consistency of individual metadata records against the
24 other metadata in the filesystem. Damaged metadata can be rebuilt from
25 other metadata if there exists redundant data structures which are
26 intact.
27
28 Filesystem corruption and optimization opportunities will be logged to
29 the standard error stream. Enabling verbose mode will increase the
30 amount of status information sent to the output.
31
32 If the kernel scrub reports that metadata needs repairs or optimiza‐
33 tions and the user does not pass -n on the command line, this program
34 will ask the kernel to make the repairs and to perform the optimiza‐
35 tions. See the sections about optimizations and repairs for a list of
36 optimizations and repairs known to this program. The kernel may not
37 support repairing or optimizing the filesystem. If this is the case,
38 the filesystem must be unmounted and xfs_repair(8) run on the filesys‐
39 tem to fix the problems.
40
42 -a errors
43 Abort if more than this many errors are found on the filesystem.
44
45 -b Run in background mode. If the option is specified once, only
46 run a single scrubbing thread at a time. If given more than
47 once, an artificial delay of 100us is added to each scrub call
48 to reduce CPU overhead even further.
49
50 -C fd This option causes xfs_scrub to write progress information to
51 the specified file description so that the progress of the
52 filesystem check can be monitored. If the file description is a
53 tty, a fancy progress bar is rendered. Otherwise, a simple
54 numeric status dump compatible with the fsck -C format is out‐
55 put.
56
57 -e Specifies what happens when errors are detected. If shutdown is
58 given, the filesystem will be taken offline if errors are found.
59 If continue is given, no action is taken if errors are found;
60 this is the default behavior.
61
62 -k Do not call TRIM on the free space.
63
64 -m file
65 Search this file for mounted filesystems instead of /etc/mtab.
66
67 -n Only check filesystem metadata. Do not repair or optimize any‐
68 thing.
69
70 -T Print timing and memory usage information for each phase.
71
72 -v Enable verbose mode, which prints periodic status updates.
73
74 -V Prints the version number and exits.
75
76 -x Read all file data extents to look for disk errors. xfs_scrub
77 will issue O_DIRECT reads to the block device directly. If the
78 block device is a SCSI disk, it will instead issue READ VERIFY
79 commands directly to the disk. These actions will confirm that
80 all file data blocks can be read from storage.
81
83 Optimizations supported by this program include, but are not limited
84 to:
85
86 · Instructing the underlying storage to discard unused extents via the
87 TRIM ioctl.
88
90 This program currently does not support making any repairs. Corrup‐
91 tions can only be fixed by unmounting the filesystem and running
92 xfs_repair(8).
93
95 The exit code returned by xfs_scrub is the sum of the following condi‐
96 tions:
97 0 - No errors
98 1 - File system errors left uncorrected
99 2 - File system optimizations possible
100 4 - Operational error
101 8 - Usage or syntax error
102
104 xfs_scrub is an immature utility! Do not run this program unless you
105 have backups of your data! This program takes advantage of in-kernel
106 scrubbing to verify a given data structure with locks held and can keep
107 the filesystem busy for a long time. The kernel must be new enough to
108 support the SCRUB_METADATA ioctl.
109
110 If errors are found and cannot be repaired, the filesystem must be
111 unmounted and repaired.
112
114 xfs_repair(8).
115
116
117
118 xfs_scrub(8)