How to use Alibaba Cloud Server - Mount Data Disk

------------------------
■Using Alibaba Cloud
---------------------- --How
to mount the data disk?
Execute the fdisk -l command to see if there is /dev/xvdb If it indicates that you have a cloud service data disk
1. Partition
If you see /dev/xvdb in the previous step, then execute the "fdisk -S 56 /dev/xvdb" command , partition the data disk; according to the prompt, enter "n", "p", "1" in turn, press Enter twice, "wq", the partitioning starts and will be completed soon.
At this point, use the "fdisk -l" command to see that the new partition xvdb1 has been created.
(Enter the fdisk command, enter h to see the help of the command, press n to partition)

2. Format
this data disk is a newly purchased, never used before (no data has been stored), then format it , use the "mkfs.ext3 /dev/xvdb1" command.
If you have a data disk before, but you reset the system disk and need to mount the data disk to the reset system again, then do not format it (skip this step), and directly execute the following Steps to mount it.

3. Write partition information
If you want the partition to be automatically mounted every time the system restarts, you can modify the /etc/fstab file and add a section /dev/sdb1 /www ext3 defaults 1 2 at the end (format description: /dev/sdb1 represents which partition ext3 is the partition The format defaults is the parameters to be set when mounting (read-only, read-write, enable quota, etc.), the parameters included in the input defaults are (rw, dev, exec, auto, nouser, async), 1 is whether to use dump Record, 0 is not required. 2 is the order of checking at boot time, it is 1 for the boot system file, 2 for other file systems, and 0 if it is not checked)

Use "echo '/dev/xvdb1 /mnt ext3 defaults 0 0 ' >> /etc/fstab" (without quotes) command to write new partition information.
Then use the "cat /etc/fstab" command to view, and the following information appears, indicating that the writing is successful.

4. Mounting
Finally, use the "mount -a" command to mount the new partition, and then use the "df -h" command to view it. The following information appears, indicating that the mounting is successful, and the new partition can be used.
("mount -a" mounts all options under fstab)
mount /deb/xvdb1 /mnt

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327028566&siteId=291194637