Saturday, September 3, 2016

e2fsck: restore a damaged superblock on ext2/3/4 file systems

One very useful feature of e2fsck is its ability to restore a damaged superblock on ext2/3/4 file systems. Remember from earlier in this chapter that the superblock is the block at the beginning of the partition that contains information about the structure of the file system. Also, most Linux file systems keep backup copies of the superblock at various locations in the partition. If the super- block gets corrupted, you can restore it using one of these backup copies. 

The syntax is 

e2fsck –f –b backup_superblock device

The –f option tells e2fsck to force a check, even if the file system seems to be clean. The –b option tells e2fsck which copy of the superblock it should use. 

No comments:

Post a Comment