Theodore Ts'o | 348e43d | 2001-05-03 14:43:43 +0000 | [diff] [blame] | 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 |
Theodore Ts'o | a7ac1df | 2003-08-24 17:56:41 -0400 | [diff] [blame] | 7 | e2image \- Save critical ext2/ext3 filesystem data to a file |
Theodore Ts'o | 348e43d | 2001-05-03 14:43:43 +0000 | [diff] [blame] | 8 | .SH SYNOPSIS |
| 9 | .B e2image |
Theodore Ts'o | 6304baf | 2001-08-09 05:41:29 -0400 | [diff] [blame] | 10 | [ |
Theodore Ts'o | 8c6b648 | 2004-07-28 21:07:53 -0400 | [diff] [blame^] | 11 | .B \-rI |
Theodore Ts'o | 6304baf | 2001-08-09 05:41:29 -0400 | [diff] [blame] | 12 | ] |
Theodore Ts'o | 348e43d | 2001-05-03 14:43:43 +0000 | [diff] [blame] | 13 | .I device |
| 14 | .I image-file |
| 15 | .SH DESCRIPTION |
Theodore Ts'o | 0edb4d8 | 2001-05-03 16:30:48 +0000 | [diff] [blame] | 16 | The |
Theodore Ts'o | 348e43d | 2001-05-03 14:43:43 +0000 | [diff] [blame] | 17 | .B e2image |
Theodore Ts'o | 0edb4d8 | 2001-05-03 16:30:48 +0000 | [diff] [blame] | 18 | program will save critical filesystem data on the ext2 filesystem located on |
Theodore Ts'o | 0edb4d8 | 2001-05-03 16:30:48 +0000 | [diff] [blame] | 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 be used by an expert in assisting |
| 29 | the recovery of 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 |
Theodore Ts'o | 1c1e004 | 2001-08-09 06:04:32 -0400 | [diff] [blame] | 33 | If |
| 34 | .I image-file |
| 35 | is -, then the output of |
| 36 | .B e2image |
Theodore Ts'o | 8ac5929 | 2004-03-08 14:18:56 -0500 | [diff] [blame] | 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 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 access to the file, which can not be done using a |
| 45 | pipe. This restriction will hopefully be lifted in a future version of |
| 46 | .BR e2image .) |
Theodore Ts'o | 1c1e004 | 2001-08-09 06:04:32 -0400 | [diff] [blame] | 47 | .PP |
Theodore Ts'o | 6304baf | 2001-08-09 05:41:29 -0400 | [diff] [blame] | 48 | The |
Theodore Ts'o | 8c6b648 | 2004-07-28 21:07:53 -0400 | [diff] [blame^] | 49 | .B \-I |
| 50 | option will cause e2image to install the metadata stored in the image |
| 51 | file to the device. It can be used to restore the filesystem metadata |
| 52 | back to the device in emergency situations. |
| 53 | .PP |
| 54 | .B WARNING!!!! |
| 55 | The |
| 56 | .B \-I |
| 57 | option should only be used as desperation measure when other |
| 58 | alternatives have failed. If the filesystem has changed since the image |
| 59 | file was created, data |
| 60 | .B will |
| 61 | be lost. In general, you should make a full image |
| 62 | backup of the filesystem first, in case you wish to try other recovery |
| 63 | strategies afterwards. |
| 64 | .PP |
| 65 | The |
Theodore Ts'o | 6304baf | 2001-08-09 05:41:29 -0400 | [diff] [blame] | 66 | .B \-r |
Theodore Ts'o | 1c1e004 | 2001-08-09 06:04:32 -0400 | [diff] [blame] | 67 | option will create a raw image file instead of a normal image file. |
| 68 | A raw image file differs |
Theodore Ts'o | 6304baf | 2001-08-09 05:41:29 -0400 | [diff] [blame] | 69 | from a normal image file in two ways. First, the filesystem metadata is |
| 70 | placed in the proper position so that e2fsck, dumpe2fs, debugfs, |
| 71 | etc. can be run directly on the raw image file. In order to minimize |
| 72 | the amount of disk space consumed by a raw image file, the file is |
| 73 | created as a sparse file. (Beware of copying or |
| 74 | compressing/decompressing this file with utilities that don't understand |
| 75 | how to create sparse files; the file will become as large as the |
| 76 | filesystem itself!) Secondly, the raw image file also includes indirect |
Theodore Ts'o | 1c1e004 | 2001-08-09 06:04:32 -0400 | [diff] [blame] | 77 | blocks and data blocks, which the current image file does not have, |
Theodore Ts'o | 6304baf | 2001-08-09 05:41:29 -0400 | [diff] [blame] | 78 | although this may change in the future. |
| 79 | .PP |
Theodore Ts'o | 0edb4d8 | 2001-05-03 16:30:48 +0000 | [diff] [blame] | 80 | It is a very good idea to periodically (at boot time and |
| 81 | every week or so) to create image files for all of |
| 82 | filesystems on a system, as well as saving the partition |
| 83 | layout (which can be generated using the using |
| 84 | .B fdisk -l |
| 85 | command). Ideally the image file should be stored on some filesystem |
| 86 | other that |
| 87 | the filesystem whose data it contains, to ensure that its data is |
| 88 | accessible in the case where the filesystem has been badly damaged. |
| 89 | .PP |
| 90 | To save disk space, |
| 91 | .B e2image |
| 92 | creates the image file as a sparse file. |
| 93 | Hence, if the image file |
| 94 | needs to be copied to another location, it should |
| 95 | either be compressed first or copied using the |
| 96 | .B \--sparse=always |
| 97 | option to GNU version of |
| 98 | .BR cp . |
| 99 | .PP |
| 100 | The size of an ext2 image file depends primarily on the size of the |
| 101 | filesystems and how many inodes are in use. For a typical 10 gigabyte |
| 102 | filesystem, with 200,000 inodes in use out of 1.2 million inodes, the |
| 103 | image file be approximately 35 megabytes; a 4 gigabyte filesystem with |
| 104 | 15,000 inodes in use out of 550,000 inodes will result in a 3 megabyte |
| 105 | image file. Image files tend to be quite |
Theodore Ts'o | 6304baf | 2001-08-09 05:41:29 -0400 | [diff] [blame] | 106 | compressible; an image file taking up 32 megabytes of space on |
Theodore Ts'o | 0edb4d8 | 2001-05-03 16:30:48 +0000 | [diff] [blame] | 107 | disk will generally compress down to 3 or 4 megabytes. |
Theodore Ts'o | 348e43d | 2001-05-03 14:43:43 +0000 | [diff] [blame] | 108 | .PP |
| 109 | .SH AUTHOR |
Theodore Ts'o | 0edb4d8 | 2001-05-03 16:30:48 +0000 | [diff] [blame] | 110 | .B e2image |
Theodore Ts'o | 348e43d | 2001-05-03 14:43:43 +0000 | [diff] [blame] | 111 | was written by Theodore Ts'o (tytso@mit.edu). |
| 112 | .SH AVAILABILITY |
| 113 | .B e2image |
| 114 | is part of the e2fsprogs package and is available from anonymous |
| 115 | http://e2fsprogs.sourceforge.net. |
| 116 | .SH SEE ALSO |
| 117 | .BR dumpe2fs (8), |
| 118 | .BR debugfs (8) |
| 119 | |