In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces you what is the Linux / etc/fstab file, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Many people often modify the / etc/fstab file, but many of them are not very clear about the meaning of this file, because as long as you follow a certain pattern, you can easily add a line of mount information without fully understanding how it works.
/ etc/fstab is a file used to store static information about the file system. Located in the / etc/ directory, you can view it with the command less / etc/fstab, and if you want to modify it, modify it with the command vi / etc/fstab.
When the system starts, the system automatically reads information from this file and automatically mounts the file system specified in this file to the specified directory. Now I will introduce how to fill in the information under this document.
Under this file, we should focus on its six fields, namely:,. The detailed meaning of these six domains is described in detail below.
1 、 . This is used to specify the device name or block information of the file system you want to mount, or it can be a remote file system. Friends who have done embedded linux development probably know the meaning of the mount 192.168.1.56:/home/nfs / mnt/nfs/-o nolock (which can be other IP) commands. Its task is to mount the / home/nfs/ directory on the remote host with IP 192.168.1.56 to the local / mnt/nfs / directory. If you want to write it into the / etc/fstab file, the file system section should be filled in as: / 192.168.1.56:/home/nfs/.
If you want to mount a device (device) on your computer, write it like / dev/sda1, / dev/hda2 or / dev/cdrom, where / dev/sda1 represents the first partition of the first serial hard disk, or it can be the first partition of the first SCSI hard disk, / dev/hda1 represents the first partition of the first IDE hard disk, and / dev/cdrom represents the optical drive.
In addition, it can be represented by label (volume label) or UUID (Universally Unique Identifier globally unique identifier). Before using label, ask e2label to create a volume label, such as e2label / dir_1 / dir_2, which means / dir_2 is used to represent the name of / dir_1. Then, under / etc/fstab, add it as follows: LABEL=/dir_2 / dir_2. After reboot, the system will mount / dir_1 to the / dir_2 directory. For UUID, you can get it with blkid-o value-s UUID / dev/sdxx. For example, if I want to mount the eleventh partition of the first hard disk, I first use the command blkid-o value-s UUID / dev/sda11 to get UUID, such as: 5dc08a62-3472-471b-9ef5-0a91e5e2c126, and then fill in the field: UUID=5dc08a62-3472-471b-9ef5-0a91e5e2c126 to represent / dev/sda11. Red Hat linux generally uses label, while Ubuntu linux generally uses UUID.
2 、 . Mount point, that is, find or create a dir (directory), and then mount the file system to this directory, and then you can access the file system to be mounted from this directory. For swap partitions, this field should be filled in: none, which means there is no mount point.
3 、 . This is used to specify the type of file system. The following file systems are currently supported by Linux: adfs, befs, cifs, ext3, ext2, ext, iso9660, kafs, minix, msdos, vfat, umsdos, proc, reiserfs, swap, squashfs, nfs, hpfs, ncpfs, ntfs, affs, ufs.
4 、 . This is used to fill in the setting options, which are separated by commas. Because there are so many options, and the space here is limited, I won't go into more detail. If you need to know, please check it with the command man mount. But there is a very important keyword to know here: defaults, which stands for including the options rw,suid,dev,exec,auto,nouser and async.
5 、 . If it is 1 here, it means to back up the contents of the whole file; if it is 0, it means it is not backed up. The tool dump is rarely used now, and it is generally chosen to be 0 here.
6 、 . This is used to specify how to use fsck to check the hard drive. If you fill in 0 here, it will not be checked; if the mount point is / (that is, the root partition), you must enter 1 here, and nothing else can be filled in 1. If there is a partition that is greater than 1, after checking the root partition, then check the number from small to large. Check the same number at the same time. For example, if the first and second partitions fill in 2, and the third and fourth partitions fill in 3, the system checks the root partition, then checks the first and second partitions at the same time, and then checks the third and fourth partitions at the same time.
About Linux / etc/fstab file is what is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.