e2fsck will be enhanced to be able to use the image file to help
recover a badly damaged filesystem.
.PP
+If
+.I image-file
+is -, then the output of
+.B e2image
+will be sent to standard output.
+.PP
The
.B \-r
-option will create a raw image file instead. A raw image file differs
+option will create a raw image file instead of a normal image file.
+A raw image file differs
from a normal image file in two ways. First, the filesystem metadata is
placed in the proper position so that e2fsck, dumpe2fs, debugfs,
etc. can be run directly on the raw image file. In order to minimize
compressing/decompressing this file with utilities that don't understand
how to create sparse files; the file will become as large as the
filesystem itself!) Secondly, the raw image file also includes indirect
-blocks and data blocks, which the current image file does not have ---
+blocks and data blocks, which the current image file does not have,
although this may change in the future.
.PP
It is a very good idea to periodically (at boot time and
continue;
stashed_ino = ino;
- if (LINUX_S_ISDIR(inode.i_mode)) {
+ if (LINUX_S_ISDIR(inode.i_mode) ||
+ ino == fs->super->s_journal_inum) {
retval = ext2fs_block_iterate2(fs, ino, 0,
block_buf, process_dir_block, &pb);
if (retval) {
exit(1);
}
+ if (strcmp(outfn, "-") == 0)
+ fd = 1;
+ else {
#ifdef HAVE_OPEN64
- fd = open64(outfn, O_CREAT|O_TRUNC|O_WRONLY, 0600);
+ fd = open64(outfn, O_CREAT|O_TRUNC|O_WRONLY, 0600);
#else
- fd = open(outfn, O_CREAT|O_TRUNC|O_WRONLY, 0600);
+ fd = open(outfn, O_CREAT|O_TRUNC|O_WRONLY, 0600);
#endif
- if (fd < 0) {
- com_err(program_name, errno, _("while trying to open %s"),
- argv[optind+1]);
- exit(1);
+ if (fd < 0) {
+ com_err(program_name, errno,
+ _("while trying to open %s"), argv[optind+1]);
+ exit(1);
+ }
}
if (raw_flag)
ext2fs_close (fs);
exit (0);
}
-
-