I’ve got Ubuntu 18.04 Server in Virtual Box, and once I’ve ran out of 10 GB of allocated space on virtual disk, I’ve increased the size of the virtual disk to 17 GB and resized the root partition with parted‘s resizepart command (and done so while partition is in use, and yes I know it’s bad practice, but it’s a virtual machine for development, all code committed to github and I’ve a clone of the machine just in case).
Everything seems to have worked: lsblk and udisksctl properly report the new size, but df is still stuck at reporting the old 10 GB and 100% usage (even after reboot). Why is it so and what can I do about this odd df‘s behavior ?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
There’s probably a more specific duplicate somewhere, but I can’t find it.
The reason df isn’t showing any extra space is that it measures the free space inside the file system; it doesn’t care about partitions, logical volumes etc. So far, you’ve resized the disk and the partition; you also need to resize the file system:
sudo resize2fs /dev/sda1
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0