elementary / triage

Catch-all repo for issues that don't have a better home
https://elementary.io
4 stars 2 forks source link

Missing 'discard' option for encrypted device in /etc/crypttab #108

Closed o-alquimista closed 1 year ago

o-alquimista commented 2 years ago

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

  1. Install elementary, selecting the default encrypted setup the installer offers.
  2. 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

Expected contents of /etc/crypttab:

cryptdata UUID=51f61b21-5e03-4446-a244-6c399769f909 none luks,discard

Actual contents of /etc/crypttab:

cryptdata UUID=51f61b21-5e03-4446-a244-6c399769f909 none luks

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:

  1. Edit /etc/crypttab and add the missing discard option to the cryptdata entry.
  2. Rebuild the initramfs sudo update-initramfs -u -k all (reference).
  3. Reboot.

OS Version

6.1 (Jólnir)

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

No response

o-alquimista commented 1 year ago

Moved to https://github.com/elementary/installer/issues/674