Chapter8:linux disk and File System Management (4) Set the boot mount

Source: Internet
Author: User

I. On-load/etc/fstab and/etc/mtab

The previous mount method every time you enter the system will have to mount, if you want to automatically mount when the boot, we should go to the/etc/fstab inside to modify.

Let's look at the contents of this file first.

First column: The device file name or the label of the device

The default is to use label (contrast), here to illustrate, using the device name (such as/DEV/SDA1) to mount the partition is fixed dead, so the hard disk can not be inserted, and use labe name to mount, although there is no problem above, but you have to pay attention to the name of the label, Especially when new drives are added.

Second column: mount point

Third column: Partition file system type

We can let the system automatically detect the file system type when we mount it manually, but if you modify the file, write it manually.

Fourth column: File system parameters

General use of defaults can be, more detailed content can be seen online.

Fifth column: Can be dump backup

Dump is a backup command, and we can specify that file system to be dump backed up by the Fstab file.

0: Do not do dum backup. 1: Daily Dump Backup, 2: the date of the backup.

Column sixth: Whether and fsck test sectors

The following is an example of setting the SDA1 boot mount to C_pan. Let's use DF to make sure that the sda1 is not mounted. At the same time, let's delete the sda1 first.

Note that the SDA1 type here is Fuseblk, which is ntfs-3g. So we need to install ntfs-3g supported software first.

Yum Install ntfs-3g

Modify the/ect/fstab file as follows

Let's test again to see if the change was successful. With Mount-a, you can mount it according to a disk that is not mounted in profile/etc/fstab.

You can see that the changes have been successful. This will automatically mount the file each time you boot.

/etc/fstab is the configuration file at boot time, the actual file system mount is recorded in/etc/mtab and/proc/mounts.

If we modify the failure, resulting in the inability to boot successfully, then can enter the single-user mode, because the root directory at this time in readonly mode, so we can not modify the/etc/fstab, but also cannot modify the other, then we may use

Mount-n-o remount, RW/

Repair.

Two. loop mount for special files (image files are not burned and mounted for use)

1. Mount the disc/dvd image file

We don't have to burn this file as a disc to use it, we can also mount it through a loop device.

Let's mount the Centos.iso file.

You can see that this file is very large. (ll--h equivalent to LS-HL)

Remember to umount off when you finish the test.

2. Create a large file to make a loop device file.

Some are similar to the above, we can make a large file, and then format the file and then mount it. It can make us feel more like a partition. Let's Test it.

(1) Create a large file

We use the command DD (convert and copy a file) to create an empty file.

The/dev/zero above is a device that outputs 0 of the time. You can see that we have created a 512M file with a total of 0 of the 1M size. The records are all 0.

(2) formatting

(3) Mounting

Special parameters for using mount-O loop

This makes it feel like creating a new partition without the original partition being launched, which is useful when you want to play a virtual machine on Linux (Xen is similar to VMware).

Chapter8:linux disk and File System Management (4) Set the boot mount

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.