LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 03-09-2022, 04:48 AM   #1
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,407
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Question SSD TRIM for LUKS encrypted LVM partitions in Slackware


Hi all

I followed the Slackware way (README_CRYPT.TXT and README_LVM.TXT) for my laptop.

Since 15.0 arrival, I did a fresh install and set up decryption at boot for old lvm/crypt disk and since these 2 disks are SSD, I wanted to have your advice on a few questions :
  • Should I neglect the 'security breach enabling TRIM on encrypted volume ?
  • Shall I bother with TRIM ?
  • Is the mkinitrd.conf option LUKSTRIM enough ?
  • How do I properly set TRIM for LUKS on LVM ?

Thanks for your enlightments !
 
Old 03-09-2022, 11:41 PM   #2
BigTig
Member
 
Registered: Aug 2015
Posts: 61

Rep: Reputation: Disabled
I've been using lvm on luks for my laptops for a few years and the LUKSTRIM option in the mkinitrd has been fine.
I just add a cron job to run fstrim weekly and that's about it.
 
1 members found this post helpful.
Old 03-10-2022, 02:55 PM   #3
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,407

Original Poster
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Thank you for your input !

Could you share the cron job you use ?
 
Old 03-10-2022, 03:12 PM   #4
BigTig
Member
 
Registered: Aug 2015
Posts: 61

Rep: Reputation: Disabled
Sure!

I just put the fstrim command in a short shell script that I place in the /etc/cron.weekly directory.

Code:
 #!/bin/bash
LOG=/var/log/TrimFS.log
DATE=$(date +%m-%d-%Y-%I:%M%p)

echo "----------$DATE--------" |tee -a $LOG
fstrim -a -v | tee -a $LOG
echo "------------------------------------" | tee -a $LOG
I like to keep a log of stuff for troubleshooting purposes, so you could just use the fstrim command and be done with it.
 
5 members found this post helpful.
Old 03-10-2022, 04:14 PM   #5
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,407

Original Poster
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Adapted and tested :-)
Perfect, thanks !
 
  


Reply



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
[SOLVED] A question about SSD and trim with luks. camerabambai Slackware 5 11-20-2020 10:14 AM
Is LUKS far more secure on a HDD than on a SSD with Trim? linustalman Linux - Security 3 06-24-2017 02:55 PM
adding --allow-discards to cryptsetup in initrd to allow TRIM in LVM/encrypted SSD mostlyharmless Slackware 1 12-05-2013 07:51 PM
How can I use trim with luks+lvm on ssd? pengStudent Slackware 5 05-16-2013 11:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:28 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration