06 September, 2014

How to recover from a bad superblock



Her is some suggestions.... to that ...
$ sudo e2fsck -f /dev/sdb1
e2fsck 1.41.4 (27-Jan-2009)
e2fsck: Attempt to read block from filesystem resulted in short read while trying to open /dev/sdb1
Could this be a zero-length partition?

$ sudo dumpe2fs -f /dev/sdb1 | grep -i superblock
dumpe2fs 1.41.4 (27-Jan-2009)
dumpe2fs: Attempt to read block from filesystem resulted in short read while trying to open /dev/sdb1
Couldn't find valid filesystem superblock.

$ sudo mke2fs -n /dev/sdb1
mke2fs 1.41.4 (27-Jan-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
10010624 inodes, 40019915 blocks
2000995 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
1222 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
________________________________________________________________________________________________
! remember “-y” so you do not need type yes for every block recover !
$ sudo e2fsck -f -b 32768 -y /dev/sdb1
e2fsck 1.41.4 (27-Jan-2009)
Superblock has an invalid journal (inode 8).
Clear? yes

*** ext3 journal has been deleted - filesystem is now ext2 only ***

Pass 1: Checking inodes, blocks, and sizes
Journal inode is not in use, but contains data. Clear? no

Error reading block 5668 (Attempt to read block from filesystem resulted in short read) while reading indirect blocks of inode 8. Ignore error? yes

Force rewrite? yes

Inode 8, i_blocks is 65616, should be 57424. Fix? yes

Error reading block 1343501 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? yes

Force rewrite? yes

Error reading block 1343502 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error? no

Error while scanning inodes (671744): Can't read next inode
Recreate journal? yes

Creating journal (32768 blocks): Error : File exists
while trying to create journal
e2fsck: aborted

No comments: