Defined in the superblock

Superblock, the heart of the file system.
  If the inode block is the core of the Unix operating system files, then the super block is the heart of the file system. After starting the Unix operating system, the file system can not find a use, it is likely that there is a problem superblock. Why is this such a great superblock role? Mainly because of the global file information stored in the superblock, such as hard disk space, data blocks of free space, inode node information and so on. Make a vivid metaphor, this is like the super block is the company's balance sheet, a file system in which resources are recorded in this table.
  When the operating system is started, the contents of the kernel will superblock copy into memory, and periodically utilize the latest memory contents to update the contents of the super block on the hard disk. Since this update there is a time difference, for superblock superblock information and information-memory hard drive often only in the boot and shutdown of a specific moment are synchronized; at other times are not synchronized. Assume that when the accident when the operating system crashes or accidents because of power outages caused by the super-block information in memory is not saved to the hard disk in a timely manner, then the integrity of the file system would be destroyed. Light result in a loss just created, while it will lead to a file system to a standstill. When this happens, the system engineers often need to use the sync command system provides the moment of failure of the system to copy the contents of memory to disk. This process is often done automatically operating system, which is important because of a reason why the Unix operating system than Windows operating system stable. When the operating system to restart the process, the system kernel will compare the two, based on the difference between them, to the file system marked with a clean or dirty label. This information is stored in the superblock of the file system.
  If the superblock visible damage occurs, it is devastating for very large file systems. Light then lead to a file system can not be mounted, while in the case leading to the collapse of the entire operating system. In the Unix operating system, in addition to using the sync command to ensure that the content on the hard disk will never be outside than the memory content updates, also it provides a very favorable measures to ensure the security of the same. In fact, this technology very early, just beginning and not used in the management of the super block. The technology is similar with the disk array. A plurality of operating system will save the contents of superblock to different areas of the hard disk. When a problem occurs wherein a superblock, the operating system automatically uses another superblock. Wait until the system is operating normally, the system will put the content available to replace the superblock superblock that failure. For this purpose unless all superblocks are corrupt, otherwise, as long as there is a super block is available, then the file system and the operating system can properly mount and start. This security has greatly improved the security of the superblock, the system stability of the Unix operating system. Now most of the Unix operating system (including the Linux operating system) have implemented similar security mechanisms.

Guess you like

Origin www.cnblogs.com/betterquan/p/11369364.html