-w Specifies that the file system should be opened in read-
write mode. Without this option, the file system is
opened in read-only mode.
-n Disables metadata checksum verification. This should only
be used if you believe the metadata to be correct despite
the complaints of e2fsprogs.
-c Specifies that the file system should be opened in
catastrophic mode, in which the inode and group bitmaps
are not read initially. This can be useful for file
systems with significant corruption, but because of this,
catastrophic mode forces the file system to be opened
read-only.
-i Specifies that device represents an ext2 image file
created by the e2image
program. Since the ext2 image file
only contains the superblock, block group descriptor,
block and inode allocation bitmaps, and the inode table,
many debugfs
commands will not function properly.
Warning:
no safety checks are in place, and debugfs
may
fail in interesting ways if commands such as ls, dump,
etc. are tried without specifying the data_source_device
using the -d option. debugfs
is a debugging tool. It has
rough edges!
-d data_source_device
Used with the -i option, specifies that data_source_device
should be used when reading blocks not found in the ext2
image file. This includes data, directory, and indirect
blocks.
-b blocksize
Forces the use of the given block size (in bytes) for the
file system, rather than detecting the correct block size
automatically. (This option is rarely needed; it is used
primarily when the file system is extremely badly
damaged/corrupted.)
-s superblock
Causes the file system superblock to be read from the
given block number, instead of using the primary
superblock (located at an offset of 1024 bytes from the
beginning of the file system). If you specify the -s
option, you must also provide the blocksize of the file
system via the -b option. (This option is rarely needed;
it is used primarily when the file system is extremely
badly damaged/corrupted.)
-f cmd_file
Causes debugfs
to read in commands from cmd_file, and
execute them. When debugfs
is finished executing those
commands, it will exit.
-D Causes debugfs
to open the device using Direct I/O,
bypassing the buffer cache. Note that some Linux devices,
notably device mapper as of this writing, do not support
Direct I/O.
-R request
Causes debugfs
to execute the single command request, and
then exit.
-V print the version number of debugfs
and exit.
-z
undo_file
Before overwriting a file system block, write the old
contents of the block to an undo file. This undo file can
be used with e2undo(8) to restore the old contents of the
file system should something go wrong. If the empty
string is passed as the undo_file argument, the undo file
will be written to a file named debugfs-device.e2undo in
the directory specified via the E2FSPROGS_UNDO_DIR
environment variable.
WARNING: The undo file cannot be used to recover from a
power or system crash.