Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu wrongly shows low disk space [closed]

I installed Ubuntu 14.0 on virtual box. Initially I had allocated 10 GB for the .vdi. I increased it to 25 GB. When I check the size in the settings in virtual box, its showing correctly as 25GB. See below:

enter image description here

But I am frequently getting error warnings on Ubuntu for Low Disk Space.

I checked in System Monitor > File Systems and see that its not picking up allocated disk space and showing only the old 6.2 GB. See below :

enter image description here

What should I do to solve this? Please help.

like image 205
Somename Avatar asked Oct 29 '25 11:10

Somename


1 Answers

I encountered the same problem... Used the following to solve the problem:

vboxmanage modifyhd "/path/to/virtualdrive.vdi" --resize <NewSize>

open the virtual machine and resize the partition (easily done using gparted). The drive was resized to 100G

Then:

# df -h /home/

Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-root   24G   22G  1.1G  96% /

# lvextend -L +100G /dev/mapper/ubuntu--vg-root

Size of logical volume ubuntu-vg/root changed from 24.00 GiB (6145 
extents) to 124.00 GiB (31745 extents).

Logical volume ubuntu-vg/root successfully resized.

# resize2fs /dev/mapper/ubuntu--vg-root 

The filesystem on /dev/mapper/ubuntu--vg-root is now 32506880 (4k) 
blocks long.

# df -h

Filesystem                   Size  Used Avail Use% Mounted on
udev                         3.9G     0  3.9G   0% /dev
tmpfs                        798M  1.4M  797M   1% /run
/dev/mapper/ubuntu--vg-root  122G   22G   96G  19% /
like image 188
Kelvin Avatar answered Oct 31 '25 02:10

Kelvin