const char *lib_ver_date;
int my_ver, lib_ver;
e2fsck_t ctx;
- blk64_t orig_superblock;
+ blk64_t orig_superblock = ~(blk64_t)0;
struct problem_context pctx;
int flags, run_result, was_changed;
int journal_size;
"check of the device.\n"));
#endif
else {
+ /*
+ * Let's try once more will less consistency checking
+ * so that we are able to recover from more errors
+ * (e.g. some tool messing up some value in the sb).
+ */
+ if (!(flags & EXT2_FLAG_IGNORE_SB_ERRORS)) {
+ if (fs)
+ ext2fs_close_free(&fs);
+ log_out(ctx, _("%s: Trying to load superblock "
+ "despite errors...\n"),
+ ctx->program_name);
+ flags |= EXT2_FLAG_IGNORE_SB_ERRORS;
+ /*
+ * If we tried backup sb, revert to the
+ * original one now.
+ */
+ if (orig_superblock != ~(blk64_t)0)
+ ctx->superblock = orig_superblock;
+ goto restart;
+ }
fix_problem(ctx, PR_0_SB_CORRUPT, &pctx);
if (retval == EXT2_ET_BAD_MAGIC)
check_plausibility(ctx->filesystem_name,
#define EXT2_FLAG_DIRECT_IO 0x80000
#define EXT2_FLAG_SKIP_MMP 0x100000
#define EXT2_FLAG_IGNORE_CSUM_ERRORS 0x200000
+#define EXT2_FLAG_IGNORE_SB_ERRORS 0x400000
/*
* Special flag in the ext2 inode i_flag field that means that this is
ext2fs_open2: The ext2 superblock is corrupt
../e2fsck/e2fsck: Superblock invalid, trying backup blocks...
../e2fsck/e2fsck: The ext2 superblock is corrupt while trying to open test.img
+../e2fsck/e2fsck: Trying to load superblock despite errors...
+ext2fs_open2: The ext2 superblock is corrupt
+../e2fsck/e2fsck: Superblock invalid, trying backup blocks...
+../e2fsck/e2fsck: The ext2 superblock is corrupt while trying to open test.img
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
ext2fs_open2: Bad magic number in super-block
../e2fsck/e2fsck: Superblock invalid, trying backup blocks...
../e2fsck/e2fsck: Bad magic number in super-block while trying to open test.img
+../e2fsck/e2fsck: Trying to load superblock despite errors...
+ext2fs_open2: Bad magic number in super-block
+../e2fsck/e2fsck: Superblock invalid, trying backup blocks...
+../e2fsck/e2fsck: Bad magic number in super-block while trying to open test.img
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
*** e2fsck
ext2fs_open2: Bad magic number in super-block
../e2fsck/e2fsck: Superblock invalid, trying backup blocks...
+ext2fs_open2: Bad magic number in super-block
+../e2fsck/e2fsck: Superblock invalid, trying backup blocks...
../e2fsck/e2fsck: Bad magic number in super-block while trying to open test.img
The superblock could not be read or does not describe a valid ext2/ext3/ext4
e2fsck external journal
../e2fsck/e2fsck: Filesystem has unsupported feature(s) while trying to open test.img
+../e2fsck/e2fsck: Trying to load superblock despite errors...
+../e2fsck/e2fsck: Filesystem has unsupported feature(s) while trying to open test.img
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4