Linux Kernel (iii) file system

Source: Internet
Author: User

1. Why a root file system is required

(1) Application of the Init process on the root file system
(2) Root file system provides root directory/
(3) Application layer configuration (ETC directory) on the root file system after kernel boot. Can almost be thought of: release version = Kernel +rootfs
(4) Shell command program on the root file system. such as LS, CD and other commands
Summary: A Linux system, only the kernel itself is not able to work, must be rootfs (on the ETC directory under the configuration file,/bin/sbin and other directories under the shell command, as well as the/lib directory of the library files, etc. ... ) to work together.

The following is the top-level directory of the root file system

What is the essence of the root file system?

(1) The root file system is a special-purpose file system.
(2) The root file system must also belong to a file system format. Rootfstype=
(3) What is the file system for? Znfat
First, the storage device (block device, like hard disk, flash, etc.) is a block (sector), the physical bottom of the access to the storage device is based on the block number (sector code) to access. That's a lot of trouble.
Secondly, the file system is some code, is a set of software, the function of the software is to manage the sector of the storage device, the access to these sectors into the directory and file name Access . When we access a file in the upper layer according to a specific directory and file name, the file system converts the directory + file name to access to the sector code.
Finally, the difference between the different file systems is the different management strategies and methods for these sectors, such as bad block management, fragmentation management.

2, the form of the root file system

2.1 Image File Form

(1) An image file that can be burned by using the special tool software
(2) All files in the root file system are included in the image
(3) Burning this image is similar to formatting the corresponding partition.
(4) The image file system has a certain format, the format is internal, and the filename suffix is irrelevant.

2.2 Folder Form

(1) The root filesystem is actually a folder that contains specific content.
(2) The root file system can be made up of any empty folder by adding the necessary files
(3) The prototype of the root file system is the form of folders constructed in the development host

Summarize

(1) The main purpose of the root file system in the image file is to burn to the block device, and the kernel on the device is booted to mount it. The root file system in the form of a mirrored file is made from a folder-like root file system using a dedicated image authoring tool.
(2) Initially in the development of the host mkdir create an empty folder, and then add some necessary files (including the ETC directory under the runtime configuration file,/bin and other directories under the executable program,/lib directory of the library files, etc... ) forms a rootfs in the form of a folder. The rootfs of this folder can then be mounted remotely using NFS kernel, but cannot be used to burn block devices. In order to burn this rootfs into a block device, we used some special software tools to make it into a certain format root file system image that can be burned.
(3) Folder form of Rootfs is no format, made into a mirror after a certain rootfs format, the format is determined by our image production process and production tools. Each format has a different usage of the mirror authoring tool

The purpose of the VFS (virtual file system) is to use standard UNIX system calls to read and write different file systems on different physical media, which provides a unified interface and application programming interface for various file systems. VFS is an adhesive layer that allows system calls such as open (), read (), write () to work without caring for the underlying storage media and file system types.

The NFS (Network File system), which is one of the file systems supported by FreeBSD, allows computers in the network to share resources across TCP/IP networks. In an NFS application, a local NFS client application can transparently read and write to files located on the remote NFS server, just as you would access a local file.

Reprint: https://www.cnblogs.com/PengfeiSong/p/6442986.html

74075143

Linux Kernel (iii) file system

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.