e2image Command Examples in Linux

The e2image command in Linux is used to create an image of an ext2, ext3, or ext4 file system. This image can be used for backup or recovery purposes. The command creates a file that contains a copy of the file system’s data, which can be restored to a disk or partition using the e2image command.

e2image Command Examples

1. Write metadata located on device to a specific file:

# e2image /dev/sdXN path/to/image_file

2. Print metadata located on device to stdout:

# e2image /dev/sdXN -

3. Restore the filesystem metadata back to the device:

# e2image -I /dev/sdXN path/to/image_file

4. Create a large raw sparse file with metadata at proper offsets:

# e2image -r /dev/sdXN path/to/image_file

5. Create a QCOW2 image file instead of a normal or raw image file:

# e2image -Q /dev/sdXN path/to/image_file
Related Post