Linux file system support

Source: Internet
Author: User
One of the most important features of Linux's file system support for Linux is its support for many different file systems, such as ext, ext2, and vfat, this makes it flexible and can coexist well with many other operating systems. Linux adds the new file system to the file system by installing a file system... one of the most important features of Linux's file system support for Linux is its support for many different file systems, such as ext, ext2, and vfat, this makes it flexible and can coexist well with many other operating systems. Linux adds the new file system to its file system tree by installing a file system. All file systems, no matter what type, are installed in a directory in the file system tree, and files on the file system will mask the original content in the installation directory. A real file system is logically separated from the operating system and system service through an interface layer called Virtual File System (VFS. The second extended file system (EXT2) EXT2 on www.2cto.com describes each file through the inode data structure. The topology of the file system is defined. An inode describes the data blocks in a file, the file correction time, the access right, and the file type. In the EXT2 file system, each file is described by an inode and each inode has a unique digital identifier. Inodes of the file system are put together in an inode table. The EXT2 directory is a special file (also described by inodes) that contains pointers. inodes of each file or subdirectory pointing to the directory entry can describe special device files. These are not real files, but the handles that the program can use to access the device. VFS allows Linux to support many different file systems. Each file system submits the same software interface to VFS. All the details of the Linux file system are explained by the software, so that all and different file systems are identical to the Linux kernel for programs running on the system. The implementation of Linux virtual file system should make the access to files as fast and efficient as possible. Data in files and files must be properly maintained. All Linux file systems in www.2cto.com Buffer Cache use the same Buffer Cache mechanism to Buffer data from the underlying layer. This mechanism accelerates the access of file systems to physical data storage devices. This buffer cache is independent of the file system and is integrated into the Linux core mechanism to allocate and read/write buffers. The biggest advantage of this mechanism is that it makes the Linux file system independent of the underlying physical media and the device driver. All block devices at www.2cto.com are linear combinations of data blocks of the same size. To accelerate the access of physical block devices, Linux maintains the cache of a block buffer. All the block buffers in the system are stored in every place in the buffer cache, including the latest and unused buffers. This cache is shared by all the physical Block devices in the system. at any time, there are many Block buffers in the cache ), they may belong to any block device in the system and the data is in different states. If valid data can be obtained from the buffer cache, this will save the system time to access the physical device. Any block buffer used to read or write data from block devices enters the buffer cache (BufferCache ). Over time, it may be removed from the cache to think of a Buffer that is more suitable. of course, if it (a Block Buffer) is frequently accessed, it can be left in the cache. Linux currently supports the following types: clean idle: New buffer, locked: waiting to be written, dirty buffer: these new and valid data will be written but not scheduled to be written to the disk so far. share: shared buffer, unshared: it used to be a shared Buffer, but currently it is not www.2cto.com. whenever a file system needs to read a Buffer from its underlying physical device, it tries to Buffer the Buffer from the Buffer cache). If it cannot get a buffer from the buffer cache, then it will get a clean new buffer from the idle linked list of an appropriate size. This buffer will be placed in the buffer cache. If it requires a buffer in the buffer cache, it may already contain the latest data. If it is not the latest, or if it is just a new block buffer, the file system must request the device driver to read the appropriate data block from the disk. Like all caches, the cache must be efficiently maintained so that it is valid and the cache entry is allocated fairly to block devices. Www.2cto.com/proc file system indeed shows the power of the Linux virtual file system. It does not actually exist. /Proc directory, its subdirectory and its file do not actually exist. The/proc file system registers itself in a virtual file system just like a real file system. However, when the file or directory under it is open, when VFS calls it to request inodes, the/proc file system uses the information in the kernel to create those files and directories. Device files Linux treat hardware devices as special files like all Unix versions. For example,/dev/null is a null device. A device file does not occupy any data space of the file system. it is only an access point for the device driver. The system has two types of special device files: Characters and block device files. Inside the core itself, the device driver implements the semantics of the file: you can open them, close them, and so on. Character devices allow all I/O operations in character mode. Block devices require I/O operations to pass through the Buffer Cache mode. When an I/O request for device files arrives, the request is submitted to the corresponding device driver. This is often not a real device driver of the system, but a pseudo device driver for some subsystems.
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.