Name

debugfs

Synopsis

debugfs [[option] device]

System administration command. Provide direct access to data structure of an ext2 or ext3 filesystem in order to debug problems with the device. device is the special file corresponding to the device containing the filesystem (e.g., /dev/hda3). debugfs may be used on a mounted filesystem device.

Option

-b blocksize

Use the specified blocksize for the filesystem.

-c

Catastrophic mode. Open the filesystem in read-only mode; do not read the inode and group bitmaps initially.

-f file

Read commands from file. Exit when done executing commands.

-i

Specify filesystem device is an ext2 image file created by e2image.

-s block

Read the superblock from the specified block.

-w

Open the filesystem in read-write mode.

-R request

Execute the given request (see list below), then exit.

-V

Print version number, then exit.

Requests

bmap file logicalblock

Given the logicalblock of inode file, print the corresponding physical block.

cat file

Dump the contents of an inode to standard output.

cd directory

Change the current working directory to directory.

chroot directory

Change the root directory to be the specified inode.

close

Close the currently open filesystem.

clri file

Clear the contents of the inode corresponding to file.

dump [-p] file out_file

Dump the contents of inode file to out_file. Change ownership and permissions of out_file to match file if -p is specified.

expand_dir directory

Expand directory.

feature [[-]feature]

Set filesystem feature listed on the command line, then print ...

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.