Missing storage pool, removal from DB manually then it reappears

Hi,
LXD isn’t starting because there is a missing storage pool that was removed accidently.
I want to stop it trying to mount it, so I removed the entries from the sqlite db but every time i start lxd again it restores the rows to the table and trys to mount the missing pool and fails.
Any ideas where I’m going wrong?
Cheers,
Jon.
sqlite3 /var/snap/lxd/common/lxd/database/global/db.bin

select * from storage_pools;

 delete from storage_pools_config where id=16;
 delete from storage_pools_config where id=15;
 delete from storage_pools where id=6;

OK it seems that I had an issue yesterday where the disk filled up and this caused the DB to crash, I think it has locked journals because when I try to .save [db name] I get disk i/o error I will have to try and repair or restore the db.

OK managed to get to the point of it seemingly saving my changes, but then as soon as I start LXD, it restores the deleted records? hmm

db.bin is a temporary cache, you cannot edit this.

To apply changes, follow the instructions in our database documentation which will point you towards the patch.global.sql and patch.local.sql files to use in such cases.

https://linuxcontainers.org/lxd/docs/master/database

1 Like

OK thanks will give that a look now … :slight_smile:

OK fixed!

nano /var/snap/lxd/common/lxd/database/patch.global.sql

 delete from storage_pools_config where id=16;
 delete from storage_pools_config where id=15;
 delete from storage_pools where id=6;

sudo lxd --debug --group lxd