I’ve configured LXD with storage on a separate disk, and one of containers was placed on this disk.
Some time later, the disk started to fail - because it was a single disk and the container on it was not important, I wanted to remove the disk by using the following process:
- remove the container
- remove the storage
However, “lxc delete $container” didn’t work, because there were input/output errors on disk.
So I’ve powered off the server, pulled the disk out, powered the server on - unfortunately, LXD won’t start anymore:
# lxc list
Error: Get "http://unix.socket/1.0": EOF
# systemctl status snap.lxd.daemon.service
● snap.lxd.daemon.service - Service for snap application lxd.daemon
Loaded: loaded (/etc/systemd/system/snap.lxd.daemon.service; static)
Active: active (running) since Wed 2021-12-01 15:38:17 UTC; 2s ago
TriggeredBy: ● snap.lxd.daemon.unix.socket
Main PID: 99314
Tasks: 0 (limit: 9223)
Memory: 328.0K
CPU: 119ms
CGroup: /system.slice/snap.lxd.daemon.service
Dec 01 15:38:18 backup lxd.daemon[99453]: - cpuview_daemon
Dec 01 15:38:18 backup lxd.daemon[99453]: - loadavg_daemon
Dec 01 15:38:18 backup lxd.daemon[99453]: - pidfds
Dec 01 15:38:19 backup lxd.daemon[99314]: => Starting LXD
Dec 01 15:38:19 backup lxd.daemon[99465]: t=2021-12-01T15:38:19+0000 lvl=warn msg=" - Couldn't find the CGroup network priority controller, network priority will be ignored"
Dec 01 15:38:19 backup lxd.daemon[99465]: t=2021-12-01T15:38:19+0000 lvl=eror msg="Failed to start the daemon" err="Failed initializing storage pool \"samsung\": Source path \"/var/lib/snapd/hostfs/lxd/storage/samsung\" isn't btrfs"
Dec 01 15:38:19 backup lxd.daemon[99465]: Error: Failed initializing storage pool "samsung": Source path "/var/lib/snapd/hostfs/lxd/storage/samsung" isn't btrfs
Dec 01 15:38:20 backup lxd.daemon[99314]: => LXD failed to start
Dec 01 15:38:20 backup systemd[1]: snap.lxd.daemon.service: Main process exited, code=exited, status=1/FAILURE
Dec 01 15:38:20 backup systemd[1]: snap.lxd.daemon.service: Failed with result 'exit-code'.
What is the best way to recover from this situation?