Reprinted to https://blog.csdn.net/zsx1314lovezyf/article/details/105445554
Add hard drive memory
The virtual machine must be powered off
Enter virtual machine settings
Select hard drive
Adjust to the size you want, click Apply, wait for completion, and turn on the virtual machine
Enter the system to install the gparted partition management tool
sudo apt-get install gparted
Open the partition tool sudo gparted
Allocate space
Select sda5, right click to prohibit swap space
Select sda5, right click to delete
Select sda2, right click to delete
Select sda1, right click to change the size
Set the size of sda1, click to resize
Select the unallocated space, right click to create
Select the extended partition, click Add
Select the unallocated space, right click to create
Select the file system as: linux-swap, click Add
Click save
Click to apply
After waiting for completion, click close
Restart the operating system, reboot
df -h view the disk partition after carving.
In addition, fdisk -l is to view partition information,
To operate the disk, you need to execute a specific disk, such as fdisk /dev/sda
Common commands:
p: Display disk list information
d: delete a disk
q: Exit without saving
w: save and exit