File System Management

Source: Internet
Author: User

[TOC]
------
# mount
> An association between an additional file system and an existing directory of the root file system, which makes this directory a gateway for other file access is called mount

# # # Mount Method Mount
"' Mount DEVICE mount_pointMount: Displays all devices that are currently mounted on the system by viewing the/etc/mtab fileMount [-FNRSVW] [-t vfstype] [-O options] Device dirDevice: Indicate the equipment to be mounted;(1) device files: e.g./dev/sda5(2) Label:-L ' LABEL ', e.g.-l ' MYDATA '(3) UUID,-u ' uuid ': for example-U ' 0c50523c-43f1-45e7-85c0-a126711d406e '(4) Pseudo file system name: Proc, SYSFS, Devtmpfs, ConfigfsDir: Mount pointPre-existing; Recommended use of empty directories;The device that the process is in use cannot be uninstalled;
Common Command options:-T Vsftype: Specifies the file system type on the device to be mounted, which can be called without specifying the BLKID call-r:readonly, read-only mount;-w:read and write, read-write Mount;-N: Do not update/etc/mtab; file mount, uninstall the file is updated by default. The Mount command, which invokes the file display. However, the kernel can view the mount through/proc/mounts. So the mount display is not necessarily the most accurate.-A: Automatically mounts all devices that support automatic mounts, (defined in the/etc/fstab file, and the Mount option has "Auto mount" function)-L ' LABEL ': Specifies the mounting device by volume label;-U ' UUID ': Specifies the device to be mounted with the UUID;-B,--bind: Bind directory to another directory;
Note: View all mounted devices tracked by the kernel: cat/proc/mounts
-O Options: (option to mount the file system) is preceded by a command option followed by an attribute option that is enabled or disabled by the file system.Async: Asynchronous mode;Sync: synchronous mode;Atime/noatime: A timestamp containing directories and filesDiratime/nodiratime: Access timestamp for directoryAuto/noauto: Whether auto mount is supportedExec/noexec: Whether to support running applications on the file system as a processDev/nodev: Whether to support the use of device files on this file system;Suid/nosuid:Remount: Re-mount, Mount-o Remount,ro/mydata, re-mount, set to RORO: Read-onlyRW: Read and WriteUser/nouser: Whether to allow normal users to mount this deviceACL: Enable the ACL feature on this file system (Access control list, centos6 default off, centos default on)
Note: The above options can be used in multiple simultaneous use, separated from each other by commas;Default mount options: DefaultsRW, suid, dev, exec, auto, Nouser, and Async "
------
# Uninstall
> The process of releasing this association is called unloading
# # # Uninstall Command umount
"' Unload command:# Umount DEVICE# Umount Mount_point
To view the process that is accessing the specified file system:# fuser-v Mount_point
[Email protected] ~]# mount/dev/sdb9/tmp[[email protected] ~]# Umount/tmpumount:/tmp:device is busy. (In some cases useful info about processes, use the device are found by lsof (8) or fuser (1)) [[email protected] ~]# FUSER-V/tmp USER PID ACCESS command/tmp:root 579 7.. C.. bash
Terminates all processes that are accessing the specified file system:# fuser-km Mount_pointAdministrators have this permission
[Email protected] ~]# fuser-km/tmp/tmp:5797c[[email protected] ~]# umount/tmp
```------
# Mount Swap Partition
# # Swapon/swapoff
```Enabled: SwaponSwapon [OPTION] ... [DEVICE]-A: Activates all swap partitions;-P Priority: Specify the precedence;#如果有性能好的, set to high priority. or on different disks, load balancing, improve performance. The same disk is pseudo-balancedDisabled: Swapoff [OPTION] ... [DEVICE]Use free to view the space. Do not use it formally as much as necessary. ```
-----# Mount profile > File mount profile:/etc/fstab> each row defines a file system to mount, a file system other than the root, and a secondary system. The device or pseudo file system to mountMount pointFile system typeMount OptionsDump frequencySelf-Test order
Device or pseudo-file system to mount:Device file, LABEL (label= "), UUID (uuid=" "), pseudo file system name (proc, SYSFS)
Mount Options:Defaults
Dump frequency: (rarely used, with other tools, or scheduled Tasks)0: Do not make a backup1: Daily dumps2: Dump every other day
Self-Test order:0: No self-test1: First self-test, usually only rootfs 1;...Additional mounted data is not recommended for self-test and may be damaged. No dumps, either.
"> Add a record to the Fstab file to automatically mount the boot.
"[[email protected] ~]# Cat/etc/fstab
# #/etc/fstab# Created by Anaconda on Wed the 10:02:32 2016## Accessible filesystems, by reference, is maintained Unde R '/dev/disk ' # See mans Pages Fstab (5), Findfs (8), mount (8) and/or Blkid (8) for more info#uuid=a8c981b4-f953-430e-b4b4-769f 98f89f40/                      EXT4    defaults        1 1uuid=76ed89c0-305c-45e9-aec2-7734ed87b1e3/boot               &N Bsp   EXT4    defaults        1 2UUID=348EFD32-74C9-444E-892B-B65DC0758EFC swap   &NB Sp                swap    defaults        0 0tmpfs &nbs P                /DEV/SHM                TM PFS   Defaults        0 0devpts                  /DE V/pts               devpts  gid=5,mode=620  0 0sysfs         &NB Sp        /sys                    SYSFS   Default S        0 0proc                    /proc   &NB Sp               proc    defaults        0 0#/DEV/SDB1/mydataExt4Defaults0 0#/DEV/SDB6SwapSwapDefaults0 0#/DEV/SDB2/mysdb2Ext4Defaults0 0
```



From for notes (Wiz)

File System Management

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.