Difference between revisions of "Bad Superblock"
From Noah.org
Jump to navigationJump to search (New page: Category:Engineering The `e2fsck` command will not repair a partition if the primary superblock at block 0 is corrupt. Luckily, ext2 and ext3 maintain backups of the superblock throug...) |
m |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category:Engineering]] | [[Category:Engineering]] | ||
− | + | [[Category:Drives_and_Filesystems]] | |
The `e2fsck` command will not repair a partition if the primary superblock at block 0 is corrupt. Luckily, ext2 and ext3 maintain backups of the superblock throughout the disk. Unfortunately, `e2fsck` will not locate and use a backup superblock for you. You have to locate and specify the location of a backup superblock manually. I'm not sure why `e2fsck` doesn't have an option to do this for you. If you specify a valid backup superblock for `e2fsck` to use then it will also fix the primary superblock at block 0. | The `e2fsck` command will not repair a partition if the primary superblock at block 0 is corrupt. Luckily, ext2 and ext3 maintain backups of the superblock throughout the disk. Unfortunately, `e2fsck` will not locate and use a backup superblock for you. You have to locate and specify the location of a backup superblock manually. I'm not sure why `e2fsck` doesn't have an option to do this for you. If you specify a valid backup superblock for `e2fsck` to use then it will also fix the primary superblock at block 0. | ||
Latest revision as of 08:14, 4 August 2010
The `e2fsck` command will not repair a partition if the primary superblock at block 0 is corrupt. Luckily, ext2 and ext3 maintain backups of the superblock throughout the disk. Unfortunately, `e2fsck` will not locate and use a backup superblock for you. You have to locate and specify the location of a backup superblock manually. I'm not sure why `e2fsck` doesn't have an option to do this for you. If you specify a valid backup superblock for `e2fsck` to use then it will also fix the primary superblock at block 0.
Locate backup superblocks:
dumpe2fs /dev/sdb1 | grep -i superblock
Or use `mke2fs`:
mke2fs -n /dev/sdb1
You should get a list like this (much longer in the real world):
Primary superblock at 0, Group descriptors at 1-10 Backup superblock at 32768, Group descriptors at 32769-32778 Backup superblock at 98304, Group descriptors at 98305-98314
Now you can tell `e2fsk` where to find a backup superblock:
e2fsck -f -b 32768 /dev/sdb1