1. Confirm that the disk has been added
2. Restart the virtual machine
View disk space on an existing system
Fdisk-l
You can see the newly added virtual hard disk, typically named: DISK/DEV/HDB1
3. Partition the newly added hard disk
Fdisk/dev/hdb1
Type m to see Help information
Command (M for help): M
Add New partition
Command (M for help): N
Select Basic Partition, enter: P
Build a partition
Partition number (1-4): 1
Enter
The cylinder (1-15908,default 1): Enter
Set Partition type
Command (M for help): t
Set the partition number
Partition number (1-4): 1
Input partition type
Hex code (type L to list codes): 8e
View current partition
Command (M for help): P
Write and exit
Command (M for help): W
To make the partition table effective, restart, or execute the following command
Partprobe
Using pvcreate conversion
Pvcreate/dev/hdb1
4. Format a disk partition
Format the/DEV/HDB1 into the ext3 format
Mkfs.ext3/dev/hdb1
5. Mount Partition
Create a new mount point
Mkdir/work
To mount a new partition to the/work directory
Mount-t Ext3/dev/hdb1/work
View Mount
Df-h
You can see the newly added hard drive:/dev/sdb1
6. Automatic mount on Boot
modifying files
Vi/etc/fstab
On the last line, add:
/dev/hdb1/work ext3 defaults 0 0
: sq Save Exit can be