-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Wed, Oct 16, 2024 at 04:28:14PM +0000, Rusty Bird wrote:
> Marek Marczykowski-Górecki:
> > Maybe? You do need root for calling fstrim. And not calling it isn't
> > really huge deal, as you explain below. And it failing shouldn't
> > interrupt install anyway (subprocess.call, not subprocess.check_call).
> > But the error message indeed may be confusing.
> > Theoretically, sudo could be used for this call and that would be fine
> > in dom0, but possibly less so in a qube (yes, you can install templates
> > via Admin API from a qube), especially is passwordless-root package is
> > not installed...
> 
> Ah okay, that answers why not 'sudo fstrim'. Also, on file-reflink
> systems, where the dom0 root filesystem is storing (possibly many
> terabytes worth of) VM volumes, fstrim can take really long. E.g.
> here on my main Btrfs system, which is otherwise quite fast:
> 
>     # time fstrim /var/tmp/
>     real      4m29.240s

But that takes long only if there is really a lot of data to discard,
no? If there is fstrim.timer, there shouldn't be that much to discard
(can be some GB, but that shouldn't take this long). Is it different on
btrfs?

> So now I'm thinking fstrim is overkill just to install a template.
> Instead, maybe Salt or something could ensure that everyone (including
> people who installed via qubes-dist-upgrade) has the 'discard' mount
> option (or 'discard=async' for Btrfs, where that would be the default
> on modern kernels if not overridden by 'discard[=sync]') unless a user
> has explicitly added 'nodiscard'.

If anything, maybe the dist-upgrade tool could take care of it.

> > > 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).
> 
> Rusty
> 

- -- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmcP/Z8ACgkQ24/THMrX
1yxDMAf6AxXjfV5Cf7YAxw/QLYCX+yiOh1ehSyOVBh7jPVbFk//9wv6uwokmi98V
JN+yrxDrRIFleWqGDdJwIdB05jXo9Uv/PVZdFXPMnWymcje61i9FYsdvvBuUQ3WJ
cQEiCrotTAlRn94j2j5w5SZ5OxLLixwyDXrBZLCr2vzNZoPkjeQiWGQSHMFFLTC2
wBzvUc8lqPRE2yjig52coa7tG/d2UTQFJoxePX+CR8u2P46j4/AxFhUp2LDCo+3D
ZLuhY6aBOMMuoY8dB8r6SjKUxaKAYh6OdS6emf67KBvFkRSSpJQLY5PwulYAzPss
WGNOFWbpogffVVnTgtSZ4cZo3+QpsQ==
=O16W
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/Zw_9n5TdFi4SFZmZ%40mail-itl.

Reply via email to