In a Linux system, mount refers to a device (typically a storage device) that is attached to an existing directory. To access the files in the storage device, we must attach the partition where the file resides to an existing directory and access the storage device by accessing the directory. For example, access to the CD, u disk, disk partitions need to be mounted to the normal access and use of the way.
Before you mount it, you need to determine:
A single file system should not be repeatedly mounted on a different mount point
A single directory should not repeatedly mount multiple file systems
A directory that is a mount point should theoretically be an empty directory.
Mount command
Mount can load the specified file system from the specified device into the Linux directory. You can write frequently used devices to file/etc/fastab so that the system automatically loads every time you start. The Mount loading device information is logged in the/etc/mtab file. When you uninstall a device by using the Umount command, the record is cleared.
Command format:
mount [Options] [device file name] [Mount Point]
Command function:
Load the specified file system
Command parameters:
None: Displays devices that are currently mounted on the current system when no parameters are added
-A: Mount all the devices that are not mounted according to the data from the configuration file/etc/fstab
-L: Display device's volume label
-T: Add the type of file system to specify the types to mount such as Ext2, ext3, VFAT, etc.
-N: By default, the actual mount is written to/etc/mtab to facilitate the operation of other programs. If you use the-n parameter, mount information is not written to it.
-O: Additional parameters can be attached after mounting
RO,RW: Mount file system becomes (RO) or writable (rw)
Loop: Mount the local loopback device and attach a file to the system as a device
Remount: Re-mount
Common examples:
Example one: Mount the/DEV/SDC1 to the/mnt/test directory
[[email protected] ~]# mount/dev/sdc1/mnt/test/[[email protected] ~]# cd/mnt/test/[[email protected] test]# Lslost+foun D
Example two: Mount the/tmp/image.iso iso file to the/media directory
[Email protected] test]# Mount-o loop/tmp/image.iso/mnt/
So that we can view the contents without having to burn the ISO into a CD.
Umount command
Command format:
umount [parameter] device file name or mount point
Command function:
Uninstalling the device files
Command parameters:
-F: Forced uninstallation
-N: Uninstall without updating/etc/mtab
Common examples
Uninstalling the/mnt/test partition
[Email protected] test]# umount/mnt/test/
Sometimes prompt when uninstalling a file
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/45/3A/wKiom1Pki3yThzO5AAB4iR8CQls759.jpg "title=" Busy " alt= "Wkiom1pki3ythzo5aab4ir8cqls759.jpg"/>
When this happens, make sure that all of your data has been processed and stored properly to execute the following command
[Email protected] test]# Umount/mnt/test/umount:/mnt/test:device is busyumount:/mnt/test:device is Busy[[email prote CTED] test]# fuser-km/mnt/test #终止正在使用该文件的进程/mnt/test:5434c
After completion, use the Umout command again to uninstall
Setting up the Boot mount
Manual processing mount is not very user-friendly, we always need to let the system "automatically" when the boot is mounted, and now to end how to put it automatically mounted after the boot.
We can automatically mount the boot by editing the/etc/fstab file.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/45/3B/wKioL1Pkj8eBG_2aAAD6pJ7wMmU838.jpg "title=" Fstab " alt= "Wkiol1pkj8ebg_2aaad6pj7wmmu838.jpg"/>
First column: Disk device file name or label for the device
Second column: mount point, which is the directory
Column three: File system for disk partitioning
Fourth column: File system parameters, equivalent to the-o option of the Mount command, you can specify whether read-only mount or read-write mount and some other mount parameters
The fifth column: whether the dump command, dump is a command to be used as a backup, 0 means not to do the backup, 1 means a daily dump backup, usually this value is not 0 is 1
The sixth column: whether to test the partition with fsck, 0 means no check, 1 for the earliest check, 2 is also the check, but 1 will be more early check, usually the root directory is set to 1, the other to verify the file system is set to 2.
This article is from the "Small Monk" blog, be sure to keep this source http://xseng.blog.51cto.com/2513398/1537520