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