Attach a disk to the centos 7 VM Instance System

Source: Internet
Author: User

Attach a disk to the centos 7 VM Instance System

I. Preparation
One centos7 cloud host
50 GB cloud Disk
Attach a cloud disk to a VM instance

Ii. attaching a disk
1.1 view new disk

[root@cgsl ]# fdisk –l

Find the number of the Newly Added Disk:/dev/vdc

1.2 hard disk partition enters fdisk Mode

[root@cgsl ]# /sbin/fdisk /dev/vdc

Input n to partition

[root@cgsl ]# Command (m for help): n

Select partition type

[root@cgsl ]# Select (default p): p

Select the number of partitions

[root@cgsl ]# Partition number (1-4, default 1): 1

Press enter all the time and enter q to exit.

3. format the partition to format the new partition to the ext3 file system.

[root@cgsl ]# mkfs -t ext3 /dev/vdc

4. Mount the hard disk 1. Create a mount point and create a storage directory under the root directory

[root@cgsl ]# mkdir /storage

2. Mount/dev/vdc to/storage

[root@cgsl ]# mount /dev/vdc /storage

3. Set automatic mounting upon startup the newly created partition cannot be automatically mounted upon startup. Manual mounting is required for each reboot of the machine. Modify the/etc/fstab file to set automatic mounting upon startup.

#vi /etc/fstab 

Add/dev/vdc/storage ext3 defaults 1 2 at the end of the file

Make sure to query your hard disk format by using df-T.

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.