I. file structure in order to store and read files on devices, we need to create a file system record directory and file on the partition. We call it a file structure. every file system in Linux is interpreted as a directory structure starting from a root directory. file system mounting
I. File structure
To store and read files on the device, we need to create a file system on the partition.
The file system records directories and files, which are called the file structure.
In Linux, each file system is interpreted as a directory structure starting from a root directory.
Linux mounts various file systems in the system directory tree.
II. File system
There are many file systems in the computer corresponding to different operating systems and devices.
Different file systems store and search for different files.
Linux supports reading and writing multiple file systems
Linux uses the ext2/ext3 file system.
3. ext2/ext3 file system
Ext2/ext3 file system supports rwx permission and file attributes
Ext2/ext3 file systems use block + inode to store files
An ext2/ext3 file system has a space called a superblock used to store metadata of the file system, such as the volume name, number of blocks, and inode.
Inode stores file metadata, including file permissions, attributes, change time, and other data (equivalent to a file or directory pointer)
IV. ReiserFS file system
A very good File system
Allows you to easily manage hundreds of GB of file systems.
Advanced log mechanism
Efficient disk space utilization
Unique Search methods
V. file attributes
In the ext2/3 file, additional attributes are supported for each file.
You can use lsattr to check the file attributes.
System users can use chattr to change file attributes + add-delete
If the I attribute is added, the file cannot be changed, renamed, or deleted.
6. ext3 file system
Ext3 file system is an ext2 with the log function added, which can be seamlessly compatible with ext2 file system
The ext2 file system can be upgraded to the ext3 file system simply by adding logs.
Ext3 file system supports three log modes
Rules (by default, only metadata is recorded)
Log-based (logging data like metadata)
Write back (only occurs in fsck)
VII. Use a file system
To use a file system and read files to it, you must first mount the file system.
The command for mounting a file system is mount.
Syntax: mount-t file system type [other parameters] device mount point
-T: file system type, which is used to specify the type of the mounted file system. it is not required now and can be automatically recognized by the kernel.
-O: add additional parameters.
Ext2 file system default parameters: rw, suid, dev, exec, auto, nouser, asyno
8./etc/fstab
Configure file system mounting information
When the file system is mounted, if the parameters are incomplete, the system will read/etc/fstab to complete the parameters.
The system will automatically load the file system by referring to the configuration items in/etc/fstab.
It is also used by programs such as fsck, dump, quotaon, and swapon.
9. currently mounted file system
You can directly type mount and press enter to check the file system currently mounted.
You can also view the mounted file system by viewing the/etc/mtab file.
Due to time, the last few articles are rough. I hope the readers will forgive me and I will add them later.