LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 05-14-2013, 04:48 PM   #1
pengStudent
Member
 
Registered: Nov 2003
Location: California
Distribution: Slackware 14
Posts: 55

Rep: Reputation: 15
How can I use trim with luks+lvm on ssd?


I recently replaced my laptop HDD with an SSD and installed Slackware64 14 using README_CRYPT.TXT to setup luks+lvm. I'm trying to enable trim support, I've followed this guide http://blog.neutrino.es/2013/howto-p...m-and-dmcrypt/ but when I do a dmsetup table --showkeys I don't see discards being allowed. Have I missed a step?
 
Old 05-15-2013, 03:30 PM   #2
STDOUBT
Member
 
Registered: May 2010
Location: Stumptown
Distribution: Slackware 14.0/32bit + a T60p (2007-YS3) = YES
Posts: 260

Rep: Reputation: 60
It looks like TRIM needs /etc/crypttab to activate on dm_crypt level. That's problematic I think, because if you used the directions from the section in README_CRYPT.TXT called "Combining LUKS and LVM", then "/etc/crypttab" is not used....
Not sure where to go from here, I don't have any SSD.
Hope this helped some.
 
Old 05-15-2013, 05:00 PM   #3
pengStudent
Member
 
Registered: Nov 2003
Location: California
Distribution: Slackware 14
Posts: 55

Original Poster
Rep: Reputation: 15
Yea, I was thinking the same thing. Not sure how to make it read the /etc/crypttab file.
 
Old 05-16-2013, 02:19 AM   #4
dolphin77
Member
 
Registered: May 2009
Posts: 200

Rep: Reputation: 54
http://blog.neutrino.es/2013/howto-p...m-and-dmcrypt/

EDIT: Sorry, guys, forgot to mention. I had to hack init script in /boot/initrd-tree, in order t make it work. Probably it's time to ask Eric to add this option to his great mkinitrd package.

I changed:
Code:
/sbin/cryptsetup ${LUKSKEY} luksOpen ${LUKSDEV} ${CRYPTDEV} </dev/tty0 >/dev/tty0 2>&1
to
Code:
/sbin/cryptsetup ${LUKSKEY} luksOpen --allow-discards ${LUKSDEV} ${CRYPTDEV} </dev/tty0 >/dev/tty0 2>&1
now fstrim -v /
works for me.

EDIT2: it looks like it is better to leave everything as is (without working trim). Then periodically - once a week or monthly to boot from external drive, manually mount encrypted partitions with --allow-discards and run fstrim manually.

Last edited by dolphin77; 05-16-2013 at 06:01 AM.
 
Old 05-16-2013, 03:26 AM   #5
STDOUBT
Member
 
Registered: May 2010
Location: Stumptown
Distribution: Slackware 14.0/32bit + a T60p (2007-YS3) = YES
Posts: 260

Rep: Reputation: 60
pengStudent,
In the link you posted, username Exon (on that page's comments section) posted links to two different pages which might help. Thanks for making your post I was not aware of this issue, and was already leery of SSDs.
 
Old 05-16-2013, 11:15 AM   #6
pengStudent
Member
 
Registered: Nov 2003
Location: California
Distribution: Slackware 14
Posts: 55

Original Poster
Rep: Reputation: 15
Thanks for the insight guys. And thanks dolphin77 for the tip on using an external boot option, I'll go with this option for now.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SSD reset, TRIM? malloc Linux - Hardware 3 01-19-2013 06:13 PM
[SOLVED] Enabling TRIM on ssd jas0n Debian 6 09-08-2012 02:18 PM
ntfs-3g SSD TRIM? qrange Linux - Software 4 07-05-2012 10:00 PM
[SOLVED] RAID 1 SSD drives with TRIM grolendaves Linux - Hardware 2 06-05-2011 08:44 AM
[SOLVED] TRIM on SSD mira.mikes Linux - Kernel 8 01-08-2011 06:36 PM


All times are GMT -5. The time now is 09:54 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration