Subject: Re: [alpine-aports] [PATCH] main/mkinitfs: backport cryptdiscards patch

From: Sören Tempel <[email-masked]>
Date: Mon, 12 Jun 2017 12:55:04 +0200

On 12.06.17, Natanael Copa wrote:
> Does other distros have similar options? If so do they use
> "cryptdiscards" as bootoption too, or something else?

Yes, other distros have similar options. According to the Arch Linux
wiki[1] all systemd based initrds use `rd.luks.options=discard` for
enabling this.

Cheers,
Sören

[1]: https://wiki.archlinux.org/index.php/Dm-crypt/Specialties#Discard.2FTRIM_support_for_solid_state_drives_.28SSD.29

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Wed, 14 Jun 2017 15:27:10 +0200

On Mon, 12 Jun 2017 12:55:04 +0200

> [1]: https://wiki.archlinux.org/index.php/Dm-crypt/Specialties#Discard.2FTRIM_support_for_solid_state_drives_.28SSD.29

Arch also has:

  cryptdevice=/dev/sdaX:root:allow-discards

and apparently they also have cryptkey=... for detached header.

Gentoo[1] does:
  root_trim=yes

Debian/ubuntu stores that option in /etc/crypttab which needs to be included in initramfs.

We currently have:

cryptroot cryptdm cryptheader cryptoffset

and now we add cryptdiscard

I kind of like the old Arch Linux way better:

  cryptdevice=$cryptroot:$cryptdm:$cryptdiscard

and for detached header:

  cryptkey=$cryptheader:$cryptoffset:$size

What do you think? Should we go for:

  cryptroot=$device cryptdm=$dmname cyptdiscards=yes cryptheader=$header cryptoffset=$offset

or should we do:

  cryptdevice=$device:$dmname:allow-discards cryptkey=$header:$offset

-nc

[1]: https://wiki.gentoo.org/wiki/Dm-crypt_full_disk_encryption#Genkernel.2FGenkernel-next

---

---

From: Sören Tempel <[email-masked]>
Date: Wed, 14 Jun 2017 23:44:34 +0200

>   cryptdevice=$device:$dmname:allow-discards cryptkey=$header:$offset

Honestly I don't have a strong opinion on this. I believe the latter is
harder to read and besides we would break backwards compatibility if we
would switch to this scheme.

Do you have an opinion on this? Would you like to switch to the latter?

Sören.

---