blob: f66b99b4b0a9330910c0c27e6d1b388118771ca6 [file] [log] [blame]
Theodore Ts'o348e43d2001-05-03 14:43:43 +00001.\" -*- 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
Theodore Ts'oa7ac1df2003-08-24 17:56:41 -04007e2image \- Save critical ext2/ext3 filesystem data to a file
Theodore Ts'o348e43d2001-05-03 14:43:43 +00008.SH SYNOPSIS
9.B e2image
Theodore Ts'o6304baf2001-08-09 05:41:29 -040010[
11.B \-r
12]
Theodore Ts'o348e43d2001-05-03 14:43:43 +000013.I device
14.I image-file
15.SH DESCRIPTION
Theodore Ts'o0edb4d82001-05-03 16:30:48 +000016The
Theodore Ts'o348e43d2001-05-03 14:43:43 +000017.B e2image
Theodore Ts'o0edb4d82001-05-03 16:30:48 +000018program will save critical filesystem data on the ext2 filesystem located on
Theodore Ts'o0edb4d82001-05-03 16:30:48 +000019.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
28option to those programs. This can be used by an expert in assisting
29the recovery of catastrophically corrupted filesystems. In the future,
30e2fsck will be enhanced to be able to use the image file to help
31recover a badly damaged filesystem.
32.PP
Theodore Ts'o1c1e0042001-08-09 06:04:32 -040033If
34.I image-file
35is -, then the output of
36.B e2image
37will be sent to standard output.
38.PP
Theodore Ts'o6304baf2001-08-09 05:41:29 -040039The
40.B \-r
Theodore Ts'o1c1e0042001-08-09 06:04:32 -040041option will create a raw image file instead of a normal image file.
42A raw image file differs
Theodore Ts'o6304baf2001-08-09 05:41:29 -040043from a normal image file in two ways. First, the filesystem metadata is
44placed in the proper position so that e2fsck, dumpe2fs, debugfs,
45etc. can be run directly on the raw image file. In order to minimize
46the amount of disk space consumed by a raw image file, the file is
47created as a sparse file. (Beware of copying or
48compressing/decompressing this file with utilities that don't understand
49how to create sparse files; the file will become as large as the
50filesystem itself!) Secondly, the raw image file also includes indirect
Theodore Ts'o1c1e0042001-08-09 06:04:32 -040051blocks and data blocks, which the current image file does not have,
Theodore Ts'o6304baf2001-08-09 05:41:29 -040052although this may change in the future.
53.PP
Theodore Ts'o0edb4d82001-05-03 16:30:48 +000054It is a very good idea to periodically (at boot time and
55every week or so) to create image files for all of
56filesystems on a system, as well as saving the partition
57layout (which can be generated using the using
58.B fdisk -l
59command). Ideally the image file should be stored on some filesystem
60other that
61the filesystem whose data it contains, to ensure that its data is
62accessible in the case where the filesystem has been badly damaged.
63.PP
64To save disk space,
65.B e2image
66creates the image file as a sparse file.
67Hence, if the image file
68needs to be copied to another location, it should
69either be compressed first or copied using the
70.B \--sparse=always
71option to GNU version of
72.BR cp .
73.PP
74The size of an ext2 image file depends primarily on the size of the
75filesystems and how many inodes are in use. For a typical 10 gigabyte
76filesystem, with 200,000 inodes in use out of 1.2 million inodes, the
77image file be approximately 35 megabytes; a 4 gigabyte filesystem with
7815,000 inodes in use out of 550,000 inodes will result in a 3 megabyte
79image file. Image files tend to be quite
Theodore Ts'o6304baf2001-08-09 05:41:29 -040080compressible; an image file taking up 32 megabytes of space on
Theodore Ts'o0edb4d82001-05-03 16:30:48 +000081disk will generally compress down to 3 or 4 megabytes.
Theodore Ts'o348e43d2001-05-03 14:43:43 +000082.PP
83.SH AUTHOR
Theodore Ts'o0edb4d82001-05-03 16:30:48 +000084.B e2image
Theodore Ts'o348e43d2001-05-03 14:43:43 +000085was written by Theodore Ts'o (tytso@mit.edu).
86.SH AVAILABILITY
87.B e2image
88is part of the e2fsprogs package and is available from anonymous
89http://e2fsprogs.sourceforge.net.
90.SH SEE ALSO
91.BR dumpe2fs (8),
92.BR debugfs (8)
93