Linux System Mount Data disk

Source: Internet
Author: User

Applicable system: Linux (Redhat, Centos,debian,ubuntu)

* The Linux cloud Server data disk is not partitioned and formatted, and can be partitioned and formatted according to the following steps.

The following operation will divide the data disk into a partition to use.


1. View the data disk. Before partitioning and formatting the data disk, using the "df-h" command, you cannot see the data disk, you can use the "fdisk-l" command to view. Such as:

Tips: If you do fdisk-l order, found no /dev/xvdb to indicate that your cloud service no data disk, then you do not need to mount, at this time the tutorial does not apply to you


2. Partition the data disk. Execute the "fdisk-s 56/dev/xvdb" command to partition the data disk;

According to the prompt, enter "n", "p", "1", two times enter , "wq", the partition will begin, will be completed soon.

3. View the new partition.

With the "fdisk-l" command you can see that the new partition XVDB1 has been established.

4. Format the new partition.

The new partition is formatted with themkfs.ext3/dev/xvdb1command, and the time to format varies depending on the size of the hard disk. (You can also choose the EXT4 format independently)

5. Add partition information.

Create the Data directory: Enter the "mkdir/data" directory

Write new partition information using the "Echo '/dev/xvdb1/data ext3 defaults 0 0 ' >>/etc/fstab" (unquoted) command.
Then using the "cat/etc/fstab" command to view, the following message indicates that the write was successful.

Note: ubuntu12.04 does not support barrier, so the correct wording is:echo '/dev/xvdb1/mnt ext3 barrier=0 0 0 ' >>/etc/fstab

* If you need to attach the data disk to a folder separately, for example, to store the page separately, you can modify the /data part of the above command.

6. Mount the new partition.

Use the "mount-a" command to mount the new partition, and then use the "df-h" command to view the following message stating that the mount was successful and you can start using the new partition.

Linux System Mount Data disk

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.