Take a look at some of this information and learn some of the basics of Linux file systems. Mainly include: Linux disk partition and directory, the basic principle of mount, file storage structure, soft connection hard link and so on.
1. Linux Disk partitions and directories
There is little difference between Linux distributions, and the directory structure is basically the same. The Windows file system structure is tied to multiple tree structures, and the top of the tree is a different disk partition. and the Linux file system structure is a single tree-like structure. Under Ubuntu, you can view the tree structure by command.
The relationship between Linux disk partitions and directories is as follows:
-Any partition must be mounted on a directory for read and write operations
-The directory is a logical distinction. Partitioning is a physical distinction
-The root directory is where all Linux files and directories are located and requires a disk partition to mount
Some common commands:
-fdisk view hard disk partition table
-DF Viewing partition usage
-du Viewing file Usage
Ps: Why partition? Separate data management to reduce risk; Large disk search efficiency is low; defragmentation.
2, the concept of Mount
Mount: When using a device, these devices must be mapped to a directory, which becomes a "mount point" for read and write operations. Mounting blocks the details of the physical partition, and the user has only a unified logic concept.
In a Linux system, using/etc/fstab to mount partitions, the Linux kernel automatically mounts the file system with reference to this file.
3. File type
-Normal file
-Catalog File
-Link File
-Special Documents
4. File storage structure
A file includes:
-Directory entry: File name +inode node number
-INode: File index node, store file basic information, storage location, data block pointer storage location
Specifically including Inumber+file Type+owner id+link count+ ... Does not contain a file name
-Data block: File specific content
When viewing a file, the file attributes and location are found in the Inode table before the data is read.
Linux file system