Mount the hard drive "CentOS"

Source: Internet
Author: User

As we said before, the mount point is the directory, and this directory is the entry into the disk partition. But before you can mount it, you'd better make a few things right:

A single file system should not be repeatedly mounted in different mount points (directories);

A single directory should repeatedly mount multiple file systems;

To be a directory of mount points, it should theoretically be an empty directory.

Especially at the top of the two o'clock, if you want to mount the directory is not empty, then mount the file system, the original directory of things will disappear temporarily. For example, suppose your/home is in the same filesystem as the root directory (/), with the/home/test and/home/heetian two directories underneath. Then you add a new hard drive and mount it directly under/home, then when you're done, the/home directory displays the data for the newly mounted partition. As for the original test and Heetian the two directories will be temporarily hidden. Watch out! is not covered. It is temporarily hidden, and when the new partition is unloaded, the things under/home will return to normal.

How to implement automatic Mount file system on boot

Think about the file system that we mounted, after the system restarts.

Let's test it out:

650) this.width=650; "Src=" http://erange.heetian.com/server/files/upload/guidebook/image/ C1283788-77e0-4d6b-82bf-0a9b309a0f38.jpg "style=" height:124px;border:0px none;vertical-align:top;width:554px; alt= "C1283788-77e0-4d6b-82bf-0a9b309a0f38.jpg"/>

We reboot: Direct knock reboot, enter, after 1 minutes or so with Putty link Linux.

After restarting, let's see if SDB4 is still there.

650) this.width=650; "Src=" http://erange.heetian.com/server/files/upload/guidebook/image/ 97fb7c44-46f9-4156-8a0f-92939b362eca.jpg "style=" height:140px;border:0px none;vertical-align:top;width:554px; alt= "97fb7c44-46f9-4156-8a0f-92939b362eca.jpg"/>

Hey? Can't see the SDB4, do I reboot the system will be manually mounted again? How about getting the file system to mount automatically? Then you need to write the configuration file. The path to the configuration file is/etc/fstab.

Let's use the cat command to see what's inside.

650) this.width=650; "Src=" http://erange.heetian.com/server/files/upload/guidebook/image/ 18ef0945-f6ce-47ca-b2a9-6870356cf62b.jpg "style=" height:174px;border:0px none;vertical-align:top;width:554px; alt= "18ef0945-f6ce-47ca-b2a9-6870356cf62b.jpg"/>

Is there a total of 6 columns, and what are each of those columns? It's just a couple of these.

650) this.width=650; "Src=" http://erange.heetian.com/server/files/upload/guidebook/image/ 03fa2389-9d33-4d19-b6b7-20943b681ac5.png "style=" height:28px;border:0px none;vertical-align:top;width:440px; "Alt = "03fa2389-9d33-4d19-b6b7-20943b681ac5.png"/>

Fs_spec: Defines the device or remote file system on which the file system you want to load is located

Fs_file: This field describes the directory point that you want the file system to mount

Fs_type: File system type: ext2

Fs_options: Specifies that the file system on which the device is mounted is a specific parameter option that needs to be used, and that multiple parameters are separated by commas

Fs_dump: is a backup instruction that does not need to be 0 and needs to be backed up to 1 after this instruction.

Fs_pass: If the boot is disk check, 0 is not the checksum, 1 is the checksum. usually/set to 1.

That set boot automatically mount/DEV/SDB4 how to write it?

Open with Vim/etc/fstab (vim will be explained in the following course)

Press "I" key, press up or down on the keyboard, move the cursor to the last, then enter

650) this.width=650; "Src=" http://erange.heetian.com/server/files/upload/guidebook/image/ 78659519-9fb9-49ff-9240-8da3885189c6.jpg "style=" height:184px;border:0px none;vertical-align:top;width:554px; alt= "78659519-9fb9-49ff-9240-8da3885189c6.jpg"/>

Add one line:/DEV/SDB4/MNT/SDB4 ext2 defaults 0 0

650) this.width=650; "Src=" http://erange.heetian.com/server/files/upload/guidebook/image/ 58c37091-8c4d-4af4-a4ee-41f25c1de83c.jpg "style=" height:198px;border:0px none;vertical-align:top;width:554px; alt= "58c37091-8c4d-4af4-a4ee-41f25c1de83c.jpg"/>

Then press the ESC key in the upper-left corner of the keyboard. Then type ": X" and enter it to save the

650) this.width=650; "Src=" http://erange.heetian.com/server/files/upload/guidebook/image/ 5d41c346-6cbe-4cf4-b2d0-de2bad17d901.jpg "style=" height:344px;border:0px none;vertical-align:top;width:554px; alt= "5d41c346-6cbe-4cf4-b2d0-de2bad17d901.jpg"/>

The modified/etc/fstab is this:

650) this.width=650; "Src=" http://erange.heetian.com/server/files/upload/guidebook/image/ Eb3e39a0-9d25-4676-bedb-d21680809dcd.jpg "style=" height:212px;border:0px none;vertical-align:top;width:553px; alt= "Eb3e39a0-9d25-4676-bedb-d21680809dcd.jpg"/>

Shall we try again reboot?

650) this.width=650; "Src=" http://erange.heetian.com/server/files/upload/guidebook/image/ 5ee5bd52-0a51-4560-b7b1-669be0a32fe4.png "style=" height:156px;border:0px none;vertical-align:top;width:503px; alt= "5ee5bd52-0a51-4560-b7b1-669be0a32fe4.png"/>

650) this.width=650; "Src=" http://erange.heetian.com/server/files/upload/guidebook/image/ 474b87af-e531-47ae-90aa-4771cd12df67.jpg "style=" height:239px;border:0px none;vertical-align:top;width:554px; alt= "474b87af-e531-47ae-90aa-4771cd12df67.jpg"/>

Look, it was automatically mounted. Mom no longer have to worry about me rebooting the system, can't mount the file system!!

How to mount an ISO image file

Many times we need to use ISO image, so how to use ISO image?

In our system because there is no ISO image file, we first build one. Do not understand the meaning of the command:

We use Mkisofs to make a iso9660 image file:

Mkisofs-o heetian.iso/tmp

650) this.width=650; "Src=" http://erange.heetian.com/server/files/upload/guidebook/image/ Bc75a32c-452a-4044-a909-d2c604ea349e.jpg "style=" height:189px;border:0px none;vertical-align:top;width:554px; alt= "Bc75a32c-452a-4044-a909-d2c604ea349e.jpg"/>

The ISO file is ready, let's mount it using it: we mount to/media/iso below how:

Mount-o loop-t iso9660./heetian.iso/media/iso/

650) this.width=650; "Src=" http://erange.heetian.com/server/files/upload/guidebook/image/ Aed84eb2-5ca8-4ba4-a62b-86f261023873.jpg "style=" height:136px;border:0px none;vertical-align:top;width:553px; alt= "Aed84eb2-5ca8-4ba4-a62b-86f261023873.jpg"/>

This command means to mount the "cyclotron device" and the ISO image –t is designated as the ISO9660 disc format


This article is from the "Sky Blue Star" blog, please be sure to keep this source http://jingkonglanxing.blog.51cto.com/1152128/1630604

Mount the hard drive "CentOS"

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.