LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 01-08-2011, 05:11 AM   #1
mira.mikes
LQ Newbie
 
Registered: Dec 2008
Posts: 21

Rep: Reputation: 0
TRIM on SSD


Hello all,

Let's say I will have kernel supporting TRIM >=2.6.33 and file system EXT4
and SSD disk of course
I don't understand how TRIM command will be initialized.
Should I run some command from time to time or it is triggered in boot time, or it is triggered on every deleting and I don't need care at all?

Thank you for answer

mira
 
Old 01-08-2011, 07:05 AM   #2
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 871
Blog Entries: 9

Rep: Reputation: 103Reputation: 103
from what I've understood, you need to mount ext4 with the "discard" option. from docs
Quote:
discard Controls whether ext4 should issue discard/TRIM
. Thus TRIM is enabled at mount time, and you have to do nothing else.

In case you want some more info about SSDs in Linux, this is a nice read. I *strongly* recommend you mount all temporary directories as a tmpfs(as its done in the guide) to prevent lots of useless writes to the SSD.

Serafean
 
1 members found this post helpful.
Old 01-08-2011, 10:04 AM   #3
mira.mikes
LQ Newbie
 
Registered: Dec 2008
Posts: 21

Original Poster
Rep: Reputation: 0
Thank you for helpful reply Serafean,

Quote:
Originally Posted by serafean View Post
from what I've understood, you need to mount ext4 with the "discard" option. from docs. Thus TRIM is enabled at mount time, and you have to do nothing else.
You mean something like this?

/dev/sda1 / ext4 defaults,noatime,nodiratime,discard 0 0

Sorry for maybe silly question ... just want to be extra sure

Thanks for great link

Make these lines below any sense for me when I am not using swap at all?
Quote:
1. Add the following to your /etc/rc.local file.
# Economize the SSD
sysctl -w vm.swappiness=1 # Strongly discourage swapping
sysctl -w vm.vfs_cache_pressure=50 # Don't shrink the inode cache aggressively
Is this very important for SSD disks? Can you point me somewhere to get more info about SSD and I/O Schedulers?
Quote:
Change the I/O Scheduler
1. Edit the /etc/grub.conf file. Add “elevator=noop” to the kernel line.
kernel /vmlinuz-2.6.27.5-117.fc10.i686 ro root=/dev/sda
mira
 
Old 01-08-2011, 10:56 AM   #4
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 871
Blog Entries: 9

Rep: Reputation: 103Reputation: 103
Quote:
/dev/sda1 / ext4 defaults,noatime,nodiratime,discard 0 0
Correct

If you have no swap partition, no need for those swap lines. As for the I/O scheduler, I have no idea how that would impact an SSD, since they were mostly thought for traditional drives. However, since they try to make reads sequential, and sequential reads are always faster than random, a good should help performance (only theorizing here) Here is a quick explanation. And here is a longer article There is one missing in that list :BFQ.

Serafean
 
1 members found this post helpful.
Old 01-08-2011, 03:26 PM   #5
mira.mikes
LQ Newbie
 
Registered: Dec 2008
Posts: 21

Original Poster
Rep: Reputation: 0
Thank you again for bunch of useful information.

Quote:
I *strongly* recommend you mount all temporary directories as a tmpfs
I searched a bit about tmpfs and I found that:
Quote:
swap space is used as backing store in case of low memory situations.
Should I anyway apply these tweaks?
Quote:
1. Edit your /etc/fstab file. Add the following lines.
tmpfs /var/log tmpfs defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 0 0
Or rather consider to have swap space even if my machine has 4G RAM?

mira
 
Old 01-08-2011, 03:40 PM   #6
silvyus_06
Member
 
Registered: Oct 2010
Distribution: Ubuntu 10.04 , Linux Mint Debian Edition , Microsoft Windows 7
Posts: 386

Rep: Reputation: 49
I don't use swap and i have 4GB RAM
 
Old 01-08-2011, 04:30 PM   #7
mira.mikes
LQ Newbie
 
Registered: Dec 2008
Posts: 21

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by silvyus_06 View Post
I don't use swap and i have 4GB RAM
With something like this in your /etc/fstab file?
Quote:
tmpfs /var/log tmpfs defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 0 0
mira
 
Old 01-08-2011, 04:54 PM   #8
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-14.1
Posts: 1,220

Rep: Reputation: 177Reputation: 177
http://cptl.org/wp/index.php/2010/03...ives-in-linux/
 
1 members found this post helpful.
Old 01-08-2011, 06:36 PM   #9
mira.mikes
LQ Newbie
 
Registered: Dec 2008
Posts: 21

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Daedra View Post
Thank you for this link ... this answering all my questions

mira
 
  


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
[SOLVED] Fedora 13 SSD TRIM Support Potatos Linux - Hardware 6 06-14-2010 03:17 PM
SSD TRIM support on Linux Thoreau Linux - Kernel 2 03-25-2009 04:05 AM
trim my box ekdya Fedora 6 09-25-2006 01:50 PM
How To Trim A File fpfernando Programming 11 01-05-2006 08:04 AM
trim a line schneidz Programming 2 10-07-2005 06:47 PM


All times are GMT -5. The time now is 12:08 AM.

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