1E2IMAGE(8)                  System Manager's Manual                 E2IMAGE(8)
2
3
4

NAME

6       e2image - Save critical ext2/ext3/ext4 filesystem metadata to a file
7

SYNOPSIS

9       e2image [ -rsI ] device image-file
10

DESCRIPTION

12       The  e2image  program will save critical ext2, ext3, or ext4 filesystem
13       metadata located on device to a  file  specified  by  image-file.   The
14       image  file  may  be  examined by dumpe2fs and debugfs, by using the -i
15       option to those programs.  This can assist an expert in recovering cat‐
16       astrophically  corrupted  filesystems.   In  the future, e2fsck will be
17       enhanced to be able to use the image file to help recover a badly  dam‐
18       aged filesystem.
19
20       When  saving  an e2image for debugging purposes, using either the -r or
21       -Q options, the filesystem must be unmounted or be  mounted  read/only,
22       in order for the image file to be in a consistent state.  This require‐
23       ment can be overridden using the -f option,  but  the  resulting  image
24       file is very likely not going to be useful.
25
26       If image-file is -, then the output of e2image will be sent to standard
27       output, so that the output can be piped to  another  program,  such  as
28       gzip(1).   (Note  that this is currently only supported when creating a
29       raw image file using the -r option, since the  process  of  creating  a
30       normal  image  file, or QCOW2 image currently requires random access to
31       the file, which cannot be done using a  pipe.   This  restriction  will
32       hopefully be lifted in a future version of e2image.)
33
34       It  is a very good idea to create image files for all of filesystems on
35       a system and save the partition layout (which can  be  generated  using
36       the  fdisk  -l  command)  at regular intervals --- at boot time, and/or
37       every week or so.  The image file should be stored on  some  filesystem
38       other  than  the filesystem whose data it contains, to ensure that this
39       data is accessible in the case where the filesystem has been badly dam‐
40       aged.
41
42       To save disk space, e2image creates the image file as a sparse file, or
43       in QCOW2 format.  Hence, if the sparse image file needs to be copied to
44       another  location, it should either be compressed first or copied using
45       the --sparse=always option to the GNU version of  cp.   This  does  not
46       apply to the QCOW2 image, which is not sparse.
47
48       The  size  of  an  ext2 image file depends primarily on the size of the
49       filesystems and how many inodes are in use.  For a typical 10  gigabyte
50       filesystem,  with  200,000 inodes in use out of 1.2 million inodes, the
51       image file will be approximately 35 megabytes; a 4 gigabyte  filesystem
52       with  15,000  inodes  in  use  out of 550,000 inodes will result in a 3
53       megabyte image file.  Image files tend to  be  quite  compressible;  an
54       image  file taking up 32 megabytes of space on disk will generally com‐
55       press down to 3 or 4 megabytes.
56

RESTORING FILESYSTEM METADATA USING AN IMAGE FILE

58       The -I option will cause e2image to install the metadata stored in  the
59       image  file  back  to  the  device.     It  can  be used to restore the
60       filesystem metadata back to the device in emergency situations.
61
62       WARNING!!!!  The -I option should only be used as a desperation measure
63       when  other  alternatives  have  failed.  If the filesystem has changed
64       since the image file was created, data will be lost.  In  general,  you
65       should  make  a  full image backup of the filesystem first, in case you
66       wish to try other recovery strategies afterwards.
67

RAW IMAGE FILES

69       The -r option will create a raw image file instead of  a  normal  image
70       file.   A  raw image file differs from a normal image file in two ways.
71       First, the filesystem metadata is placed in the proper position so that
72       e2fsck,  dumpe2fs,  debugfs,  etc. can be run directly on the raw image
73       file.  In order to minimize the amount of disk space consumed by a  raw
74       image  file,  the file is created as a sparse file.  (Beware of copying
75       or compressing/decompressing this file with utilities that don't under‐
76       stand  how to create sparse files; the file will become as large as the
77       filesystem itself!)  Secondly, the raw image file also  includes  indi‐
78       rect  blocks  and  directory blocks, which the standard image file does
79       not have, although this may change in the future.
80
81       Raw image files are sometimes used  when  sending  filesystems  to  the
82       maintainer  as  part  of  bug  reports to e2fsprogs.  When used in this
83       capacity, the recommended command is as follows (replace hda1 with  the
84       appropriate device):
85
86            e2image -r /dev/hda1 - | bzip2 > hda1.e2i.bz2
87
88       This  will only send the metadata information, without any data blocks.
89       However, the filenames in the directory blocks can still reveal  infor‐
90       mation  about  the contents of the filesystem that the bug reporter may
91       wish to keep confidential.  To address this concern, the -s option  can
92       be  specified.   This  will cause e2image to scramble directory entries
93       and zero out any unused portions of the directory blocks before writing
94       the  image file.  However, the -s option will prevent analysis of prob‐
95       lems related to hash-tree indexed directories.
96
97       Note that this will work even if you substitute "/dev/hda1" for another
98       raw disk image, or QCOW2 image previously created by e2image.
99

QCOW2 IMAGE FILES

101       The  -Q  option  will create a QCOW2 image file instead of a normal, or
102       raw image file.  A QCOW2 image contains all  the  information  the  raw
103       image  does,  however  unlike the raw image it is not sparse. The QCOW2
104       image minimize the amount of disk space by storing data in special for‐
105       mat  with  pack data closely together, hence avoiding holes while still
106       minimizing size.
107
108       In order to send filesystem to the maintainer as a part of  bug  report
109       to e2fsprogs, use following commands (replace hda1 with the appropriate
110       device):
111
112            e2image -Q /dev/hda1 hda1.qcow2
113            bzip2 -z hda1.qcow2
114
115       This will only send the metadata information, without any data  blocks.
116       However,  the filenames in the directory blocks can still reveal infor‐
117       mation about the contents of the filesystem that the bug  reporter  may
118       wish  to keep confidential.  To address this concern, the -s option can
119       be specified.  This will cause e2image to  scramble  directory  entries
120       and zero out any unused portions of the directory blocks before writing
121       the image file.  However, the -s option will prevent analysis of  prob‐
122       lems related to hash-tree indexed directories.
123
124       Note that QCOW2 image created by e2image is regular QCOW2 image and can
125       be processed by tools aware of QCOW2 format such as for  example  qemu-
126       img.
127

AUTHOR

129       e2image was written by Theodore Ts'o (tytso@mit.edu).
130

AVAILABILITY

132       e2image  is  part  of  the  e2fsprogs  package  and  is  available from
133       http://e2fsprogs.sourceforge.net.
134

SEE ALSO

136       dumpe2fs(8), debugfs(8)
137
138
139
140
141E2fsprogs version 1.41.12          May 2010                         E2IMAGE(8)
Impressum