Lv of a qube takes more space than filesystem on it

I just moved to qubes and still migrating my old vms to it. I loaded vmdks onto a temporary vault domain. After converting one of them into raw, creating standalone dom and removing copy of raw from the temporary vault, I noticed that now my vault takes 47 GiB, although the /home filesystem on it takes ~26 GiB. Why?

Yes, I removed the raw using rm and there is no wastebasket I am aware of.

Only /home should take space since everything else is a part of the template, right?

p.s. While writing it, disk usage displayed in the Total Disk Usage applet dropped ~70 GiB. I guess something has significant delay and changes don’t show up immediately. Still, my temporary vault takes 47 GiB both in qube manager and in sudo lvs output.

p.p.s Output of sudo lvs is different compared to used pool space in Total Disk Usage applet and Qube Manager, both before and after the 70 GiB drop. Output of sudo lvs shows approximately 365. Before applet displayed 385 GiB used and now it shows 315. I believe that I am calculating something wrong since I just add all volume sizes in a spreadsheet except for dom0-related stuff, weird volumes with numbers and -back at the end, and the pool itself. Is there a better way of doing it?

The Qubes OS is storing 1 old revision of the all volumes, so when you’ve restarted vault qube a few times the old revision which still had the raw image was removed and replaced with the one where you’ve removed the raw image.

Not sure how LVM works, but I guess it’s not the real space that vault volume consumes but just the maximum to which it was expanded.


Okay, I found this: linux - volume group out of space. How do I reclaim it? - Server Fault

The amount of free space on your volume group will not change. It’s all allocated by the filesystem you’ve formatted it with. Deleting files will only remove their inode entries from the filesystem, but the filesystem will still claim the space.

The only way to reclaim space in your volume group is to resize or delete logical volumes.

It seems like as long as whatever filesystem one has supports shrinking, reclaiming logical volume space should be possible.

But the possibility itself raises two questions:

  1. Is it even useful? Qubes may be aware that some space is not actually used, which explains the difference between sudo lvs output and what applet and Qube Manager tell us.
    • Actually it doesn’t. If it is so, how come my Qubes Manager still shows that 47 GiB is used by the vault?
  2. If it is useful, can manual edit of volumes and filesystems break something?

Maybe you need to use fstrim to free up the space (if it’s not already configured by default):

1 Like

Yep disk trimming is on weekly, hopefully will recheck in a week

No need to wait if you run systemctl start fstrim inside the VM.

After that, to get rid of the old revisions pointed out by @apparatus (which can be listed with qvm-volume info VMNAME:private in dom0) you can simply start and stop the VM a few times.

1 Like

Oh yeah you are absolutely right.

The situation is resolved by trimming domU’s filesystem.