How to clean up left-over dispVMs?

While debugging Metadata space for pool vm-pool is running out. Current usage: 95% , I found that I apparently have storage for a lot of disposable VMs that aren’t even running anymore. I suspect that they might be left over when dispVMs were running while the battery ran empty.

$ sudo lvs -a | grep -oE vm-disp[0-9]+ | sort | uniq | wc -l
379

Storage for 379 dispVMs! I only have 3 running at the moment.

Is it safe to just delete these using LVM tools? (What command would I need to delete a single one?)

EDIT: I opened an issue about this: QubesOS#11086.

Check the cleanup script in this thread that handles removal of leftover logs and menus of non-existing qubes.

I didn’t run the script but tried reading it. I think the script doesn’t seem to do anything about the storage volumes that I’m wondering about.

I suppose you can delete the volumes, if you are sure they are unused but try with one first.

BTW, the command you provide shows 0 here. How did you end up with such a big number?

I assume it’s because I let the laptop run out of battery too often, while having lots of dispVMs open.

I guess I may need to rework the cleanup script to handle cases like yours too.

Let me know what worked for you, so I can consider it for future versions.

Does Qubes create 2 AppVM LVMs restore points by default?

sudo lvs -a | grep back

How to disable restore points?

Why not consider BleachBit similar solution for dom0?

https://github.com/bleachbit/bleachbit/blob/master/bleachbit/Unix.py

https://github.com/bleachbit/bleachbit/blob/master/bleachbit/Wipe.py

https://github.com/bleachbit/bleachbit/blob/master/bleachbit/Memory.py

Because installing applications in dom0 increases its attack surface.