I installed Ubuntu Server 18.04 with the LVM option and left the default partition setup. Now my main drive only has 4GB in a 1TB hard drive. How can I fix this without starting from scratch?
Results of df -h
:
Filesystem Size Used Available Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 32G 1.7M 32G 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 3.9G 3.6G 92M 98% /
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/loop0 87M 87M 0 100% /snap/core/4917
/dev/loop1 3.2M 3.2M 0 100% /snap/stress-ng/471
/dev/loop2 90M 90M 0 100% /snap/core/6130
/dev/sda2 976M 143M 766M 16% /boot
tmpfs 3.2G 0 3.2G 0% /run/user/1000
Had the exact same problem with a fresh install of Ubuntu Server 18.04.1.
What I had to do was:
If you didn't customize the LVM settings, the names for the volume group and logical volume should be the same as mine (
ubuntu-vg
andubuntu-lv
respectively).If your partition is completely full, you could get a
no space left
error when trying to resize the logical volume like:The easiest way to fix this is by removing
apt
cache (it will get regenerated next time you doapt update
), which should give you more than enough space to complete the operation:Expected behavior on an LVM install is indeed the smaller partitions. The system creates minimal space waste on physical partition creation expecting you to customize and expand the LVM as needed, since the added partitions aren't necessary to the operating systems function, and users having additional storage space, quotas, and expansion is the point of having an on-the-fly expandable LV and VG
What it should do, however, is explain that better on install
It appears that you need to extend your Logical Volume.
It can be a bit tricky but if you understand that there are 3 parts, it'll be much easier.
Physical Volume (PV) => The physical space on a drive.
Volume Group (VG) => An abstracted amount of drive space that can be split between multiple drives/devices.
Logical Volume (LV) => The space that ubuntu "sees"
You'll need to extend your VG all the way across your 1TB Drive (or extend however much you want), then extend the Logical Volume group to take up that space.
Technet has a nice writeup that (if you follow carefully) you'll be able to follow and extend your drive.