I'm confused between the various ways that LUKS/dmcrypt/cryptsetup discard /TRIM operations can be enabled via the Linux kernel command line.
The
dracutmanpage:rd.luks.allow-discardsAllow using of discards (TRIM) requests on all LUKS partitions.
The
systemd-cryptsetup-generatormanpageluks.options=, rd.luks.options=... If only a list of options, without an UUID, is specified, they apply to any UUIDs not specified elsewhere, and without an entry in /etc/crypttab. ...
The argument
rd.luks.options=discardis recommended here.The Arch wiki section on LUKS and SSDs shows a third colon-seprated field:
cryptdevice=/dev/sdaX:root:allow-discards
Questions:
- What is the difference between
discardandallow-discards? Is the former mandatory and the second optional? - Will
luks.options=orrd.luks.options=apply givencryptdevice=/dev/sda2(eg not a UUID)? What ifcryptdevice=is given a UUID, does that count as "specified elsewhere"? - Will
luks.options=orrd.luks.options=overwrite / append / prepend ifcryptsetup=already gives options? - Is there any disadvantage to using
rd.luks.allow-discardswhich seems to be simplest if TRIM is wanted everywhere?