After loading Ubuntu in VirtualBox, I found that the hard disk space is too small to increase the capacity of the hard disk. That is to build another hard drive:
1. Add a new hard drive
Settings, Storage, SATA controller, right-click, select “ Add virtual hard disk ”
Then, create the right hard drive on demand
2. Restart the virtual machine
To view disk space for an existing system
sudo fdisk-l
You can see the newly added virtual hard disk, the general name is: Disk/dev/sdb
3. Add a new hard drive partition
Fdisk/dev/sdb
Type m to see the 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
First cylinder (1-15908,default 1): Enter
Write and exit
Command (M for help): W
4. Format the partition of the disk
/DEV/SDB1 into format using the EXT4 format
sudo mkfs.ext4/dev/sdb1
5. Mount Partitions
Create a new mount point
sudo mkdir/work
Mount the new disk partition under the/work directory
sudo mount-t ext4/dev/sdb1/work
View Mounts
Df-h
You can see the newly added hard drive:/dev/sdb1
6. Auto mount on Boot
Modify a file
sudo vim/etc/fstab
In the last line join:
/dev/sdb1/work ext4 Errors=remount-ro 0 1
Complete!
This article is from the "Cool Ice" blog, please make sure to keep this source http://liangbing8612.blog.51cto.com/2633208/652333