Linux Command Directory
This directory of Linux commands is from Linux in a Nutshell, 5th Edition.
Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.
e2fsck [options] device fsck.ext2 [options] device
System administration command. Checks and repairs a disk, as does fsck, but specifically designed for ext2 (Linux Second Extended) and ext3 (Third Extended, a journaling version of ext2) filesystems. fsck actually uses this command when checking ext2 and ext3 filesystems. Most often used after a sudden shutdown, such as from a power outage, or when damage to the disk is suspected.
Use superblock instead of the default superblock.
Find bad blocks using the badblocks command. Specify this option twice to perform the scan with a nondestructive read-write test.
Force checking, even if kernel has already marked the filesystem as valid. e2fsck will normally exit without checking if the system appears to be clean.
Use the specified external journal file.
Preserve all previously marked bad blocks when using the -c option.
Consult file for a list of bad blocks, in addition to checking for others.
Ensure that no changes are made to the filesystem. When queried, answer "no."
"Preen." Repair all bad blocks noninteractively.
Byte-swap the filesystem if necessary to standard (little-endian) byte-order.
Display timing statistics.
When queried, answer "yes."
Expect to find the superblock at size; if it's not there, exit.
Write completion information to the specified filedescriptor. If 0, print a completion bar.
Optimize directories by reindexing, sorting, and compressing them where possible.
Flush buffer caches before checking.
Consult file for list of bad blocks instead of checking filesystem for them.
Byte-swap the filesystem.