Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of / etc/fstab File in Linux system

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about the sample analysis of / etc/fstab files in Linux systems. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Preface

[root@localhost ~] # cat / etc/fstab## / etc/fstab# Created by anaconda on Sat Nov 3 12:03:31 2018 December # Accessible filesystems, by reference, are maintained under'/ dev/disk'# See man pages fstab (5), findfs (8) Mount (8) and/or blkid (8) for more info#UUID=64fc4e32-9cc9-4af9-8846-dc13865f770e / ext4 defaults 1 1UUID=14c3958d-b0a9-41bd-a046-06e148013349 / boot ext4 defaults 1 2UUID=15399f4c-8788-4348-b066-34179fe887cb swap swap defaults 0 0tmpfs / dev/shm tmpfs defaults 0 0devpts / dev/pts devpts gid=5,mode=620 0 0sysfs / sys sysfs defaults 0 0proc / proc proc defaults 0 0

The / etc/fstab file under the Linux system contains the file system records that need to be mounted automatically after boot, and this file will be read when the Linux system starts to mount the file system automatically. We can set the file system to boot and mount automatically by modifying this file.

Let's interpret the specific meaning of the contents of this document.

First column: Device: disk device file or Label or UUID of the device

You can use the dumpe2label command to view the device label, UUID. Or use the simple command blkid command to view the UUId

Note: the partition is fixed when using the device name (/ dev/sda) to mount the partition. Once the slot order of the disk changes, there will be a problem of name mismatch. Because the name will change.

However, with label mounting, you don't have to worry about the order of slots. But keep an eye on your Label name. As for UUID, each partition has a UUID as its unique identification number after it is formatted, so you don't have to worry about confusion if you mount it with uuid.

The second column: Mount point: the mount point of the device, which is the directory to which you want to mount it.

Third column: filesystem: the format of the disk file system, including ext2, ext3, reiserfs, nfs, vfat, etc.

The fourth column: parameters: parameters of the file system, generally set to default: defaults

Parameters that can be set under parameters:

Whether Async/sync is set to run in synchronous mode. Default is async.

Auto/noauto whether the file system is actively mounted when downloading the command of mount-a. Default is auto

Whether rw/ro is mounted in read-only or read-write mode

Exec/noexec restricts whether "execute" operations can be performed within this file system

Whether user/nouser allows users to mount using the mount command

Does suid/nosuid allow the existence of SUID?

Usrquota boot file system supports disk quota mode

Grpquota initiates file system support for group disk quota mode

Defaults also has the setting of default parameters such as rw,suid,dev,exec,auto,nouser,async

The fifth column: can be used by the dump backup command: dump is a command used as a backup. Usually the value of this parameter is 0 or 1

0 means no dump backup

1 means to make dump backups every day

2 means to perform dump operations from time to time

Column 6: whether to check the sector: during the boot process, the system defaults to fsck to check whether our system is complete (clean).

0 do not check

1 earliest inspection (general root directory will choose the earliest inspection)

Carry out the inspection after the completion of the level 21 inspection.

This is what all the fields in the / etc/fstab file mean, and when we want to set the file system to boot and mount automatically, we can do this by modifying the file.

In particular, when the / etc/fstab file is modified, the / etc/fstab file must be modified in time when we no longer need to mount the file system and unmount it. Otherwise, the read / etc/fstab mount of the unmounted file system at boot time will cause an error because the file system cannot be found, resulting in a failure to boot properly.

Thank you for reading! On the "Linux system / etc/fstab file example analysis" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report