debugfs Command Examples in Linux

debugfs is a command line tool in Linux that can be used to interact with the ext2, ext3 and ext4 file systems. It is used to examine and modify the file system structures, and can be used for various tasks such as checking the file system consistency, checking the file system statistics, and recovering lost files.

debugfs is a powerful command-line tool and should be used with caution, as it can cause data loss if used improperly.

debugfs Command Examples

1. Open the filesystem in read only mode:

# debugfs /dev/sdXN

2. Open the filesystem in read write mode:

# debugfs -w /dev/sdXN

3. Read commands from a specified file, execute them and then exit:

# debugfs -f path/to/cmd_file /dev/sdXN

4. View the filesystem stats in debugfs console:

# stats

5. Close the filesystem:

# close -a

6. List all available commands:

# lr
Related Post