You are not logged in.

#1 2019-10-16 19:13:18

Alber
Member
From: Spain - España
Registered: 2011-11-11
Posts: 227

[SOLVED] crypttab option discard is allow-discards

Hello.

I think that in the wiki:

    https://wiki.archlinux.org/index.php/Dm … ives_(SSD)

Where it says:

    For LUKS devices unlocked via /etc/crypttab use option discard, e.g.:

/etc/crypttab

luks-123abcdef-etc UUID=123abcdef-etc none discard


The option should be: allow-discards

Could someone with more knowledge than me verify and change it?

Thanks smile

Last edited by Alber (2019-10-17 17:19:50)


Because not all of us are native English speakers, try no to use slang or abbreviations, thank you.

Offline

#2 2019-10-16 19:28:32

frostschutz
Member
Registered: 2013-11-15
Posts: 1,658

Re: [SOLVED] crypttab option discard is allow-discards

`man crypttab` says it's `discard`

for cryptsetup it would be --allow-discards but cryptsetup is not the one reading the crypttab so it's not the same

Offline

#3 2019-10-16 19:28:39

loqs
Member
Registered: 2014-03-06
Posts: 19,098

Re: [SOLVED] crypttab option discard is allow-discards

Have you tested it with your proposed change?  Did you check man 5 cryptab?

crypttab wrote:

       discard
           Allow discard requests to be passed through the encrypted block
           device. This improves performance on SSD storage but has security
           implications.

Offline

#4 2019-10-16 20:28:09

Alber
Member
From: Spain - España
Registered: 2011-11-11
Posts: 227

Re: [SOLVED] crypttab option discard is allow-discards

Using the option discard in /etc/crypttab. When I tried to do a  fstrim -v /home  the result was: the discard operation is not suported
In the other partitions not encrypted it worked.

# fstrim -v /home
fstrim: /home: the discard operation is not supported

I was looking for and trying several things until changing discard for allow-discards it began to work.

Now, in dmsetup table too appears allow-discards.

# dmsetup table
home-crypt:  0 blah....blah   allow_discards

Maybe it is something related only to fstrim.

Last edited by Alber (2019-10-16 20:29:45)


Because not all of us are native English speakers, try no to use slang or abbreviations, thank you.

Offline

#5 2019-10-16 21:34:30

frostschutz
Member
Registered: 2013-11-15
Posts: 1,658

Re: [SOLVED] crypttab option discard is allow-discards

combing through the systemd source code, it seems like: both should work. but only "discard" is documented.

maybe a typo before? e.g. it accepts discard, allow-discards but not discards

edit: oh, and it should log a warning message "Encountered unknown /etc/crypttab option 'xyz'"

Last edited by frostschutz (2019-10-16 22:05:52)

Offline

#6 2019-10-17 06:17:11

Alber
Member
From: Spain - España
Registered: 2011-11-11
Posts: 227

Re: [SOLVED] crypttab option discard is allow-discards

I have put the discard option and it works too.

Surely it must have been my mistake when writing discards instead of discard.

Sorry and thanks for your time.

Later I will search in the logs.


Because not all of us are native English speakers, try no to use slang or abbreviations, thank you.

Offline

Board footer

Powered by FluxBB