qubes-doc/DiskTRIM.md
Marek Marczykowski-Górecki b917a96ed3 DiskTRIM changed
2014-05-11 16:03:56 +00:00

1.1 KiB
Raw Blame History

layout title permalink
wiki DiskTRIM /wiki/DiskTRIM/

VMs have already TRIM enabled by default, but dom0 doesn't. There are some security implications (read for example this article), but IMO not very serious.

To enable TRIM in dom0 you need:

  1. Get your root device UUID:

    blkid /dev/mapper/*root
    
  2. Add entry to /etc/crypttab (replace <UUID> with the device UUID):

    luks-<UUID> UUID=<UUID> none allow-discards
    
  3. Add rd.luks.allow-discards=1 to kernel cmdline (/etc/default/grub, GRUB_CMDLINE_LINUX line)

  4. Rebuild grub config (grub2-mkconfig -o /boot/grub2/grub.cfg)

  5. Rebuild initrd in hostonly mode:

    dracut -H -f
    
  6. Add "discard" option to /etc/fstab for root device

  7. Reboot the system, verify that allow-discards is really enabled (dmsetup table)

There is a bug affecting allow-discards option, once it will be fixed, first two steps will be no longer needed.