In the shutdown state, add a hard disk to the virtual machine with a capacity greater than 10G, and then restart
View newly added disks
1
fdisk -l //or cat /proc/partitions
New partition
1
fdisk /dev/sdb //The sdb here is the newly added hard disk
1
2
3
4
5
6
7
n //Add new partition
p //Create primary partition
1 partition number 1
Press Enter //Start sector to select default
It is also the default of carriage return // in order not to waste space
p //View the created partition
w // save
Format the partition Format as ext4
1
mkfs.ext4 /dev/sdb1d //or mkfs -t ext4 /dev/sdb1
Edit the configuration file to realize automatic mounting at startup
1
vim /etc/fstab
add at the end
1
/dev/sdb1 /mnt/daobin ext4 defaults 0 0
Note: The first indicates the disk partition path, the second indicates where the file needs to be mounted, and the third is the file format