Alibaba Cloud Ubuntu data disk mounting perfect tutorial

When the system is initialized, there is only one system disk and no data disk. So the first step is to mount the data disk (to be purchased separately).
 
You can use fdisk -l | grep Disk to check how many disks your system has.
Such as:
 

Disk /dev/xvda: 21.5 GB, 21474836480 bytes

Disk identifier: 0x0002bfb2

Disk /dev/xvdb: 107.4 GB, 107374182400 bytes

Disk identifier: 0x85753e24

 
 
1. Switch to root;
2. Run the command "fdisk /dev/xvdb";
3. According to the prompt, enter "n", "p", "1" in turn;
4. Then, press Enter twice;
5. Enter "w", when it prompts Syncing disks., it means the partition has been successfully completed;
6. Type "mkfs.ext3 /dev/xvdb1" to format the partition; be patient here
7. Enter "mkdir /data0" to create a mount directory
8. Use the "mount /dev/xvdb1 /data0" command to mount the partition and use it.
9. vi /etc/fstab
Press i
write the last line
/dev/xvdb1    /data0    ext3         defaults     0 0
press esc 
Type: wq , press Enter
 
After completion, you can view it with commands such as df.

Guess you like

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