If image-file is -, then the output of e2image will be sent to standard output, so that the output can be piped to another program, such as gzip(1). (Note that is currently only supported when creating a raw image file using the -r option, since the process of creating a normal image file currently requires random-access access to the file, which can not be done using a pipe. This restriction will hopefully be lifted in a future version of e2image.)
It is a very good idea to periodically (at boot time and every week or so) to create image files for all of filesystems on a system, as well as saving the partition layout (which can be generated using the using fdisk -l command). Ideally the image file should be stored on some filesystem other that the filesystem whose data it contains, to ensure that its data is accessible in the case where the filesystem has been badly damaged.
To save disk space, e2image creates the image file as a sparse file. Hence, if the image file needs to be copied to another location, it should either be compressed first or copied using the --sparse=always option to GNU version of cp.
The size of an ext2 image file depends primarily on the size of the filesystems and how many inodes are in use. For a typical 10 gigabyte filesystem, with 200,000 inodes in use out of 1.2 million inodes, the image file be approximately 35 megabytes; a 4 gigabyte filesystem with 15,000 inodes in use out of 550,000 inodes will result in a 3 megabyte image file. Image files tend to be quite compressible; an image file taking up 32 megabytes of space on disk will generally compress down to 3 or 4 megabytes.
The -I option will cause e2image to install the metadata stored in the image file back to the device. It can be used to restore the filesystem metadata back to the device in emergency situations.
WARNING!!!! The -I option should only be used as desperation measure when other alternatives have failed. If the filesystem has changed since the image file was created, data will be lost. In general, you should make a full image backup of the filesystem first, in case you wish to try other recovery strategies afterwards.
Raw image files are sometimes used when sending filesystems to as part of bug reports to e2fsprogs. When used in this capacity, the recommended command is (replace hda1 with appropriate device):
e2image -r /dev/hda1 - | bzip2 > hda1.e2i.bz2
This will only send the metadata information, without any data blocks. However, the filenames in the directory blocks can still reveal information about the contents of the filesystem that the bug reporter may wish to keep confidential. To address this concern, the -s option can be specified. This will cause e2image to scramble directory entries and zero out any unused portions of the directory blocks before writing them to the image file.