Cleaning up dom0 (and domU's)

I have around 40 vms (templates, cloned modified templates, many proxy vms, multiple use case appvms, at least 6 or 7 dispVM’s. When i leave a disposable vm, its name is found in mulitple sections of dom0 eg. /var/log/libvirt/libxl /var/log/qubes /var/log/xen/console, this also applies to vm’s of any type that i have completely deleted. i’m fairly sure there are others as i saw a post related to this a couple of months ago that I am now unable to locate.

In addition, in kmenuedit, deleted qubes entries names still appear.

Is there a way to clean up all these garbage files? I do not want logs of my disposble vm’s anywhere nor my deleted vms? If so, is there a way to automate this process.

Many thanks.

1 Like

I am trying to do the same but in my version 4.0.x. Would be nice to clean house and reclaim space…

Maybe there just isn’t a way to do it yet…

I ran in dom0…
sudo dnf clean all

It removed 7 files,what they were and size i couldn’t tell you…

1 Like

Wow, I didn’t realize how much logs I had lying around…

I was able to get a list of all log filenames older than 30 days using:

sudo find /var/log '(' -iname '*.log' -o -iname '*.log-*' -o -iname '*.log.old' ')' -mtime '+30' -exec echo '{}' \+

To actually remove the logs, replace echo with rm. Use at your own risk.

yes, its the “at your own risk” part that bothers me, i have before deleted too many. My point really is, what the hell are any of them doing there? disposable vm’s should vanish from everywhere once they have been closed, not kept permenent logs of. Really i’m after either a way to change the settings in dom0 to stop storing such logs, or requesting the feature to sanitize dom0 of old redundent logs of dispvms and deleted vms…

i would guess that they would be package files from the dnf cache. It won’t have done anything to the /var/log contents…

Maybe this and install on fedora…

But i think the issue lays with dom0 and we shouldn’t install to dom0 ( the coveted land)

1 Like

I would not go down that road at all, as far as I know, qubes 4.1 has the trim function enabled on ssd’s (if i’m wrong about this, please someone correct me) by default. The issue here is the amount of logging of activities of domU’s done in dom0, leaving trailsl of information behind (for example the timestamps of when a qube was used), A qubes devoloper may know why its neccesary to keep log files of disposable vm’s, but I can’t see what it could be, likewise with qubes that have been completely deleted by the user. Apart from minmal essential logging (to seek errors in journalctl for example). i’d rather the logs were very minimal, and of course, i’m only referring to /var/log directory. I do not know if there are other areas of dom0 that retain uneccesary data from dispVM’s and deleted VM’s.

1 Like

thank you, that is the exact post i read back in april.

Is it ok to use secure-delete with NVMe?
I saw there is saying to use it only with HDD

Don’t know