Contents
What is the purpose of superblock in file system?
The superblock essentially records a file system’s characteristics – block size, other block properties, sizes of block groups and location of inode tables. The superblock is especially useful in UNIX and similar operating systems where a root directory contains a variety of subdirectories.
Where is superblock stored?
The superblock is located at the beginning of the disk slice, and is replicated in each cylinder group. Because the superblock contains critical data, multiple superblocks are made when the file system is created. Each superblock replica is offset by a different amount from the beginning of its cylinder group.
What’s the difference between a superblock and an inode?
In simplicity, dentry and inode are the same thing, an abstraction of file or directory. The differences between dentry and inode are that dentry is used to facilitate directory-specific operations, inode is just a collection of metadata about file or directory. Superblock is the abstraction of filesystem.
How are Dentry and superblocks related in a filesystem?
Each dentry maps an inode number to a file name and a parent directory. The superblock is a unique data structure in a filesystem (though multiple copies exist to guard against corruption). The superblock holds metadata about the filesystem, like which inode is the top-level directory and the type of filesystem used.
Where is the superblock located in a file system?
The superblock is the container for high-level metadata about a file system. The superblock is a structure that exists on disk (actually, multiple places on disk for redundancy) and also in memory.
What does superblock stand for in Linux kernel?
Superblock is the abstraction of filesystem. struct file, in linux kernel, is misnamed as lots of others (e.g. struct address_space) and is not an abstraction of a real “file” (e.g. /etc/passwd). It stands for an opened “file” or directory. struct file is created by sys_open in kernel, so a process can have a lot of struct file s for the same file.