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