{"id":3445,"date":"2022-12-20T17:02:42","date_gmt":"2022-12-20T20:02:42","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/xfs_scrub-man8\/"},"modified":"2022-12-20T17:02:42","modified_gmt":"2022-12-20T20:02:42","slug":"xfs_scrub-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/xfs_scrub-man8\/","title":{"rendered":"xfs_scrub (man8)"},"content":{"rendered":"<h1 align=\"center\">xfs_scrub<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#OPTIMIZATIONS\">OPTIMIZATIONS<\/a><br \/> <a href=\"#REPAIRS\">REPAIRS<\/a><br \/> <a href=\"#EXIT CODE\">EXIT CODE<\/a><br \/> <a href=\"#CAVEATS\">CAVEATS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">xfs_scrub \u2212 check and repair the contents of a mounted XFS filesystem<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>xfs_scrub<\/b> [ <b>\u2212abCemnTvx<\/b> ] <i>mount-point<\/i> <b><br \/> xfs_scrub \u2212V<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>xfs_scrub<\/b> attempts to check and repair all metadata in a mounted XFS filesystem.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>WARNING!<\/b> This program is <b>EXPERIMENTAL<\/b>, which means that its behavior and interface could change at any time!<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>xfs_scrub<\/b> asks the kernel to scrub all metadata objects in the filesystem. Metadata records are scanned for obviously bad values and then cross-referenced against other metadata. The goal is to establish a reasonable confidence about the consistency of the overall filesystem by examining the consistency of individual metadata records against the other metadata in the filesystem. Damaged metadata can be rebuilt from other metadata if there exists redundant data structures which are intact.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Filesystem corruption and optimization opportunities will be logged to the standard error stream. Enabling verbose mode will increase the amount of status information sent to the output.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the kernel scrub reports that metadata needs repairs or optimizations and the user does not pass <b>-n<\/b> on the command line, this program will ask the kernel to make the repairs and to perform the optimizations. See the sections about optimizations and repairs for a list of optimizations and repairs known to this program. The kernel may not support repairing or optimizing the filesystem. If this is the case, the filesystem must be unmounted and <b>xfs_repair<\/b>(8) run on the filesystem to fix the problems.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212a<\/b> <i>errors<\/i><\/p>\n<p style=\"margin-left:22%;\">Abort if more than this many errors are found on the filesystem.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"7%\">\n<p><b>\u2212b<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"78%\">\n<p>Run in background mode. If the option is specified once, only run a single scrubbing thread at a time. If given more than once, an artificial delay of 100us is added to each scrub call to reduce CPU overhead even further.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"7%\">\n<p><b>\u2212C<\/b> <i>fd<\/i><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"78%\">\n<p>This option causes xfs_scrub to write progress information to the specified file description so that the progress of the filesystem check can be monitored. If the file description is a tty, a fancy progress bar is rendered. Otherwise, a simple numeric status dump compatible with the <b>fsck -C<\/b> format is output.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"7%\">\n<p><b>\u2212e<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"78%\">\n<p>Specifies what happens when errors are detected. If <i>shutdown<\/i> is given, the filesystem will be taken offline if errors are found. If <i>continue<\/i> is given, no action is taken if errors are found; this is the default behavior.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"7%\">\n<p><b>\u2212k<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"78%\">\n<p>Do not call TRIM on the free space.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>\u2212m<\/b> <i>file<\/i><\/p>\n<p style=\"margin-left:22%;\">Search this file for mounted filesystems instead of \/etc\/mtab.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212n<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Only check filesystem metadata. Do not repair or optimize anything.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212T<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Print timing and memory usage information for each phase.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212v<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Enable verbose mode, which prints periodic status updates.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212V<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Prints the version number and exits.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"3%\">\n<p><b>\u2212x<\/b><\/p>\n<\/td>\n<td width=\"8%\"><\/td>\n<td width=\"78%\">\n<p>Read all file data extents to look for disk errors. <b>xfs_scrub<\/b> will issue O_DIRECT reads to the block device directly. If the block device is a SCSI disk, it will instead issue READ VERIFY commands directly to the disk. If media errors are found, the error report will include the disk offset, in bytes. If the media errors affect a file, the report will also include the inode number and file offset, in bytes. These actions will confirm that all file data blocks can be read from storage.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>OPTIMIZATIONS <a name=\"OPTIMIZATIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Optimizations supported by this program include, but are not limited to:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"86%\">\n<p style=\"margin-top: 1em\">Instructing the underlying storage to discard unused extents via the <b>TRIM<\/b> ioctl.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"86%\">\n<p>Updating secondary superblocks to match the primary superblock.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"86%\">\n<p>Turning off shared block write checks for files that no longer share blocks.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>REPAIRS <a name=\"REPAIRS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Repairs are performed by calling into the kernel. This limits the scope of repair activities to rebuilding primary data structures from secondary data structures, or secondary structures from primary structures. The existence of secondary data structures may require features that can only be turned on from <b>mkfs.xfs<\/b>(8). If errors cannot be repaired, the filesystem must be unmounted and <b>xfs_repair<\/b>(8) run. Repairs supported by the kernel include, but are not limited to:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"86%\">\n<p style=\"margin-top: 1em\">Reconstructing extent allocation data.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"86%\">\n<p>Rebuilding free space information.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"86%\">\n<p>Rebuilding inode indexes.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"86%\">\n<p>Fixing minor corruptions of inode records.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"86%\">\n<p>Recalculating reference count information.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"86%\">\n<p>Reconstructing reverse mapping data from primary extent allocation data.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"86%\">\n<p>Scheduling a quotacheck for the next mount.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">If corrupt metadata is successfully repaired, this program will log that a repair has succeeded instead of a corruption report.<\/p>\n<h2>EXIT CODE <a name=\"EXIT CODE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The exit code returned by <b>xfs_scrub<\/b> is the sum of the following conditions: <br \/> 0 \u2212\u00a0No errors <br \/> 1 \u2212\u00a0File system errors left uncorrected <br \/> 2 \u2212\u00a0File system optimizations possible <br \/> 4 \u2212\u00a0Operational error <br \/> 8 \u2212\u00a0Usage or syntax error<\/p>\n<h2>CAVEATS <a name=\"CAVEATS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>xfs_scrub<\/b> is an immature utility! Do not run this program unless you have backups of your data! This program takes advantage of in-kernel scrubbing to verify a given data structure with locks held and can keep the filesystem busy for a long time. The kernel must be new enough to support the SCRUB_METADATA ioctl.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If errors are found and cannot be repaired, the filesystem must be unmounted and repaired.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>xfs_repair<\/b>(8).<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  xfs_scrub \u2212 check and repair the contents of a mounted XFS filesystem <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,571],"class_list":["post-3445","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-xfs_scrub"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3445"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3445\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}