Skip to Content
Linux in a Nutshell, 6th Edition
book

Linux in a Nutshell, 6th Edition

by Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
September 2009
Beginner
942 pages
85h 34m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, 6th Edition

Name

e2fsck

Synopsis

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.

Options

-b superblock

Use superblock instead of the default superblock.

-B size

Expect to find the superblock at size; if it’s not there, exit.

-c

Find bad blocks using the badblocks command. Specify this option twice to perform the scan with a nondestructive read-write test.

-C filedescriptor

Write completion information to the specified filedescriptor. If 0, print a completion bar.

-d

Debugging mode.

-D

Optimize directories by reindexing, sorting, and compressing them where possible.

-f

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.

-F

Flush buffer caches before checking.

-j file

Use the specified external journal file.

-k

Preserve all previously marked bad blocks when using the -c option.

-l file

Consult file for a list of bad blocks, in addition to checking for others.

-L file

Consult file for list of bad blocks instead of checking filesystem for them.

-n

Ensure that no changes are made to the filesystem. When queried, answer “no.”

-p

“Preen.” Repair all ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Unix in a Nutshell, 4th Edition

Unix in a Nutshell, 4th Edition

Arnold Robbins
Linux Under the Hood

Linux Under the Hood

Sander van Vugt
Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman

Publisher Resources

ISBN: 9780596806088Errata Page