[solved] Upgrade to 20.04 LTS broke lxd installation

Hi,
I upgraded my running web server from bionic to the latest Ubuntu LTS version (by accident) and during this process my running lxd installation has been broken. As I am not familiar with the latest snap lxd version I ask you to help me fix this. FYi I had all containers on a dedicated btrfs partition mounted to /var/lib/lxd

The problem is:
“lxc list” does not show any container.
“lxc network list” does not show the previously configured lxd brige
“lxc info” shows I am using version 4.0.2 but nothing usable for me atm. I can provide all info if needed

A list in /var/lib/lxd/containers/ shows me broken symlinks to /var/snap/lxd/common/lxd/storage-pools/default/containers/ (which is empty)
The cobntainers are located in /var/lib/lxd/storage-pools/default/containers
I changed the symlink, but that does not help to show and get the containers running

What else do I have to do to restore my containers?

See:

And this might also help (it’s for zfs, but I guess it can also be helpful for btrfs):

You might need to look up specifics for btrfs.

Hi,

Can you show lxc version?

You’re going to need to change your /etc/fstab entry to mount your storage at /var/snap/lxd/common/lxd rather than /var/lib/lxd, then I’d recommend rebooting your system and checking if things look any better.

The deb->snap upgrade logic detects and prints a warning to update /etc/fstab, but this may have been hidden by all the other upgrade messages.

You’re going to have to undo what you did to the symlinks though or your container will fail to start.

Hi Stephane,
Hi all,

thanks for your answers!

ubuntu ships 4.0.2 as stable version

lxc version
Client version: 4.0.2
Server version: 4.0.2

I will check your suggestion and undo my changes and modify /etc/fstab to mount the volume to /var/snap/lxd/common/lxd

Ok, a failure to move your data would have made the upgrade fail very visibly.
So there’s a very good chance that everything upgraded properly and that the only issue you ran into is that after a reboot, your data was getting mounted on /var/lib/lxd rather than /var/snap/lxd/common/lxd

We did consider trying to auto-update /etc/fstab, but this could have some rather disastrous consequences so we decided to just print a warning instead.

Thanks a lot, that solved my issue!
Everything is fine after a reboot.