LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (http://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   TRIM on SSD (http://www.linuxquestions.org/questions/linux-kernel-70/trim-on-ssd-854975/)

mira.mikes 01-08-2011 05:11 AM

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

serafean 01-08-2011 07:05 AM

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

mira.mikes 01-08-2011 10:04 AM

Thank you for helpful reply Serafean,

Quote:

Originally Posted by serafean (Post 4217319)
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

serafean 01-08-2011 10:56 AM

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

mira.mikes 01-08-2011 03:26 PM

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

silvyus_06 01-08-2011 03:40 PM

I don't use swap and i have 4GB RAM :)

mira.mikes 01-08-2011 04:30 PM

Quote:

Originally Posted by silvyus_06 (Post 4217686)
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

Daedra 01-08-2011 04:54 PM

http://cptl.org/wp/index.php/2010/03...ives-in-linux/

mira.mikes 01-08-2011 06:36 PM

Quote:

Originally Posted by Daedra (Post 4217735)

Thank you for this link ... this answering all my questions ;)

mira


All times are GMT -5. The time now is 02:49 AM.