Boryeu Mao:
> Boryeu Mao:
> > For the template install command on Qubes release 4.2.3
> >
> > sudo qubes-dom0-update qubes-template-fedora-40-minimal
> >
> > I received a message that
> >
> > fstrim: /var/tmp/tmpsd1ns61v/var/lib/qubes/vm-template: the discard
> > operation is not supported
>
> Did you maybe mount a tmpfs at /var/tmp?
[...] no manual tmpfs mount.
I assume you're seeing the same "not supported" message if you run:
$ sudo fstrim /var/tmp/
The only thing I can think of is that you have custom partitioning,
and the storage layer immediately underneath the filesystem hosting
/var/tmp/ is dm-crypt (unusual for an LVM Thin installation), and
dm-crypt has been mapped with discard disabled.
Your storage tree (showing discard support) can be printed with:
$ lsblk --output +DISC-MAX
> qvm-template-postprocess: call fstrim after removing image file · QubesOS/qubes-core-admin-client@4a9b57f · GitHub
In the qvm_template_postprocess.py (which the above link points to), fstrim
is called only if the root user does the template install.
To me this looks like something that was missed in the move to
qvm-template:
Previously, qubes-dom0-update (which had to be run as root) would
install templates as normal RPM packages. I guess the logic to skip
fstrim for non-root users might have been put there to ease testing
the qvm-template-postprocess tool? CCing Marek
Then qvm-template was created (which like other qvm- tools usually
runs as a regular user) and now fstrim is skipped unless someone
happens to invoke qvm-template as root. Skipping seems like a bug, but
on R4.2 systems it's mitigated by the installer adding the 'discard'
mount option for the dom0 root filesystem, making fstrim redundant.
Except for people who installed via qubes-dist-upgrade or removed the
mount option. For those, there's still the systemd fstrim.timer that
should release the space to LVM, hopefully soon enough (weekly).
Finally, you've used qubes-dom0-update, which nowadays calls
qvm-template for template related stuff. For this, qubes-dom0-update
can actually be run as non-root, but you ran it with sudo, so fstrim
was *not* skipped. (Which then failed on on your system.)
Thank you very much for helping.
Happy to. It's interesting
Rusty