0

I am using VirtualBox. I installed a ubuntu system on it. At the beginning, I set default 8GB disk space. But it's not big enough so I want to add more space on it.

I used this way(add to 20GB):

VBoxManage modifyhd my_ubuntu.vdi --resize 20000

After I restart my ubuntu, I run these commands in the terminal:

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.3G     0  1.3G   0% /dev
tmpfs           256M  4.4M  251M   2% /run
/dev/sda1       5.3G  5.0G     0 100% /
tmpfs           1.3G  224K  1.3G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           1.3G     0  1.3G   0% /sys/fs/cgroup
tmpfs           256M   48K  256M   1% /run/user/1000

$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0 19.5G  0 disk 
├─sda1   8:1    0  5.5G  0 part /
├─sda2   8:2    0    1K  0 part 
└─sda5   8:5    0  2.6G  0 part [SWAP]
sr0     11:0    1 55.5M  0 rom

Why can't I see the addition space under df -h command? But can see it by using lsblk? And, is it really that my system is 20GB available and useful now?

Prashant Chikhalkar
  • 2,411
  • 2
  • 18
  • 25
s_zhang
  • 103
  • (Different VM software, but same principle - once you resize the disk, the filesystem needs to be resized as well) – muru Dec 06 '16 at 03:20

2 Answers2

0

To answer your question:

df -h only shows you the size of the partitions, and the contents of those partitions.

lsblk will show you the partitions sizes, as well as the disk they are hosted on.

You need to re-partition to use empty space.

The other answer does not explain it, but links to a possible way to expand your filesystem.

Unfortunately, I cannot provide any experience on how to do this.

Further Reading:

AnotherKiwiGuy
  • 4,370
  • 1
  • 21
  • 38
0

Not allowed to add comment, but you might want to look at https://unix.stackexchange.com/questions/67095/how-can-i-expand-ext4-partition-size-on-debian. I believe you need to resize your root partition, /dev/sda1, using a utility such as gparted or fdisk.