qubes 4 qvm-trim not exist

442 views
Skip to first unread message

Roy Bernat

unread,
Jan 7, 2018, 1:48:48 PM1/7/18
to qubes-users
Hi All ,

What is the best practice to trim disk inside qubes 4 .

the qvm-trim-template dont exist anymore .

R

Yuraeitha

unread,
Jan 7, 2018, 2:40:28 PM1/7/18
to qubes-users

Basically, it's no more. Better explained here;

Quote: "Qubes R4.0 will have a new storage scheme which utilizes LVM thin provisioning (and over-provisioning) to achieve similar capabilities with greater flexibility." Follow link for source and further details - https://unix.stackexchange.com/questions/315345/using-ssd-on-qubes-os

Also, as per my current understanding, this automated trimming feature was not fully developed after Qubes 4 RC-1 was released, but has gradually been refined and perfected till this day. But there are still some issues, i.e. no visual interface to show your overall disk space useage (the other month, you had to pull and combine several commands to make it show accurately). I'm not sure if this disk space useage reporting issue has been fixed today though.

Andrew David Wong

unread,
Jan 7, 2018, 3:30:39 PM1/7/18
to Roy Bernat, qubes-users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
You can use the `fstrim` command in the TemplateVM:

$ sudo fstrim -v /

- --
Andrew David Wong (Axon)
Community Manager, Qubes OS
https://www.qubes-os.org

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEZQ7rCYX0j3henGH1203TvDlQMDAFAlpSg2AACgkQ203TvDlQ
MDAlIQ//dJsCrtqcQ5iOWiZd2iDmhGv/SlE0R4omxq8W6d4kUGJfhZ2mLbedoRBs
9nz4AqnQhfdOy8HLoYtAKXosO8dbEkZDDkQO6lTua0nUnrEEOar9r8QBuNWq8Ihe
VQ97sIFAvxJ0Q4LAwiTjfp+8ciFcyzAbDOePsf+z9wGGanQuNxtGAep8FZkE8EWl
7LnA+9Kl4F24BwdsYLEVIlKhtcitHoGmn3vVzE/yZ7Ouyuzt4tNj3jkwh1n6KNT6
aqiBIVsD/bqfaDANwxZyQxOPtigW63gm4t4EZZeVarjWNo1OsmFyuRJk+s6gIB5b
4Zez8QZgKiVwi/isSNLxRejJ8qMEkPHEMWIblQPVa9eBlUTEP6SFok7MRJY14TmQ
qR+L5I7WT6OAXAujIrvw1phiAwW/uY5t2WGNdLXELk+M2ycBme4te5dV6hhuG6Iy
f8ayZXwWg/cUHYGbWSLlTNAhf1L40VQ9EfaRYDoujZdwBt64YSO1Q2I09SZKkW2Z
yRP0tHXENebaYnCRqPYyp5xE40uKcvggfRdHDVqlNukgnH4aXkl7P3153Yo/j7bj
aCulOGO1PjRsEKPNNx4oT4fKB1GAGqX5cuaITkhAcbFX9Hbicw6y3AVnqSIk9Fee
15Sd+D297E6SgZ5rQdIVqymWsAYjd65BmYST9+xMq3+hpznjvOA=
=BJL6
-----END PGP SIGNATURE-----

Roy Bernat

unread,
Jan 7, 2018, 3:45:58 PM1/7/18
to qubes-users

Hi

fstrim: /: the discard operation is not supported

Tom Zander

unread,
Jan 7, 2018, 3:48:51 PM1/7/18
to qubes...@googlegroups.com, Yuraeitha
On Sunday, 7 January 2018 19:40:27 GMT Yuraeitha wrote:
> But there are still some
> issues, i.e. no visual interface to show your overall disk space useage
> (the other month, you had to pull and combine several commands to make it
> show accurately). I'm not sure if this disk space useage reporting issue
> has been fixed today though.

* https://github.com/QubesOS/qubes-issues/issues/1872
(open) Implement UI Notifications for cases of a Qube disk full

* https://github.com/QubesOS/qubes-issues/issues/1053
(open) Improve usability of VM disk space / increasing disk size

* https://github.com/QubesOS/qubes-issues/issues/3438
(open) Qubes storage pools of type LVM issues

This one is closed, but as I point out in the collection of issues (3438)
this is not yet fixed;
https://github.com/QubesOS/qubes-issues/issues/2016
(closed) Create dom0 API to detect global disk space available

And, yeah, it also still needs a user-interface.


The simplest way to get the space usage if you are using a LVM based pool
(which requires completely manual setup at the moment) is
sudo lvs
and you can read under the column "Data%" how much actual usage you reached.

--
Tom Zander
Blog: https://zander.github.io
Vlog: https://vimeo.com/channels/tomscryptochannel


Yuraeitha

unread,
Jan 7, 2018, 5:08:58 PM1/7/18
to qubes-users

Neat collection you put together here, gives a better understanding where we are at indeed. I suppose (partly guessing here) that "sudo lvs" works for both "LVM" and "LVM Thin" FS-formats? I can only check LVM atm as I'm currently not using "LVM Thin".

As for discard to be supported, I suppose it has to be enabled during the mounting process, such as in the fstab? Thinking more align the need to solve the issue the original posters response regarding lack of discard support, up above. Could a solution really be that simple as to put it into the fstab though, or is there more to it?

Marek Marczykowski-Górecki

unread,
Jan 7, 2018, 5:36:41 PM1/7/18
to Roy Bernat, qubes-users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Sun, Jan 07, 2018 at 12:45:58PM -0800, Roy Bernat wrote:
> On Sunday, 7 January 2018 22:30:39 UTC+2, Andrew David Wong wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA512
> >
> > On 2018-01-07 12:48, Roy Bernat wrote:
> > > Hi All ,
> > >
> > > What is the best practice to trim disk inside qubes 4 .
> > >
> > > the qvm-trim-template dont exist anymore .
> > >
> > > R
> > >
> >
> > You can use the `fstrim` command in the TemplateVM:
> >
> > $ sudo fstrim -v /
>
> Hi
>
> fstrim: /: the discard operation is not supported

Strange, it should work. And on my system it works...

Anything special in your configuration? Have you chosen non standard
partitioning or such?
Maybe you don't have LVM thin based storage? You can check that for the
template using (adjust template name):

qvm-volume ls fedora-26

The storage pool used will be in the first column, for example:

POOL:VOLUME VMNAME VOLUME_NAME REVERT_POSSIBLE
linux-kernel:4.9.56-21 fedora-26 kernel No
lvm:qubes_dom0/vm-fedora-26-private fedora-26 private No
lvm:qubes_dom0/vm-fedora-26-root fedora-26 root No
lvm:qubes_dom0/vm-fedora-26-volatile fedora-26 volatile No

Here you see "lvm" pool.

If you want, you can dig further: qvm-pool -i lvm

name lvm
driver lvm_thin
size 486585401344
thin_pool pool00
usage 347665269260
volume_group qubes_dom0

- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAlpSoNgACgkQ24/THMrX
1yzwzgf/Wl7+PDptZ0i9HN5viuSmQk0W5EeBawQ9CIJHseCGAqPLLvRToSRPBF9f
vRPZv7HHAf0xoY7TPnBygjUAgb+u30rbGdpFafBwDugyzy8ojDLZvOZXgxaOiegn
M27tjwX6i6Wpc83gh+HwIB4ARJua2gBOS0ULDXJBZZ4y1WoVN0fvr3RiDRGWhpYH
1QutmKGR4Cwz0D1KoEP1qhCiew9BQ2NS1SSCk4dgncZcAnnSCrLR+9WDmirZRl2U
2AbxMdFXMvFfsmXCiTyq/dw3H0N9c6Litq0KPcowkXxhXx24vQo7fjLJGKpFrOEv
KuN+RRcMchphkF87AoVASm+G0rTzLA==
=DGsq
-----END PGP SIGNATURE-----

Yuraeitha

unread,
Jan 8, 2018, 11:14:52 AM1/8/18
to qubes-users
Out of curiosity I checked my own system too (I'm running LVM, not LVM Thin).

"
[user@fedora-26 ~]$ sudo fstrim -v /
fstrim: /: the discard operation is not supported
[user@fedora-26 ~]$
"

"
user@debian-8:~$ sudo fstrim -v /
fstrim: /: the discard operation is not supported
user@debian-8:~$
"

Dom0 was pretty much identical as the two examples above too.

Is LVM Thin the preferred FS-format on Qubes 4 over regular LVM?
Also, possibly this might be because I'm using LVM and not LVM Thin, but I get python errors when I execute "qvm-pool -i lvm" in dom0. The command does not exist in fedora-26 or debian-8 template. But I guess it must be a dom0 specific command. Below is the python error from dom0.

[user@dom0 ~]$ qvm-pool -i lvm
Traceback (most recent call last):
File "/usr/bin/qvm-pool", line 5, in <module>
sys.exit(main())
File "/usr/lib/python3.5/site-packages/qubesadmin/tools/qvm_pool.py", line 146, in main
args = parser.parse_args(args, app=app)
File "/usr/lib/python3.5/site-packages/qubesadmin/tools/__init__.py", line 387, in parse_args
action.parse_qubes_app(self, namespace)
File "/usr/lib/python3.5/site-packages/qubesadmin/tools/__init__.py", line 312, in parse_qubes_app
pools = [app.pools[name] for name in pool_names]
File "/usr/lib/python3.5/site-packages/qubesadmin/tools/__init__.py", line 312, in <listcomp>
pools = [app.pools[name] for name in pool_names]
File "/usr/lib/python3.5/site-packages/qubesadmin/base.py", line 309, in __getitem__
raise KeyError(item)
KeyError: 'lvm'
[aki@dom0 ~]$


So I'm guessing the solution would possibly be to re-install it all, but instead pick LVM-Thin as the FS-format? I'll gladly sign up to be up for being a guinea-pig and re-install Qubes 4 on LVM-Thin instead of LVM, (additional difference would be Qubes RC-2 fully updated to Qubes RC-4), to test it out if it makes a difference. Or maybe use Qubes RC-2 again for accuracy if it matters? Albeit I'm unsure if there is any value in such a test, and or whether systemdata is needed from before/after re-install.

awokd

unread,
Jan 8, 2018, 11:29:43 AM1/8/18
to Yuraeitha, qubes-users
On Mon, January 8, 2018 4:14 pm, Yuraeitha wrote:

> [user@fedora-26 ~]$ sudo fstrim -v /
> fstrim: /: the discard operation is not supported

Not entirely sure it will propagate upwards but try setting dom0
/etc/lvm/lvm.conf issue_discards = 1 and reboot.


Reply all
Reply to author
Forward
0 new messages