~ubuntu-branches/ubuntu/edgy/e2fsprogs/edgy-security

« back to all changes in this revision

Viewing changes to misc/e2image.8.in

  • Committer: Bazaar Package Importer
  • Author(s): Tollef Fog Heen
  • Date: 2005-08-23 10:42:10 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050823104210-t15igvmgrkzea0dq
Tags: 1.38-2ubuntu1
* Merge with Debian.  (Ubuntu #13757)
* Remove tests/f_bad_disconnected_inode/image.gz to be able to build the
  package.  This will (hopefully) be in the next upstream version and is
  just used for testing.

Show diffs side-by-side

added added

removed removed

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