That should work, but I haven’t tested it. Let us know
No need. Shutting down an AppVM automatically deletes its root volume snapshot.
I wouldn’t go as far as calling it unwise. You can definitely get a nice performance improvement just by defragmenting the outer Btrfs layer.
But it you want to do the inner filesystem first, ext4 supports online defrag: It’s sudo e4defrag /
in the TemplateVM for the root volume, or sudo e4defrag /rw
in the AppVM for the private volume. If you add -c
to the e4defrag
command it will (only) check if the inner defragmentation is even necessary. It will usually show very very low fragmentation for the root volume, because from the inside view it’s a filesystem containing a bunch of small files and there’s hopefully plenty of free space.
(Never run e4defrag
or any other inner-filesystem utilities on the VM volumes in dom0)
Yes. In the context of a TemplateVM: If you have a clone of it, or a StandaloneVM created from it, defragmenting the root volume of the original TemplateVM (or of its clone, or of the StandaloneVM) will waste disk space.
These instructions also apply, but with root
instead of private
:
For the same reason, if you’ve made any whole-filesystem snapshots in dom0 (containing your VM volume image files) you may want to delete them before defragmentation.
Personally I never bother defragging my TemplateVMs: Just recreating them whenever a new version appears in qvm-template
(instead of upgrading the distribution in-place) keeps fragmentation in check.