In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
How does the system mount the hard drive when booting up? How does the system know which partitions need to be mounted? Linux determines this information through the configuration file / etc/fstab, which is readable to all users, but only root users have the right to modify the file.
Next, let's take a look at what is written in this file.
The columns of the fstab table shown above in turn mean the following:
1. The UUID (referring to the device name) of each file system used to mount.
What is UUID? UUID (Universally Unique Identifier), the universal unique identifier, is a 128-bit number. This identifier is used to uniquely identify "one thing" on the Internet and is widely used because of its uniqueness. UUID is automatically generated and managed by the system.
2. Mount point. That is, the file system is mounted under the mount point directory.
3. File system type. That is, the file system type of the device. For common file system types, please refer to the previous blog "disk Management under linux".
4. Various mount options or parameters. Some commonly used mount parameters are introduced here.
Commonly used mount device parameters:
Auto: automatically mount when powered on.
Default,noauto: does not mount automatically when powered on.
Nouser: only root can be mounted.
Ro: read-only mount.
Rw: readable and writeable mount.
User: any user can mount it.
5. Backup frequency. Backup frequency refers to the backup number of the file system. There are 10 levels of dump (incremental backup), ranging from 0 to 9. A level 0 dump backup is a full backup, that is, everything on the file system is backed up, including those that are not normally seen (such as partition tables). Levels 1 through 9 then make incremental backups of files that have been modified since the last backup based on the level of the last backup.
6. The check order of the file system during the restart process. Check in ascending order starting at 0. File systems at the same level are checked at the same time.
After introducing what each column means, let's analyze the configuration file shown in the picture.
# the starting lines are all comment lines.
A line analysis that does not begin with # from the first line:
The above note says that the root directory is installed on sda1, the first primary partition of the first hard drive, during installation. If you do not understand the representation of hard disk partitions under linux, you can refer to the previous article, "disk Management under linux".
UUID refers to the mounted device, and here is sda1, the first partition of the first hard disk. The mount point is the root directory. The file system type is ext4. The mount parameter is-ro, which means mount read-only. If the backup frequency is 0, it is a full backup. The boot check sequence is 1.
And so on, the comment states that this is a swap partition (see the previous blog for swapping partitions) and is installed in sda5, the first logical partition of the first hard drive. The device mount point is none, that is, there is no mount point. If you understand the function of swap partition, you will understand why there is no mount point. The file system type is swap. Full backup. Check it first when you turn it on.
The following / dev/fd0 devices are mounted under, / media/floppy0, and the file system type is auto and set to auto. The mount command guesses the file system type to be used, which is very useful for mobile devices such as CDROM and DVD. Rw: readable and writable mount, user: any user can mount this device, noauto: boot does not mount automatically. The exec parameter allows anyone to run programs on the device.
The / etc/fstab configuration file records the file systems that need to be mounted during boot. If necessary, you can configure the files of the devices that need to be mounted at boot time, which can be configured according to the above reference.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.