I understand that superblocks provide high-level meta data about file systems in Linux, but how many of these structures exist for a given file system? My intuition tells me there's either one per file system, or one per file.
Asked
Active
Viewed 2,755 times
2 Answers
4
Superblock is per filesystem, not per file. There might be multiple redundant copies of superblock in a single filesystem, but primary superblock will be referred every time. Redundant copies will be used in case of corruption of primary superblock only.

pratik
- 434
- 2
- 8
-
I know each file struct indirectly references a superblock through their associated dentry struct. However, it wasn't clear to me if all files belonging to the same file system reference the same superblock. From your response, it sounds like they do(?) – jdmartin86 Nov 26 '13 at 23:24
1
I recently learned that there is more than one copy of the superblock within each file system. In ext2, for example, every block group has its own superblock with identical content to the other block groups. This redundancy provides reliability in the event of a crash. So in this system, there are as many superblocks as block groups.

jdmartin86
- 299
- 2
- 16
-
1Yes, but mostly only master superblock is referenced. Other superblocks are referenced only in case of crash. – pratik Nov 29 '13 at 08:53
-
1Well, the master superblock belongs to one of the block groups. Whenever that becomes corrupted, it is replaced with the next block group's superblock. – jdmartin86 Nov 29 '13 at 13:44