[LXD 4.2] Using btrfs external patition


I have a storage configured for btrfs that point on /dev/disk/by-partlabel/mypartition but I don’t know if this setting is correct.

After my first lxd image import ... I don’t find where the image is strored. And impossible to mount my /dev/disk/by-partlabel/mypartition too

If anyone have some informations about how to set the storage in this case and how to use it.

EDIT: I use snap package of LXD. My host not use btrfs and It’s why I have choose to set this btrfs external partition

Thanks in advance

AFAIK Images are not stored in storage pools.
So you won’t find them there.

lxc storage list

and tell us the results.

lxc image import does not use your storage pool unless you’ve created a custom volume and configured images.storage_volume.

Try creating an instance, those are stored on storage pools.


I try to understand if it is possible to not use lxd on my intenal HDD to preserve it a bit (SSD) and work on the external partition only :thinking:

Sounds like something bad happened to btrfs or your drive with forced it into emergency read-only.

Can you show the output of dmesg?


dmesg | grep BTRFS :

Yeah, your system has detected some serious errors from btrfs and made it read-only.
It’s also reporting the drive showing up twice for some reason.

I’d strongly recommend rebooting the system to see how much of this clears up.

Ok. I going to reboot. But I had rebooted the system to retry when the problem was appear :thinking:

Ok. The image is launched this time.

But I have some error with dmesg : https://pasteall.org/pic/7ba515040a5f44fe91a577b922518d9b

here is a more logged shell session: https://hastebin.com/idicokoneq.log

I you have an idea about this error :wink:
And is it a good way to use lxd with a btrfs external storage to preserve a bit my internal sdd ?

Those errors appear PCIe/USB related, not sure what’s going on there but they may be fine to ignore since the system clearly booted up.

It’s fine to put your containers on a storage pool like this, many people do it.

Ok thanks.

For the errors it seem related to an hardware issue. https://bugzilla.redhat.com/show_bug.cgi?id=1807760

I going to test with using my usb hub.

Thank you :slight_smile:

A last question. LXD mounting my partition automatically or is it just automounted when I plug my disk ?
I’m intrested about how it work under the hood

LXD mounts everything it needs on startup. It will most likely fail to start should the drive be missing.

Okay. But what mount point is used ? There is something to do with fstab ?

No, nothing to do with fstab.
It gets mounted in a hidden path in a separate mount namespace.

Okay. And is it possible for me to mount the storage somewhere to know more about my images and containers? Something like using the file manager for example to browse the partition. I don’t understand why I had this error with my partition earlier

Mounting it again should be okay but note that containers are very picky about ownership and permissions and we on purpose extremely restrict access to those paths, so unless you run a file explorer as root, you won’t be able to access anything.

As root, you should be able to see things under /var/snap/lxd/common/mntns/var/snap/lxd/common/lxd/storage-pools

1 Like