1, Linux file system overview
The file space that users can see in Linux is a single tree structure, the root of the tree is at the top, called root directory (ROOT), represented by "/". Various directories and files in the file space are branching down the roots.
For users, the directory tree is like a seamless whole, and the user can see is a close-up directory and file. In fact, many directorys in the file tree are placed in different partitions of different disks or even different computers. When one of the disk partitions is called "mount" to the file tree, it is an integral part of the directory tree.
When Windows 98's C: disk (which itself is a FAT32 file system) is not installed, / MNT / Winc is an ordinary subdirectory in the root file system (format may be Linux ext2 / 3), and any data can be stored. The data on the FAT32 format is independent of the Linux system, which cannot be read by the Linux system. After installing (MOUNT), / MNT / WinC / will become a mount point, all of which will be masked by the FAT32 file system, and users can only see data stored in the FAT32 file system, only the file system can be uninstalled After that, the original data in / MNT / WINC will appear and will not be lost.
Linux is a technique that is equipped with different file systems, realizing the seamless connection between file systems, providing great convenience for the user's operation, users don't have to consider the disc drive What is it?
2, Linux file system composition
The Linux operating system consists of some directories and files. These catalogs may be different file systems depending on the installation. Typically, a system can have multiple file systems: root partition file system (/), and file system installed under / usr, and other installed in / home, / var file system. The root file system must be Linux ext2 / 3. By the way, the easiest Linux operating system partition is / and swap partitions (SWAP).
The root directory contains the contents of the root directory, but also provides an installation point for other file systems.
The Ø / dev directory contains all device files, which are set, generally and system hardware have special files with each other, divided into fast equipment, character devices, and special devices, generally do not change and delete casually.
Ø / bin directory contains executable called binary files
Ø / sbin directory and / bin directory Similar to the directory, these documents are often used to manage system management, usually only ROOTs have permission to run
Ø / ETC directory Linux system's vast majority configuration files are placed here, these files are the needs of the system more in line with the user.
Ø / Proc Directory This is actually a virtual file system that enables the system to start from the memory and is used for memory read data.
Ø / TMP directory is used to store various temporary files, which are mostly generated by the program, and they generally delete them at the end of the program.
Ø / Home directory stores a general user's personal directory
Ø / var Directory Save the size and content changed to change, usually various system log files are here
Ø / lib directory storage system's various library files, library files are used when compiling.
Ø / MNT directory provides mounting points for other file systems
Ø / boot directory storage system startup
Ø / root directory superuser personal directory, ordinary users do not have permission access
Ø / LOST FOUND directory: Place some junk files Ø / usr directory The general user program installation is located, enables the largest and most important directory in the system.
3, file system management
Linux file system management The uppermost module is the file system. When the system is started, the "root" file system must be loaded first, and then establish a file system one by one according to / etc / fstab. In addition, users can also install and uninstall file systems via Mount, Umount operations.
When a file system is loaded, the system should first register to the system and its type. When an file system is uninstalled, the system and type should be canceled to the core. The registration and logout of the file system is reflected in the one-way lin list of VFSMount as the chain end with VFSMNLIST as the chain end, in the one-way lin list of VFSMount as a node. Each VFSMount from the linked list can find information about a registered file system. The registration and logout of the file system type is reflected in the one-way lin list of file_system_type as the node in file_system_type. Each File_System-Type node in the linked list describes a registered file system type.
4, virtual file system (VFS)
VFS is an interface layer between physical file systems and services, and he abstains all details of each Linux file system, making different file systems in Linux cores and other processes running in the system, are the same.
Strictly speaking, VFS is not a practical file system. He only exists in memory, and does not exist in any deposit space. VFS is built in system startup, dying when the system is turned off
VFS features
Ø Record the type of file system available
Ø Link the device with the corresponding file system
Ø Handle some universal operation for files
Ø When the operation of the file system is involved, VFS maps them to physical file systems associated with control files, directories, and inode.
5, installation and uninstall file system
To install a file system in the Linux directory tree, you must have a hard disk partition, disc or floppy disk to be installed, and the directory of the file system installation point must be actually existing.
Manually install the file system. The command is mount [options]
The common options for MOUNT are:
1, -r Install the file system in a read-only mode.
2, -w Install the file system when the reader is read.
3, -V Verbose mode, Mount will give many information to report its working status
4. All file systems listed in -A installation / etc / fstab file
5, the -o list_of_options list, and the options are separated by commas.
6, -t file_type Specifies the file system type to be installed.
The most basic command of the direct loading file system is mount -t
The command to uninstall the file system is Umount, from four basic command formats
Umount
Umount
Umount -a
Umount -t fs_type