0

Background

The first block of an ext4 filesystem is called the superblock - it contains essential metadata. There are backup copies of the superblock scattered throughout the filesystem; they can be used to recover if original superblock gets corrupted. They can be located with dumpe2fs and repairs can be attempted with e2fsck. I've found a lot of info on the normal recovery process itself so this question isn't about that.

Question

What if all the superblock backups get corrupted? Does it make sense to manually create a backup superblock and to store it on a separate drive? How do you go about making such a copy? Or does it not make any sense because in the event of all backups being corrupt the filesystem is so far gone there is no point in trying to repair the superblock?

  • If you really have to (but you don't have to, see answer below), you can make copies with dd if you know the block number. Careful with the parameters, if you don't know what you are doing, or if you mistype, you'll overwrite a good block with random data instead of making a copy of the superblock ... – dirkt Mar 5 '18 at 13:08
2

...in the event of all backups being corrupt the filesystem is so far gone there is no point in trying to repair...

Exactly that, just use normal automatic offsite backups and ignore "superblocks".

  • That makes sense, I do regular backups anyways. But still, even if it's useless, do you know how to make a copy of the superblock? Just as an exercise of idle curiosity. – nagamani Mar 5 '18 at 5:24
  • 1
    @nagamani just dd if=/dev/sda of=/path/to/backup_sda.index seek=$S bs=$L count=1 – user1133275 Mar 6 '18 at 2:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.