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