Closed capi1O closed 8 years ago
ok I actually forgot the basics : partition (in this case, the logical volume) ≠ filesystem.
What happens with lvextend
is that the logical volume is expanded, however the filesystem is not. I did not think about the filesystem because everything is handled by docker-lvm-plugin
and we have never to deal with it.
To find out what is the filesystem used by docker-lvm-plugin
I used mount
:
/dev/mapper/my--volume--group-my--named--lvm--volume on /var/lib/docker-lvm-plugin/my-named-lvm-volume type xfs (rw,relatime,attr2,inode64,noquota)
And to extend the filesystem (to the maximum possible) just use sudo xfs_growfs /dev/mapper/my--volume--group-my--named--lvm--volume
.
Note : this can be done while the docker volume is in use, no problem.
@monkeydri
Yes this is correct. You need to extend both the logical volume and the XFS filesystem. Since xfs_growfs
only allows online resizing, the filesystem must be mounted before it can grown.
Shishir
Hello, I have created a docker named volume using LVM thanks to your driver :
docker volume create -d lvm --name my-named-lvm-volume --opt size=500G
This works great, I can see the logical volume is created using
sudo lvdisplay
:And as soon as I
docker rm my-named-lvm-volume
the logical volume disappear, quite easy ;-)However I then tried to extend the logical volume, for example to add 100GB :
sudo lvextend -L+100G /dev/my-volume-group/my-named-lvm-volume
.The operations is successful (
lvdisplay
shows correct new size) however the docker volume still use the initial space set (500GB). I could remove and recreate the named volume but I already have a lot of data on it.Is there a way to extend the named volume ? Apologies if I'm missing something obvious...