Nextcloud Docker space issue

Hi all,

I am having an issue regarding the space usage on Nextcloud Docker. I assigned 500GB on the VM. After installation, I found out that Nextcloud only has 100GB of space. How can I increase the space for the Nextcloud docker?

Screenshot 2023-08-09 114907


Screenshot 2023-08-09 120036

It looks like you provisioned a 500GB disk for the VM, but when installing Ubuntu only let LVM use 100GB of /dev/nvme0n1p3 for /dev/mapper/ubuntu--vg-ubuntu--lv. Since Docker stores persistent volumes in /var/lib/docker/volumes on the host, this is the culprit.

Since /dev/nvme0n1p3 (the underlying partition) is already the correct size (~497GB) we probably just need to resize the logical volume (LV) and Filesystem.

I’m operating on the assumption that the Volume Group (VG) already has all the space provisioned to it, which in a default Ubuntu install should be the case I believe (if not, the worst that should happen by following the below steps is that you won’t get the increase in space you expect).

WARNING: This should be safe, but please have backups/snapshots if anything important is stored here before making the the following adjustments just in case!

This should be what’s needed in your case I believe:

  1. Resize the logical volume:

lvextend =l+100%FREE /dev/ubuntu-vg/ubuntu-lv

  1. Resize the filesystem to match the newly enlarged logical volume:

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

P.S. If you’re curious, you can read up on LVM. e.g. Ubuntu: Extend your default LVM space - Packet Pushers

Thanks It works but I modify a little bit

sudo lvextend -l 90%FREE /dev/ubuntu-vg/ubuntu-lv
sudo resize2fs /dev/mapper/ubuntu–vg-ubuntu–lv

1 Like