Sortix main manual
This manual documents Sortix main. You can instead view this document in the latest official manual.
E2IMAGE(8) | System Manager's Manual | E2IMAGE(8) |
NAME
e2image - Save critical ext2/ext3/ext4 file system metadata to a fileSYNOPSIS
e2image [-r|-Q [-af]] [ -b superblock ] [ -B blocksize ] [ -cnps ] [ -o src_offset ] [ -O dest_offset ] device image-fileDESCRIPTION
The e2image program will save critical ext2, ext3, or ext4 file system metadata located on device to a file specified by image-file. The image file may be examined by dumpe2fs and debugfs, by using the -i option to those programs. This can assist an expert in recovering catastrophically corrupted file systems.OPTIONS
- -a
- Include file data in the image file. Normally e2image only includes fs metadata, not regular file data. This option will produce an image that is suitable to use to clone the entire FS or for backup purposes. Note that this option only works with the raw (-r) or QCOW2 (-Q) formats. In conjunction with the -r option it is possible to clone all and only the used blocks of one file system to another device/image file.
- -b superblock
- Get image from partition with broken primary superblock by using the superblock located at file system block number superblock. The partition is copied as-is including broken primary superblock.
- -B blocksize
- Set the file system blocksize in bytes. Normally, e2image will search for the superblock at various different block sizes in an attempt to find the appropriate blocksize. This search can be fooled in some cases. This option forces e2fsck to only try locating the superblock with a particular blocksize. If the superblock is not found, e2image will terminate with a fatal error.
- -c
- Compare each block to be copied from the source device to the corresponding block in the target image-file. If both are already the same, the write will be skipped. This is useful if the file system is being cloned to a flash-based storage device (where reads are very fast and where it is desirable to avoid unnecessary writes to reduce write wear on the device).
- -f
- Override the read-only requirement for the source file system when saving the image file using the -r and -Q options. Normally, if the source file system is in use, the resulting image file is very likely not going to be useful. In some cases where the source file system is in constant use this may be better than no image at all.
- -I
- install the metadata stored in the image file back to the device. It can be used to restore the file system metadata back to the device in emergency situations.
- -n
- Cause all image writes to be skipped, and instead only print the block numbers that would have been written.
- -o src_offset
- Specify offset of the image to be read from the start of the source device in bytes. See OFFSETS for more details.
- -O tgt_offset
- Specify offset of the image to be written from the start of the target image-file in bytes. See OFFSETS for more details.
- -p
- Show progress of image-file creation.
- -Q
- Create a QCOW2-format image file instead of a normal image file, suitable for use by virtual machine images, and other tools that can use the .qcow image format. See QCOW2 IMAGE FILES below for details.
- -r
- Create a raw image file instead of a normal image file. See RAW IMAGE FILES below for details.
- -s
-
Scramble directory entries and zero out unused portions of the directory blocks in the written image file to avoid revealing information about the contents of the file system. However, this will prevent analysis of problems related to hash-tree indexed directories.
RAW IMAGE FILES
The -r option will create a raw image file, which differs from a normal image file in two ways. First, the file system metadata is placed in the same relative offset within image-file as it is in the device so that debugfs(8), dumpe2fs(8), e2fsck(8), losetup(8), etc. and can be run directly on the raw image file. In order to minimize the amount of disk space consumed by the raw image file, it is created as a sparse file. (Beware of copying or compressing/decompressing this file with utilities that don't understand how to create sparse files; the file will become as large as the file system itself!) Secondly, the raw image file also includes indirect blocks and directory blocks, which the standard image file does not have.QCOW2 IMAGE FILES
The -Q option will create a QCOW2 image file instead of a normal, or raw image file. A QCOW2 image contains all the information the raw image does, however unlike the raw image it is not sparse. The QCOW2 image minimize the amount of space used by the image by storing it in special format which packs data closely together, hence avoiding holes while still minimizing size.OFFSETS
Normally a file system starts at the beginning of a partition, and e2image is run on the partition. When working with image files, you don't have the option of using the partition device, so you can specify the offset where the file system starts directly with the -o option. Similarly the -O option specifies the offset that should be seeked to in the destination before writing the file system.AUTHOR
e2image was written by Theodore Ts'o (tytso@mit.edu).AVAILABILITY
e2image is part of the e2fsprogs package and is available from http://e2fsprogs.sourceforge.net.SEE ALSO
dumpe2fs(8), debugfs(8) e2fsck(8)December 2021 | E2fsprogs version 1.46.5 |