Alibaba Cloud CentOS server system mounting data disk tutorial

Source: Internet
Author: User
Tags centos server
Applicable Systems: Linux (Redhat, CentOS, Debian, Ubuntu) * Linux ECS data disks are not partitioned or formatted. you can perform partitioning and formatting according to the following steps. The following operations will divide the data disk into a partition for use. 1. view the data disk before partitioning and formatting the data disk, use the & ldquo; df & ndash; h & rdquo; life-oriented system: Linux (Redhat, CentOS, Debian, Ubuntu)

* Linux ECS data disks are not partitioned or formatted. you can perform the following steps to partition and format them.

The following operations will divide the data disk into a partition for use.

  1. View data disksBefore partitioning and formatting a data disk, you cannot view the data disk by running the "df-h" command. you can run the "fdisk-l" command to view the data disk. For example:


Tip: If you run the fdisk-l command and find that no/dev/xvdb indicates that your cloud service has no data disk, you do not need to attach it. this tutorial is not applicable to you.

 


2. partition data disksRun the "fdisk-S 56/dev/xvdb" command to partition the data disk. enter "n", "p", and "1" as Prompted. press enter twice, "wq", the partition starts and will be completed soon.

 


3. view the new partitionRun the "fdisk-l" command to check that the new partition xvdb1 has been created.




 


4. format the new partition.Take ext3 as an example: use the "mkfs. ext3/dev/xvdb1" command to format the new partition. the formatting time varies with the hard disk size. (You can also choose other file formats, such as ext4)

 

 

 


5. add partition informationUse the echo '/dev/xvdb1/mnt ext3 defaults 0 0'>/etc/fstab (without quotation marks) command to write new partition information.
Run the "cat/etc/fstab" command to check whether the write is successful. Note: ubuntu12.04 does not support barrier, so the correct syntax is: echo '/dev/xvdb1/mnt ext3 barrier = 0 0 0'>/etc/fstab * if you need to mount the data disk to a folder separately, for example, to store webpages separately, you can modify the/mnt part of the above command.


  6. mount a new partitionRun the "mount-a" command to mount the new partition and run the "df-h" command to view the new partition. the following information indicates that the partition is successfully mounted and you can start using the new partition.


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.