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

NAME

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

SYNOPSIS

9       e2image [ -rsI ] device image-file
10

DESCRIPTION

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

RESTORING FILESYSTEM METADATA USING AN IMAGE FILE

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

RAW IMAGE FILES

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

AUTHOR

91       e2image was written by Theodore Ts'o (tytso@mit.edu).
92

AVAILABILITY

94       e2image  is  part  of  the  e2fsprogs  package  and  is  available from
95       http://e2fsprogs.sourceforge.net.
96

SEE ALSO

98       dumpe2fs(8), debugfs(8)
99
100
101
102
103E2fsprogs version 1.40.2           July 2007                        E2IMAGE(8)
Impressum