Crypttab discard option on LVM over LUKS

This forum is dedicated to testing early releases and cauldron : Howtos, tips, tricks and user global feedback and thoughts...

Helpful tip :
For bugs tracking we use : https://bugs.mageia.org = The Mageia Bug Tracker
In this bug tracker you'll find already reported bugs and you'll be able to report those you have found....

Crypttab discard option on LVM over LUKS

Postby Northsoft » Jun 28th, '20, 13:06

Hello, I've set up a LUKS encrypted partition, and a LVM group with home and root partitions there.
Then I've found out that fstrim command says that operation is not supported on encrypted volumes.
I've added a discard option to /etc/crypttab file and called dracut --force command.
Also I've added a discard option for every record of encrypted volumes at /etc/fstab file.
After reboot the fstrim command still says that operation is not supported on encrypted partitions.
The dmsetup command says nothing about discard option.

When I've booted into a live USB OS, I've mounted every partition manually, using cryptsetup --allow-discards and mount -o discard. The fstrim and e2fsck -E discard worked OK.

How should I allow automated TRIM command bypassing if I use LVM over LUKS?

Mageia 8 alpha.
Last edited by isadora on Jun 28th, '20, 13:48, edited 1 time in total.
Reason: Topic moved into appropriate sub-forum.
Northsoft
 
Posts: 33
Joined: Dec 18th, '12, 19:22
Location: Novosibirsk, Russia

Re: Crypttab discard option on LVM over LUKS

Postby doktor5000 » Jun 28th, '20, 17:01

Do you have issue_discards = 1 in /etc/lvm/lvm.conf ? Also check whether you have rd.luks.options=discard in your initrd, same for all the other options (from crypttab and fstab)
Apart from that, this has been discussed previously in quite some detail in viewtopic.php?f=7&t=9732 and also in https://bugs.mageia.org/show_bug.cgi?id=19086

You may want to read those, and if you get it to work, would be appreciated if you could edit https://wiki.mageia.org/en/Installation_on_a_SSD_(Solid_State_Drive)#The_fstrim_command accordingly with your findings.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Crypttab discard option on LVM over LUKS

Postby Northsoft » Jun 30th, '20, 19:29

Steps I performed:
— added rd.luks.options=discard to /etc/default/grub;
— called grub2-mkconfig -o /boot/grub2/grub.cfg;
— set issue_discards = 1 to /etc/lvm/lvm.conf;
— checked discard option in /etc/crypttab;
— added rd.luks.allow-discards to /etc/dracut.conf.d/52-northsoft-discard.conf;
— called dracut -f;
— rebooted;
— called fstrim /: «fstrim: /: the discard operation is not supported»
Northsoft
 
Posts: 33
Joined: Dec 18th, '12, 19:22
Location: Novosibirsk, Russia


Return to Testing : Alpha, Beta, RC and Cauldron

Who is online

Users browsing this forum: No registered users and 1 guest

cron