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).
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
n # new partition, i only add one partition is this disk,
# so i press enter for two times then
w # write the changes
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
udev 2.0G 0 2.0G 0% /dev
tmpfs 394M 5.7M 388M 2% /run
/dev/sda1 18G 7.0G 9.8G 42% /
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/sda4 20G 14G 5.2G 73% /home/hobochen/os
tmpfs 394M 0 394M 0% /run/user/1000
/dev/sdb1 493G 70M 467G 1% /home/hobochen/flush
sudo vim /etc/fstab
Add this line in the end of file.
/dev/sdb1 /home/hobochen/flush ext4 defaults 0 0
All is done!