Linux/etc directory under Fstab and mTAB

Source: Internet
Author: User

The role of the Etc/fstab file

The information about the hard disk partition on the computer is recorded, and when Linux is started, the fsck command to check the partition and Mount command to mount the partition require the information in the fstab to properly check and mount the hard disk.

The role of the/etc/mtab file:

First look at it in English is:
This changes continuously as the file/proc/mount changes. In other words, when filesystems was mounted and unmounted, the change was immediately reflected in this file.
The file system that is now loaded by the system, including the virtual files created by the operating system, is recorded, and the/etc/fstab is ready for loading.
Whenever mount Mount partition, Umount unload partition, will dynamically update mtab,mtab always maintain the current system mounted partition information, FDISK, DF Such programs, must read the mTAB file, in order to obtain the current system in the partition mount situation. Of course, we can also get the current mount information by reading/proc/mount.

detailed/etc/fstab file

The data items that are/etc/fstab in Linux are as follows:
Device name mount point partition type Mount option dump option fsck option
label=//ext3 Defaults 1 1
TMPFS/DEV/SHM TMPFS Defaults 0 0
Devpts/dev/pts devpts gid=5,mode=620 0 0
Sysfs/sys Sysfs Defaults 0 0
PROC/PROC proc Defaults 0 0
1, the device name item, can be the actual device name/DEV/SDA1, can also be the actual device label such as lable=/, we can know LABEL=/1 is/dev/sda1 label; What command do we use to set the label for the actual device, For the ext3 and ext2 file systems, we can use the E2label to set the E2label device [Newlabel], for example, we want to put the file system ext3 partition/dev/hda1 the label device is/1, we should execute the following command: [ Root@localhost beinan]# E2LABEL/DEV/HDA1/1
2, Mount point, there is nothing to say,/,/usr, swap are the system installation of the default mount point of the partition. Here's how:
[Email protected]] # MKDIR/MNT/HDA1 Note: Create a directory to mount the/DEV/HDA1 partition;
[Root@localhost beinan]# chmod 777/mnt/hda1 Note: Open permissions, all users can read and write executable, after the execution of the above two steps can be/etc/fstab to use this mount point
3. File System type:
Linux file Systems:ext2, ext3, JFS, ReiserFS, Reiser4, XFS, swap.
Windows:
VFAT = fat, Fat 16
ntfs= NTFS
Note:for NTFS RW ntfs-3g
cd/dvd/iso:iso9660
Network File Systems:
Nfs:server:/shared_directory/mnt/nfs NFS <options> 0 0
SMB://win_box/shared_folder/mnt/samba smbfs rw,credentials=/home/user_name/winbox-credentials.txt 0 0
Auto:the file system type (ext3, iso9660, etc) it detected automatically. Usually works. Used for removable devices
(CD/DVD, floppy drives, or Usb/flash drives) as the file system may vary on thesedevices.
4, Mount options, the following list of several commonly used:
Auto: The system mounts automatically, Fstab is this option by default
DEFAULTS:RW, suid, Dev, exec, auto, Nouser, and async.
Noauto boot does not mount automatically
Nouser only super users can mount
RO mount by read-only permission
RW mount by Read writable permission
User can mount
Please note that the optical drive and floppy drive can only be mounted when the media is installed, so it is Noauto

5, Dump option, set whether to let the Backup program dump backup file system, 0 is ignored, 1 is a backup, if the last backup with dump, will show the number of days since the backup.

6, fsck option, tell the FSCK program in what order to check the file system, 0 means no check, (/) partition is always 1, the other partition can only start from 2, when the number is the same
Check at the same time (but not 21),
Note: When you have modified the/etc/fstab, you must reboot the system to be effective.

Linux/etc directory under Fstab and mTAB

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.