0

I'm running an Ubuntu Server VPS (nothing serious on there, just something for me to mess around with), that I installed when it only had one virtual disk of 20 GB. I have since upgraded the size of that volume to 20 GB. I was using LVM and I though it'd be easy to increase the size of the main volume to encompass the entire virtual drive. I tried that using the lvextend command. It did extend it somewhat, but not to the amount I expected it to (in hindsight doing it in increments was probably stupid and unnecessary). Anyway, this is my current situation:

df -h shows:

Filesystem                         Size  Used Avail Use% Mounted on
udev                               3.9G     0  3.9G   0% /dev
tmpfs                              797M  936K  796M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   19G  3.1G   15G  18% /
tmpfs                              3.9G  4.0K  3.9G   1% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/vda2                          976M  100M  810M  11% /boot
/dev/loop0                          67M   67M     0 100% /snap/lxd/13300
/dev/loop1                          92M   92M     0 100% /snap/core/8592
/dev/loop2                          55M   55M     0 100% /snap/lxd/12211
/dev/loop3                          90M   90M     0 100% /snap/core/8268
tmpfs                              797M     0  797M   0% /run/user/1000

parted -l shows:

Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 20.4GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system  Flags
 1      0.00B  20.4GB  20.4GB  ext4


Model: Virtio Block Device (virtblk)
Disk /dev/vda: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2097kB  1049kB                     bios_grub
 2      2097kB  1076MB  1074MB  ext4
 3      1076MB  21.5GB  20.4GB

The parted -l result shows that there is a 53.7 GB device recognized, but just below that it says that it has a size of approx. 20 GB, with the results of df -h coming to a total of roughly 33 GB (no idea how).

Is there a reasonable way to fix this, or should I just give up and re-install?

0

Did you try

resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

after the lvextend?

|improve this answer|||||
  • Yes, I did. Sadly, the output is: The filesystem is already 4974592 (4k) blocks long. Nothing to do! – Patriot Feb 12 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.