Can't see mountpoints of created containers

Hi! Some time ago i use lxd ver ~3 (LVM storage) and use ubuntu 18.04 and when i create containers, i do command “df -h” and i see mountpoints of all my containers

Now i use lxd 4.0.4 on ubuntu 20.04
Here the lxd init

Would you like to use LXD clustering? (yes/no) [default=no]: no
Do you want to configure a new storage pool? (yes/no) [default=yes]: yes
Name of the new storage pool [default=default]: default
Name of the storage backend to use (btrfs, dir, lvm, zfs, ceph) [default=zfs]: lvm
Create a new LVM pool? (yes/no) [default=yes]: yes
Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]: yes
Path to the existing block device: /dev/mapper/lxd_storage-lxd
Would you like to connect to a MAAS server? (yes/no) [default=no]: no
Would you like to create a new local network bridge? (yes/no) [default=yes]: no
Would you like to configure LXD to use an existing bridge or host interface? (yes/no) [default=no]: yes
Name of the existing bridge or host interface: br0
Would you like LXD to be available over the network? (yes/no) [default=no]: yes
Address to bind LXD to (not including port) [default=all]: 
Port to bind LXD to [default=8443]: 
Trust password for new clients: 
Would you like stale cached images to be updated automatically? (yes/no) [default=yes] yes
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: no

/dev/mapper/lxd_storage-lxd - this is LV volume.
lxd-storage - VG group

And after creating containers i don’t see mounpoints
Why? Can anybody explain?

That’s normal, with the snap version of LXD, mountpoints are kept away in a separate mount namespace. This makes it less likely to be messed with by external processes.

You can take a look at what’s mounted through /var/snap/lxd/common/mntns/var/snap/lxd/common/storage-pools/ if you really need it.


How i fast can see the size of my containers? How can i resize it with lvresize command? Where i can find mountpoint? Can you show examples please?

lxc info NAME gets you the size information.
lxc config device set NAME root size VALUE should be used to resize the instance.

Using lvresize directly outside of LXD may result in data corruption.

It’s a new feature with lvm storage? Resizing without lvresize? Now I don’t need use lvresize and resize2fs commands to grow up container root?

Nope, we’ve had that ever since we added LVM support.

1 Like

this don’t work. I don;t know why

I want to see size of partition, on this screenshot in’t not the whole partition size

And i receive error

Right, that’s because your root device is coming straight from your profile right now, I suspect you actually want:

lxc config device override ldap-server1 root size=50GiB in this case.

Okay. it’s working

Last question)
After resize i go to the container, see “df -h” and size still 10gb (default)
After reboot the container i see new size 50G

I must restart the container, when i resize root partition?

Yeah, we have an issue to add support for live resizes in some cases but right now we’re not taking any chances.

The grow/shrink behavior is very filesystem dependent but in the future we expect:

  • live grow on ext4
  • live grow/shrink on btrfs
  • require restart for everything else
1 Like

This functionality was added as part of I believe so should be in LXD 4.9.

Trying this on master now:

lxc launch images:ubuntu/focal c1 -s lvm
lxc exec c1 -- df -h
Filesystem                                           Size  Used Avail Use% Mounted on
/var/lib/lxd/storage-pools/lvm/containers/c1/rootfs  9.2G  491M  8.2G   6% /

lxc config device set c1 root size=11GB
lxc exec c1 -- df -h
Filesystem                                           Size  Used Avail Use% Mounted on
/var/lib/lxd/storage-pools/lvm/containers/c1/rootfs   11G  495M  9.1G   6% /
1 Like

Hello! Thank you for answer

Tell me please why you do not use lxc config device override? As @stgraber say?

I can’t understand this :frowning:

lxc config device override is to be used when the device you’re trying to modify is currently coming through a profile.

lxc config device set is to be used when the device is already part of the instance config.

So basically if you see the device in lxc config show, use lxc config set, if you don’t, use lxc config device override.

lxc config device override will copy the device entry from whatever profile it came from into your instance specific config and apply any changes you want. Any subsequent changes are then done through lxc config device set.

In the example above, Tom used -s lvm during lxc launch which then creates an instance specific disk tied to that lvm storage pool. The instance therefore has an instance specific disk device and so lxc config device set is used to alter it.

1 Like