After performing an encrypted install of elementary on an SSD, the TRIM command will not work on the root partition because it's missing a configuration option.
Steps to Reproduce
Install elementary, selecting the default encrypted setup the installer offers.
Run sudo fstrim -av
Expected Behavior
Expected output of sudo fstrim -av:
/boot/efi: 251,7 MiB (263872512 bytes) trimmed on /dev/nvme0n1p1
/boot: 11,2 MiB (11714560 bytes) trimmed on /dev/nvme0n1p2
/: 3,3 GiB (3517906944 bytes) trimmed on /dev/mapper/data-root
Actual output of sudo fstrim -av:
/boot/efi: 251,7 MiB (263872512 bytes) trimmed on /dev/nvme0n1p1
/boot: 11,2 MiB (11714560 bytes) trimmed on /dev/nvme0n1p2
What Happened?
After performing an encrypted install of elementary on an SSD, the TRIM command will not work on the root partition because it's missing a configuration option.
Steps to Reproduce
sudo fstrim -av
Expected Behavior
Expected output of
sudo fstrim -av
:Actual output of
sudo fstrim -av
:Expected contents of
/etc/crypttab
:Actual contents of
/etc/crypttab
:Currently TRIM is only working on the boot partitions. It's important to let the TRIM command pass through to the root partition too.
To fix this:
/etc/crypttab
and add the missing discard option to thecryptdata
entry.sudo update-initramfs -u -k all
(reference).OS Version
6.1 (Jólnir)
Software Version
Latest release (I have run all updates)
Log Output
No response
Hardware Info
No response