]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blob - misc/e2image.8.in
Clean up e2image man page, mostly based on suggestions from
[thirdparty/e2fsprogs.git] / misc / e2image.8.in
1 .\" -*- nroff -*-
2 .\" Copyright 2001 by Theodore Ts'o. All Rights Reserved.
3 .\" This file may be copied under the terms of the GNU Public License.
4 .\"
5 .TH E2IMAGE 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
6 .SH NAME
7 e2image \- Save critical ext2/ext3 filesystem metadata to a file
8 .SH SYNOPSIS
9 .B e2image
10 [
11 .B \-rsI
12 ]
13 .I device
14 .I image-file
15 .SH DESCRIPTION
16 The
17 .B e2image
18 program will save critical ext2 or ext3 filesystem metadata located on
19 .I device
20 to a file specified by
21 .IR image-file .
22 The image file may be examined by
23 .B dumpe2fs
24 and
25 .BR debugfs ,
26 by using the
27 .B \-i
28 option to those programs. This can assist an expert in
29 recovering catastrophically corrupted filesystems. In the future,
30 e2fsck will be enhanced to be able to use the image file to help
31 recover a badly damaged filesystem.
32 .PP
33 If
34 .I image-file
35 is \-, then the output of
36 .B e2image
37 will be sent to standard output, so that the output can be piped to
38 another program, such as
39 .BR gzip (1).
40 (Note that this is currently only supported when
41 creating a raw image file using the
42 .B \-r
43 option, since the process of creating a normal image file currently
44 requires random access to the file, which cannot be done using a
45 pipe. This restriction will hopefully be lifted in a future version of
46 .BR e2image .)
47 .PP
48 It is a very good idea to create image files for all of
49 filesystems on a system and save the partition
50 layout (which can be generated using the
51 .B fdisk \-l
52 command) at regular intervals --- at boot time, and/or every week or so.
53 The image file should be stored on some filesystem
54 other that
55 the filesystem whose data it contains, to ensure that its data is
56 accessible in the case where the filesystem has been badly damaged.
57 .PP
58 To save disk space,
59 .B e2image
60 creates the image file as a sparse file.
61 Hence, if the image file
62 needs to be copied to another location, it should
63 either be compressed first or copied using the
64 .B \-\-sparse=always
65 option to the GNU version of
66 .BR cp .
67 .PP
68 The size of an ext2 image file depends primarily on the size of the
69 filesystems and how many inodes are in use. For a typical 10 gigabyte
70 filesystem, with 200,000 inodes in use out of 1.2 million inodes, the
71 image file will be approximately 35 megabytes; a 4 gigabyte filesystem with
72 15,000 inodes in use out of 550,000 inodes will result in a 3 megabyte
73 image file. Image files tend to be quite
74 compressible; an image file taking up 32 megabytes of space on
75 disk will generally compress down to 3 or 4 megabytes.
76 .PP
77 .SH RESTORING FILESYSTEM METADATA USING AN IMAGE FILE
78 .PP
79 The
80 .B \-I
81 option will cause e2image to install the metadata stored in the image
82 file back to the device. It can be used to restore the filesystem metadata
83 back to the device in emergency situations.
84 .PP
85 .B WARNING!!!!
86 The
87 .B \-I
88 option should only be used as a desperation measure when other
89 alternatives have failed. If the filesystem has changed since the image
90 file was created, data
91 .B will
92 be lost. In general, you should make a full image
93 backup of the filesystem first, in case you wish to try other recovery
94 strategies afterwards.
95 .PP
96 .SH RAW IMAGE FILES
97 The
98 .B \-r
99 option will create a raw image file instead of a normal image file.
100 A raw image file differs
101 from a normal image file in two ways. First, the filesystem metadata is
102 placed in the proper position so that e2fsck, dumpe2fs, debugfs,
103 etc. can be run directly on the raw image file. In order to minimize
104 the amount of disk space consumed by a raw image file, the file is
105 created as a sparse file. (Beware of copying or
106 compressing/decompressing this file with utilities that don't understand
107 how to create sparse files; the file will become as large as the
108 filesystem itself!) Secondly, the raw image file also includes indirect
109 blocks and directory blocks, which the standard image file does not have,
110 although this may change in the future.
111 .PP
112 Raw image files are sometimes used when sending filesystems to the maintainer
113 as part of bug reports to e2fsprogs. When used in this capacity, the
114 recommended command is as follows (replace hda1 with the appropriate device):
115 .PP
116 .br
117 \ \fBe2image \-r /dev/hda1 \- | bzip2 > hda1.e2i.bz2\fR
118 .PP
119 This will only send the metadata information, without any data blocks.
120 However, the filenames in the directory blocks can still reveal
121 information about the contents of the filesystem that the bug reporter
122 may wish to keep confidential. To address this concern, the
123 .B \-s
124 option can be specified. This will cause
125 .B e2image
126 to scramble directory entries and zero out any unused portions
127 of the directory blocks before writing the image file. However,
128 the
129 .B \-s
130 option will prevent analysis of problems related to hash-tree indexed
131 directories.
132 .PP
133 .SH AUTHOR
134 .B e2image
135 was written by Theodore Ts'o (tytso@mit.edu).
136 .SH AVAILABILITY
137 .B e2image
138 is part of the e2fsprogs package and is available from
139 http://e2fsprogs.sourceforge.net.
140 .SH SEE ALSO
141 .BR dumpe2fs (8),
142 .BR debugfs (8)
143