Linux Mount hardware devices

Source: Internet
Author: User

The Mount command mounts the file system in the format: Mount file system mount directory.

Mounting is the last step in the use of a hardware device, where the hardware device is associated with a directory using the Mount command, and then the data in the hardware device can be seen in this directory. For newer Linux systems, it is generally not necessary to use the-t parameter to specify the description file system type, which is automatically judged by the Linux system. and the mount-a command parameter is very strong, after the execution will automatically check the/etc/fstab file has no omissions in the mounted device files, and then automatic mount operation.

Parameters Role
-A Mount all file systems defined in/etc/fstab
-T Specify the type of file system


For example, you need to mount the device "/DEV/SDB2" to the "/backup" directory, and the file format is EXT4. The mount command only needs to fill in the device and mount directory parameters on the line, the general system will automatically determine the type of file to mount ~ So only need to do this:

Execute command: Mount/dev/sdb2/backup

Although the file system can be used immediately after the Mount command is executed according to the above method, the mount will fail after reboot, that is, it must be manually mounted after each boot, which is definitely not the solution we want, so if you want to have hardware devices and directories permanently connected automatically, The mount information must be written to the/etc/fstab file in the specified format. This file contains a number of information items that are required for mounting, and can be permanently serviced once it is configured.

fill in the following format:"device file mount directory format type permission option self-Test priority"
device files: typically the device's path + device name, or the UUID value can be written. mount Directory: Specify the directory you want to mount to, and create it before you mount it. format type: Specifies the format of the file system, such as ext3/ext4/xfs/swap/iso9660 (this is a CD-ROM device) and so on. permission options: default is defaults (Rw,suid,dev,exec,auto,nouser,async), you can specify ACLs or quota, and so on. self-Test: If 1 is turned on after the disk self-test, 0 is not self-test. Priority: if "Self Test" is 1, you can set priority on multiple hard drives.

Then want to let the file system "EXT4" Hardware Device "/DEV/SDB2" automatically mount to the "/backup" directory, the default permissions and no post, you need to write the following information in the/etc/fstab file, restart after the check will be successful

/dev/sdb2/backup EXT4 Defaults 0 0

The Umount command is used to revoke a mounted device file in the format: "Umount [mount point/Device file]".

To mount a file system to use hardware resources, uninstalling the file system means that the hardware's device resources are no longer used, and the mounted operation is the associated action of the hardware device with the directory, so the unload operation only needs to describe one of the device files or mount directories that you want to disassociate, and you generally do not need to add any additional parameters. For example, try to manually uninstall the "/DEV/SDB2" This device file:

# UMOUNT/DEV/SDB2

Linux Mount hardware devices

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.