E2SCRUB(8)

๐Ÿ’… e2scrub โ€” the manual, but make it cute

okay bestie, so this is e2scrub from the System Manager's Manual, and it's literally here to check your mounted ext[234] file system's vibe without touching the actual contents. no cap.


โœจ NAME โœจ

e2scrub โ€” check the contents of a mounted ext[234] file system ๐Ÿฆ‹


๐ŸŒธ SYNOPSIS ๐ŸŒธ

e2scrub [OPTION] MOUNTPOINT | DEVICE

so you're giving it either a mountpoint or a device, plus maybe an option. that's it. that's the whole thing. periodt.


๐Ÿ’– DESCRIPTION ๐Ÿ’–

so like, e2scrub attempts to check (but not repair) all the metadata in a mounted ext[234] file system โ€” but only if that file system lives on an LVM logical volume. you can also just hand it the block device of the LVM logical volume directly, bestie, it's flexible like that. ๐Ÿ’โ€โ™€๏ธ

the way this works is iconic: it snapshots the volume and runs a file system check on the snapshot to hunt down corruption errors. but โ€” and this is the tea โ€” the LVM volume group must have at least 256MiB of unallocated space to dedicate to the snapshot, or the logical volume just gets skipped. no space, no scrub, sorry babe. ๐Ÿ˜ญ

the snapshot gets named lvname.e2scrub, and heads up: udev will not create symbolic links to it under /dev/disk. every attempt is made to remove the snapshots before running e2scrub, but in a dire situation it might be necessary to remove the snapshot manually. yikes. ๐Ÿ’€

if no errors are found, fstrim can be called on the file system โ€” but only if it's mounted. if errors are found, the file system gets marked as having errors. and bestie, listen: you should take the file system offline and run e2fsck as soon as possible, because e2scrub does not fix corruptions. it's a detective, not a surgeon. ๐Ÿ•ต๏ธโ€โ™€๏ธ if the file system isn't repaired, e2fsck will be run before the next mount. fr fr.


โœจ OPTIONS โœจ

  • -n โ€” print what commands e2scrub would execute to check the file system. so it's giving preview mode. โœจ (Note: the commands will not actually be executed; however, since e2scrub needs to run some commands to query the system to determine what commands would be executed, it still needs to be run as root. so like, root either way, bestie. ๐Ÿ™ˆ)
  • -r โ€” remove the e2scrub snapshot and exit without checking anything. it's the "never mind, we're leaving" option. ๐Ÿšช
  • -t โ€” run fstrim(1) on the mounted file system if no errors are found. little treat for a clean bill of health. ๐ŸŽ€
  • -V โ€” print version information and exit. the classic. ๐Ÿ‘‘

๐ŸŒˆ EXIT CODE ๐ŸŒˆ

the exit codes are the same as in e2fsck(8). so if you know those, you already know these. iykyk. ๐Ÿ’œ


๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

e2fsck(8)


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Darrick J. Wong <darrick.wong@oracle.com> โ€” thank you for your service, king ๐Ÿซถ


Copyright ยฉ2018 Oracle. License is GPLv2+.

<http://www.gnu.org/licenses/gpl-2.0.html>


E2fsprogs version 1.47.4 โ€” March 2025 โ€” and that's the whole E2SCRUB(8) page, bestie. go check those file systems, stay root, and don't forget to repair with e2fsck before the next mount. slay. ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from