.IR filespec .
Note this does not adjust the inode reference counts.
.TP
-.BI logdump " [-acs] [-b block] [-i filespec] [-f journal_file] [output_file]"
+.BI logdump " [-acsO] [-b block] [-i filespec] [-f journal_file] [output_file]"
Dump the contents of the ext3 journal. By default, dump the journal inode as
specified in the superblock. However, this can be overridden with the
.I \-i
and
.I \-b
options.
+.IP
+The
+.I \-O
+option causes logdump to display old (checkpointed) journal entries.
+This can be used to try to track down journal problems even after the
+journal has been replayed.
.TP
.BI ls " [-l] [-c] [-d] [-p] filespec"
Print a listing of the files in the directory
#define ANY_BLOCK ((blk64_t) -1)
-static int dump_all, dump_contents, dump_descriptors;
+static int dump_all, dump_old, dump_contents, dump_descriptors;
static blk64_t block_to_dump, bitmap_to_dump, inode_block_to_dump;
static unsigned int group_to_dump, inode_offset_to_dump;
static ext2_ino_t inode_to_dump;
journal_source.fd = 0;
journal_source.file = 0;
dump_all = 0;
+ dump_old = 0;
dump_contents = 0;
dump_descriptors = 1;
block_to_dump = ANY_BLOCK;
inode_to_dump = -1;
reset_getopt();
- while ((c = getopt (argc, argv, "ab:ci:f:s")) != EOF) {
+ while ((c = getopt (argc, argv, "ab:ci:f:Os")) != EOF) {
switch (c) {
case 'a':
dump_all++;
inode_spec = optarg;
dump_descriptors = 0;
break;
+ case 'O':
+ dump_old++;
+ break;
case 's':
use_sb++;
break;
return;
print_usage:
- fprintf(stderr, "%s: Usage: logdump [-acs] [-b<block>] [-i<filespec>]\n\t"
+ fprintf(stderr, "%s: Usage: logdump [-acsO] [-b<block>] [-i<filespec>]\n\t"
"[-f<journal_file>] [output_file]\n", argv[0]);
}
fprintf(out_file, "Journal starts at block %u, transaction %u\n",
blocknr, transaction);
- if (!blocknr)
+ if (!blocknr) {
/* Empty journal, nothing to do. */
- return;
+ if (!dump_old)
+ return;
+ else
+ blocknr = 1;
+ }
while (1) {
retval = read_journal_block(cmdname, source,
fprintf (out_file, "Found sequence %u (not %u) at "
"block %u: end of journal.\n",
sequence, transaction, blocknr);
- return;
+ if (!dump_old)
+ return;
}
if (dump_descriptors) {