Concepts related to Linux File System Learning (I)

Source: Internet
Author: User

References:
LinuxKernel design and implementation
Http://www.ibm.com/developerworks/cn/linux/l-cn-vfs/
Http://www.ibm.com/developerworks/cn/linux/l-linux-filesystem/
Http://www.ibm.com/developerworks/cn/linux/l-cn-read/index.html
 

1. Important Concepts

"Everything is a file" is one of the basic philosophies of Unix/Linux. Not only common files, directories, character devices, Block devices, sockets, etc. are treated as files in Unix/Linux. Although they are of different types, however, it provides the same operation interface. In addition, a block device is a storage device that supports random access. It corresponds to a character device that only supports sequential access. In addition, Linux distinguishes the file-related information from the two concepts of the file itself, which need to be stored on disks. The former is often referred to as an inode node, and the latter is the actual file content, however, you must use the former method to find the disk location where the file is actually stored and the operation method.
 

VFS allows you to operate any file in Linux by calling the same file I/O system without considering the specific file system format. Further, file operations can be performed across file systems. For example, we can use the CP command to copy data from the hard disk in the vfat file system format to the hard disk in the ext3 file system format. Such an operation involves two different file systems. Different file system blocks may have different sizes (defined in Super blocks). Generally, most file systems use B. VFS is an abstract software layer in a Linux File System. Because of its support, many different actual file systems can coexist in Linux, and cross-file system operations can be implemented. VFS uses its four main data structures: super block, index node, directory item, file object, and some auxiliary data structures, provides the same operation interface to Linux Files, directories, devices, sockets, and so on, such as opening, reading, writing, and closing. Only when control is passed to the actual file system will the actual file system be differentiated to perform different operations on different file types. It can be seen that, with the existence of VFS, cross-file system operations can be performed, and "Everything is a file" in Unix/Linux can be implemented.

Figure VFS synergy with other kernel modules in the kernel

Three file system operations:

Registration: Report to the kernel and declare that it can be supported by the kernel. It is generally registered when the kernel is compiled; it can also be manually registered by Loading modules. The registration process actually instantiates the data structure struct file_system_type of each actual file system.
 

Create: The process of formatting a disk in a certain way is the process of establishing a file system on it. When a file system is created, control information about the file system is written to the disk at a specific location, that is, the super block is written to the disk.
 

Installation: we are familiar with the Mount operation. we can add the file system to the directory tree structure of the Linux root file system so that the file system can be accessed and searched through the directory.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.