Linux file system mounting

Source: Internet
Author: User
Today I learned about Linux mounting. This part is very simple. it involves two commands: mount and umount. First, let's talk about Mount. I will not talk about it in writing. you can use Baidu on your own. Simply put, in Linux, if we add a hard disk or partition, we cannot open it directly as in windows, but use an existing directory, by attaching the new hard disk or partition & ldquo; Mount & rdquo; to this directory, access our

Today I learned about Linux mounting. This part is very simple. it involves two commands: mount and umount.

First, let's talk about Mount. I will not talk about it in writing. you can use Baidu on your own. Simply put, in Linux, if we add a hard disk or partition, we cannot open it directly as in windows, but use an existing directory, by attaching the new hard disk or partition to this directory, you can access our new hard disk through this directory.

For example, we have a new hard disk. after it is inserted into the computer, we cannot see this hard disk when starting the system. we need to create a directory under the hard disk that we can see now, for example, if the path is yingpan and the path is/yingpan, after attaching the hard disk to the/yingpan Directory, the operation in the/yingpan directory is equivalent to the operation on the second hard disk.

1,

The mount command is

Usage: mount the partition mount point to be mounted.

For example, to mount the third partition of the first hard disk to our/mnt directory, you can write: mount/dev/sda3/mnt

There are several parameters:-t specifies the file system, and the above command can also be written as: mount-t ext4/dev/sda3/mnt

-O specified option: ro, read-only mounting

Rw, read/write mounting

Sync, do not use cache

Async, with cache mounting

Noatime: the access time is not updated during file access.

Atime: Update the access time when accessing files.

Remount, remount

Multiple parameters are separated by commas (,). For example

Mount-t ext4-o ro, sync, atime/dev/sda3/mnt

 

2,

After mounting, it is uninstalled. the unmounting is simple. This function is equivalent to the windows pop-up function.

Umount mount point or a specific partition

For example, the umount/dev/sda3 or umount/mnt commands have the same effect.

Sometimes the error "device is busy" may occur because a process is accessing the directory we want to uninstall. We can use the fuser-m mount point to check which processes are in use, or use the lsof mount point to check which file is in use.

3,

After mounting, we will find that the partition we just mounted has no more at next boot. at this time, we need to set automatic mounting to solve this problem.

Find the/etc/fstab file and use vi to edit it.

Add in the last line

File system mounting options dump and fsck (0 by default)

For example, you can add the following content:

/Dev/sda3/mnt ext4 defaults 0 0

At the next boot, we will find that our partitions will be automatically mounted.

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.