Concerning SSD on Qubes OS, in /etc/fstab besides the auto enabled TRIM, where else should I add discard and say noatime? Example of my StandaloneVM in which I've commented out the swap and added discard and noatime on /dev/xvdb as I see it as a partition of itself like dmroot - or am I doing something wrong here?

/dev/mapper/dmroot /              ext4   defaults,discard,noatime        1 1
/dev/xvdb          /rw            auto   noauto,defaults,discard,noatime 1 2
/rw/home           /home          none   noauto,bind,defaults            0 0
# /dev/xvdc1       swap           swap   defaults                        0 0
tmpfs              /dev/shm       tmpfs  defaults,size=1G                0 0
devpts             /dev/pts       devpts gid=5,mode=620                  0 0
sysfs              /sys           sysfs  defaults                        0 0
proc               /proc          proc   defaults                        0 0
xen                /proc/xen      xenfs  defaults                        0 0
/dev/xvdi          /mnt/removable auto   noauto,user,rw                  0 0

I've also already enabled TRIM on dom0.


With Qubes R3.1 and later its generally not necessary to manually configure TRIM; The Fedora-based installer should enable it automatically at both the filesystem and block device level in dom0. Template-based VMs will have it enabled for /rw by default as well (whereas / root is immutable here and doesn't apply).

In Qubes 3.x, Standalone VMs are an exception in that they behave too much like templates in this regard, so its usually necessary to add discard to the /dev/mapper/dmroot entry in /etc/fstab. That volume plus /dev/xvdb are main the ones that benefit from discard, although its also possible to specify discard for swap.

You can also manually TRIM volumes in standalone VMs like so:

sudo fstrim -v /
sudo frtrim -v /rw

TRIM-ing the / root filesystem in templates is another matter due to their block device constraints in Qubes 3.x. A dom0 tool called qvm-trim-template <template name> is designed to trim template root volumes.

Qubes R4.0 will have a new storage scheme which utilizes LVM thin provisioning (and over-provisioning) to achieve similar capabilities with greater flexibility. One notable difference is that discard is supported in most or all VM volumes, including template (even template-based) root volumes. As a result, it makes sense to use discard as an option in /etc/fstab wherever you might find it on a regular Linux installation.

PS: The way you have noatime on / and /rw looks optimal.

  • Added Qubes R4.0 detail.
    – tasket
    Dec 29 '17 at 1:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.