This post will cover how to add a new disk, format it and then mount it under Linux.
I met the problem "no enough disk space" when compiling the Linux kernel at the first time, as the VMware says the recmmended size of Linux is 20GiB, and the real size which compiling needs is about 15GiB (Linux 4.4.0).
Add a Disk
This step is quite easy. Just change the settings of the VMware machine.
sudo fdisk -l
You may see like that:
# Many things, like /dev/ram*
That shows the
/dev/sdb is the disk i added before.
sudo fdisk /dev/sdb
g # create a new GPT disk lable
sudo mkfs -t ext4 /dev/sdb1 # use ext4 file system
Then check the new disk.
You may see:
Filesystem Size Used Avail Use% Mounted on
Auto Mount when Boot
sudo vim /etc/fstab
Add this line in the end of file.
/dev/sdb1 /home/hobochen/flush ext4 defaults 0 0
All is done!