+2004-02-24 Theodore Ts'o <tytso@mit.edu>
+
+ * unix.c (main, PRS), e2fsck.8.in: Add a new -k option which keeps
+ the existing badblocks list when using the -c option.
+ (Addresses Debian bug #229103)
+
2004-02-23 Theodore Ts'o <tytso@mit.edu>
* Makefile.in (PROFILED_LIBS, PROFILED_DEPLIBS): Fix reference to
.SH SYNOPSIS
.B e2fsck
[
-.B \-pacnyrdfvstDFSV
+.B \-pacnyrdfkvstDFSV
]
[
.B \-b
@JDEV@Set the pathname where the external-journal for this filesystem can be
@JDEV@found.
.TP
+.BI \-k
+When combined with the
+.B \-c
+option, any existing bad blocks in the bad blocks list are preserved,
+and any new bad blocks found by running
+.BR badblocks (8)
+will be added to the existing bad blocks list.
+.TP
.BI \-l " filename"
Add the block numbers listed in the file specified by
.I filename
static int verbose;
static int replace_bad_blocks;
+static int keep_bad_blocks;
static char *bad_blocks_file;
e2fsck_t e2fsck_global_ctx; /* Try your very best not to use this! */
ctx->program_name = *argv;
else
ctx->program_name = "e2fsck";
- while ((c = getopt (argc, argv, "panyrcC:B:dE:fvtFVM:b:I:j:P:l:L:N:SsD")) != EOF)
+ while ((c = getopt (argc, argv, "panyrcC:B:dE:fvtFVM:b:I:j:P:l:L:N:SsDk")) != EOF)
switch (c) {
case 'C':
ctx->progress = e2fsck_update_progress;
"of e2fsck\n"));
exit(1);
#endif
+ case 'k':
+ keep_bad_blocks++;
default:
usage(ctx);
}
if (bad_blocks_file)
read_bad_blocks_file(ctx, bad_blocks_file, replace_bad_blocks);
else if (cflag)
- read_bad_blocks_file(ctx, 0, 1); /* Test disk */
+ read_bad_blocks_file(ctx, 0, !keep_bad_blocks); /* Test disk */
if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
fatal_error(ctx, 0);
#ifdef ENABLE_SWAPFS