Alibaba Cloud Mount Data Disk

1. Check the mountable hard disk
   fdisk -l

If prompted:

disk /dev/vdb doesn't contain a valid partition table means that the data disk has not been partitioned and mounted.

It means that you have unallocated data disks that are not in use, continue to the next step of " partitioning ".

If prompted:

Device        Boot      Start      End      Blocks      Id      System

/dev/vdb1      *         2048    83884031 41940992 83     Linux

Note that /dev/vdb1 is the data disk, and /dev/vda1 is the system disk.

It means that the purchased data disk has been formatted before, and the formatted data disk can be directly mounted by skipping step 4 .

 
If the above two prompts are not available, it means that you have not purchased a data disk, only a system disk, and you do not need to do anything. You can go to the Alibaba Cloud console to confirm whether you have purchased data disks.
 
2. Partition

Switch to root account;

Run  fdisk /dev/vdb to partition the data disk. According to the prompt, enter n, p, 1 in turn, enter twice, wq, the partition starts.

n: stands for new, create a new partition

p: stands for primary, set as the primary partition

1: represents the number of partitions 1

The first carriage return: It represents the starting position of the partition and starts from sector 1 by default.

The second carriage return indicates that the end position of the partition uses the default last sector.

(meaning: divide the whole block of data into 1 primary partition, and the created partition partition name is xvdb1)

wq, on behalf of save and execute the above partition. Partitioning begins!

Use fdisk -l again to see the new partition, as follows:

Device        Boot      Start      End      Blocks      Id      System

/dev/vdb1      *         2048    83884031 41940992 83     Linux

 
If the partition is successful, the mount will start below, otherwise it will not be available.
 
3. Format (it is mounted and can be skipped)
  mkfs.ext3 /dev/vdb1
 
4. Mount
mount /dev/vdb1 /vol1
 
5. Save the mount information to make the restart take effect
echo  '/dev/vdb1         /vol1              ext3    defaults        0 0'  >> /etc/fstab

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326508743&siteId=291194637