4

After a crash, I've got an Ext4 filesystem (on an LVM LV) that gives the following error when running fsck.ext4 -nf:

e2fsck 1.42.12 (29-Aug-2014)
Corruption found in superblock.  (blocks_count = 0).

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
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

I've run dumpe2fs to find the other copies of the superblock, but no matter which of them I add after fsck.ext4s -b option, I get the exact same output.

Moreover, dumpe2fs sees the correct block count (Block count: 4294967296, a 16TB filesystem). Here's the (truncated) output:

Filesystem volume name:   <none>
Last mounted on:          /storage
Filesystem UUID:          fef00ffc-5341-4158-9279-88cad6cc211f
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              268435456
Block count:              4294967296
Reserved block count:     42949672
Free blocks:              534754162
Free inodes:              268391425
First block:              0
Block size:               4096
Fragment size:            4096
Group descriptor size:    64
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         2048
Inode blocks per group:   128
Flex block group size:    16
Filesystem created:       Wed Jan 16 11:07:07 2013
Last mount time:          Sun Feb  1 21:21:31 2015
Last write time:          Sun Feb  1 21:21:45 2015
Mount count:              18
Maximum mount count:      -1
Last checked:             Wed Jan 16 11:07:07 2013
Check interval:           0 (<none>)
Lifetime writes:          14 TB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      c7ec9ee0-002b-431d-a37c-33db922c6057
Journal backup:           inode blocks
Journal features:         journal_incompat_revoke journal_64bit
Journal size:             128M
Journal length:           32768
Journal sequence:         0x0000e3fe
Journal start:            0

Group 0: (Blocks 0-32767) [ITABLE_ZEROED]
  Checksum 0x4623, unused inodes 2034
  Primary superblock at 0, Group descriptors at 1-2048
  Block bitmap at 2049 (+2049), Inode bitmap at 2065 (+2065)
  Inode table at 2081-2208 (+2081)
  28637 free blocks, 2036 free inodes, 1 directories, 2034 unused inodes
  Free blocks: 4130-4133, 4135-32767
  Free inodes: 11, 14-2048
Group 1: (Blocks 32768-65535) [INODE_UNINIT, ITABLE_ZEROED]
  Checksum 0xfd95, unused inodes 2048
  Backup superblock at 32768, Group descriptors at 32769-34816
  Block bitmap at 2050 (bg #0 + 2050), Inode bitmap at 2066 (bg #0 + 2066)
  Inode table at 2209-2336 (bg #0 + 2209)
  1522 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes
  Free blocks: 34817, 35343-36863
  Free inodes: 2049-4096
Group 2: (Blocks 65536-98303) [INODE_UNINIT, ITABLE_ZEROED]
  Checksum 0x95d0, unused inodes 2048
  Block bitmap at 2051 (bg #0 + 2051), Inode bitmap at 2067 (bg #0 + 2067)
  Inode table at 2337-2464 (bg #0 + 2337)
  115 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes
  Free blocks: 85901-86015
  Free inodes: 4097-6144
Group 3: (Blocks 98304-131071) [INODE_UNINIT, ITABLE_ZEROED]
  Checksum 0x6e40, unused inodes 2048
  Backup superblock at 98304, Group descriptors at 98305-100352
  Block bitmap at 2052 (bg #0 + 2052), Inode bitmap at 2068 (bg #0 + 2068)
  Inode table at 2465-2592 (bg #0 + 2465)
  1505 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes
  Free blocks: 100895-102399
  Free inodes: 6145-8192
Group 4: (Blocks 131072-163839) [INODE_UNINIT, ITABLE_ZEROED]
  Checksum 0x4788, unused inodes 2048
  Block bitmap at 2053 (bg #0 + 2053), Inode bitmap at 2069 (bg #0 + 2069)
  Inode table at 2593-2720 (bg #0 + 2593)
  1808 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes
  Free blocks: 141552-143359
  Free inodes: 8193-10240
Group 5: (Blocks 163840-196607) [INODE_UNINIT, ITABLE_ZEROED]
  Checksum 0x0d39, unused inodes 2048
  Backup superblock at 163840, Group descriptors at 163841-165888
  Block bitmap at 2054 (bg #0 + 2054), Inode bitmap at 2070 (bg #0 + 2070)
  Inode table at 2721-2848 (bg #0 + 2721)
  2023 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes
  Free blocks: 165913-167935
  Free inodes: 10241-12288
Group 6: (Blocks 196608-229375) [INODE_UNINIT, ITABLE_ZEROED]
  Checksum 0xc119, unused inodes 2048
  Block bitmap at 2055 (bg #0 + 2055), Inode bitmap at 2071 (bg #0 + 2071)
  Inode table at 2849-2976 (bg #0 + 2849)
  1755 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes
  Free blocks: 198541-198655, 223640-225279
  Free inodes: 12289-14336
Group 7: (Blocks 229376-262143) [INODE_UNINIT, ITABLE_ZEROED]
  Checksum 0xf858, unused inodes 2048
  Backup superblock at 229376, Group descriptors at 229377-231424
  Block bitmap at 2056 (bg #0 + 2056), Inode bitmap at 2072 (bg #0 + 2072)
  Inode table at 2977-3104 (bg #0 + 2977)
  1796 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes
  Free blocks: 231676-233471
  Free inodes: 14337-16384
Group 8: (Blocks 262144-294911) [INODE_UNINIT, ITABLE_ZEROED]
  Checksum 0x6a75, unused inodes 2048
  Block bitmap at 2057 (bg #0 + 2057), Inode bitmap at 2073 (bg #0 + 2073)
  Inode table at 3105-3232 (bg #0 + 3105)
  1700 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes
  Free blocks: 278876-280575
  Free inodes: 16385-18432
Group 9: (Blocks 294912-327679) [INODE_UNINIT, ITABLE_ZEROED]
  Checksum 0x3840, unused inodes 2048
  Backup superblock at 294912, Group descriptors at 294913-296960
  Block bitmap at 2058 (bg #0 + 2058), Inode bitmap at 2074 (bg #0 + 2074)
  Inode table at 3233-3360 (bg #0 + 3233)
  1986 free blocks, 2048 free inodes, 0 directories, 2048 unused inodes
  Free blocks: 297022-299007
  Free inodes: 18433-20480

... truncated ...

The strange thing is that I can mount the filesystem without any (apparent) problems (although I haven't yet dared to write to it).

Any suggestions/pointers/ideas for a solution that allows me to finish the fsck?

2 Answers 2

6

Your device has exactly 4294967296 blocks, which is 232, so this smells like a variable-size problem... If you’re running a 32-bit e2fsck, that could explain the error message; the error you’re seeing comes from e2fsck/super.c:

check_super_value(ctx, "blocks_count", ext2fs_blocks_count(sb),
                  MIN_CHECK, 1, 0);

where check_super_value() is defined as

static void check_super_value(e2fsck_t ctx, const char *descr,
                              unsigned long value, int flags,
                              unsigned long min_val, unsigned long max_val)

So on a 32-bit system where unsigned long is four bytes, your blocks_count will end up being 0 and fail the minimum-value check, without it indicating an actual problem with the filesystem.

The reason you’d only see this after a crash is that fsck is only run after a crash or if the filesystem hasn’t been checked for too long.

The answer to your question would then be, if you are running a 32-bit e2fsck, to try a 64-bit version...

2
  • Thanks for the suggestion. I'll have a look once I'm back at the machine. I know the kernel is 64 bit, but not sure about the tools (I'm booting from a SysRescCD USB stick).
    – ph0t0nix
    Feb 2, 2015 at 10:45
  • Indeed, the 32 bit e2fsck binary was the problem. Using a 64 bit one worked flawlessly and the filesystem turned out to be clean. Thanks!
    – ph0t0nix
    Feb 2, 2015 at 14:07
0

I had this problem trying to create a new volume on a brand new 3TB drive. Answer is to create 2 partitions which builds a good superblock then resize the get a single partition of max size. Ray

1
  • If the OP has a partition with a filesystem (which, apparently, contains data, but, apparently, is corrupt), how does he fix that filesystem by creating two partitions? Jan 16, 2016 at 5:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .