Mount command and/etc/fstab file details

Source: Internet
Author: User

Mount: Mount

Uninstall: Umount

Auto Mount Profile:/etc/fstab


One, manual mount equipment

Mount Mount Command

Format:

mount [Options] [-t fstype] [-o-option] device mount point

Common options [Options]:

Common options:
-T Fstype (ext2, ext3, Ext4, XFS, iso9660, SMB, etc.)
-R: Read-only Mount
-W: Read and Write
-L lable: specified as volume label, lable= "label"
-U UUID: Mount device specified with UUID, uuid= "UUID"
-A: Automatically mount all (in/etc/fstab files) devices that support automatic mounting

--bind Dir1 Dir2 has been mounted on the file, you can again bind other directories to use

-N: Do not update the/etc/mtab file

-O Options
Async: Asynchronous I/O
Sync: synchronous I/O
Noatime/atime: Recommended Noatime
Auto/noauto: Can be automatically mounted by the MOUNT-A option;
Diratime/nodiratime: Whether to update the access timestamp of the directory;
Exec/noexec: Whether the binary program is allowed to execute;
_netdev: Network Equipment
Remount: Re-mount
ACL: Enable Facl

# Tune2fs-o Mount-option Equipment
# tune2fs-o ^mount-option Cancel

Example:

(1), mount, default does not specify the option will automatically append the following properties

Defaults (rw, suid, dev, exec, auto, nouser, async, and Relatime.)

[Email protected] ~]# MOUNT/DEV/SDA5/MNT/SDA5

(2), view mount status

[email protected] ~]# Mount | grep "Sda5"/dev/sda5 on/mnt/sda5 type EXT4 (rw)


Ii. viewing the process that occupies a mounted device

Fuser-v mount point
fuser-km mount point


When uninstalling a file system, the following information appears, indicating that someone is using the device.

[Email protected] ~]# Umount/dev/sda5umount:/mnt/sda5:device is busy. (In some cases useful info about processes, use the device are found by lsof (8) or fuser (1))

View First

[Email protected] ~]# fuser-c/mnt/sda5/mnt/sda5:13796c[[email protected] ~]# fuser-c/MNT/SDA5/FIND//MNT/SD a5/find/: 13796c

Kill the user who is using the file system before uninstalling

[Email protected] ~]# fuser-km/mnt/sda5/mnt/sda5:13796c


Third, uninstall

# Umount Mount Device | Holding point



Iv. Mounting configuration file/etc/fstab

[[email protected] ~]# cat /etc/fstab## /etc/fstab# created by  Anaconda on fri jul 31 23:50:21 2015## 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#/dev/mapper/vg_ system-root /                        ext4    defaults         1 1UUID=3a9c20f4-0cc2-4563-9e2c-d4833c1463c2 /boot                    ext4     defaults        1 2/dev/mapper/vg_system-var / var                    ext4     defaults        1 2/dev/mapper/vg_system-swap  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 document is divided into six paragraphs with the following meanings:

Device mount point file System type Mount options dump frequency self-test order

(1) device to be mounted:

Device files, label=, uuid=
(2) Mount point:

Swap has no mount point, the mount point is swap
(3) File system type

Ext2, Ext3, Ext4, XFS, NFS, SMB, ISO9660, etc.
(4) Mount option: Use commas to separate multiple options;

Async, Sync, _netdev

Defaults (rw, suid, dev, exec, auto, nouser, async, and Relatime.)
(5) Dump frequency:
0: Never Back up
1: Daily backup
2: Backup every other day
(6) Self-Test order:
0: No self-test
1: First self-test, usually can only be/used;
2: After the completion of the self-test with the number 1, the self-test


Note: The file will not take effect immediately after it is configured, you can restart the operating system or use MOUNT-A to make the file effective immediately.











This article is from "Rookie Diary" blog, please make sure to keep this source http://zkxfoo.blog.51cto.com/1605971/1758529

Mount command and/etc/fstab file details

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.