linux - Can I enable discards on a LUKS-encrypted ssd drive in RHEL6 (and do I need to)?
2014-04
I have a RHEL 6.4 workstation, running on a LUKS-encrypted LV residing on a SSD. I found RedHat documentation stating that dm_crypt does not currently support TRIM passthrough, however I also found other sources that state the opposite (albeit for other distributions) and even that discards are not needed for recent SSD drives which use some sort of automatic garbage collection. So:
1) Can I enable TRIM/discards with my setup?
2) Do I need to, for optimal disk performance?
Thanks for your thoughts.
Does any know if there is a way to enable TRIM support on Linux for SSDs? This is included with Windows 7, and I was surprised that I couldn't find much information about it under Linux.
Info on SSD and TRIM can be found here - http://www.anandtech.com/storage/showdoc.aspx?i=3531&p=10
Notice that you probably need a more recent kernel than 2.6.28, see here (based on 2.6.30-rc4 with last activity in May this year). I do not know to what degree that tree has been merged, maybe you can search the [email protected]
mailing list. Update: see for instance this thread (also discussed on the kernel list).
For using TRIM you are probably interested in hdparm-9.20, released a few days ago (and I see there is even a newer wiper-1.7 release).
Update: See also this LWN article about the relationship between filesystem, TRIM, performance and SSD disks.
Linux supported the TRIM command in 2.6.28, released on December 25, 2008. See here for details.
I think Linux already supports Trim. Its just no SSD has support for it yet. The firmware upgrade is required for current generation OCZ and Intel drives for Trim to be enabled.
Initial support added in 2.6.28, 2.6.33 has "full" trim support... whatever that means.
I tracked TRIM command on UBUNTU 9.10. But I can't find any TRIM Command when I'm using the kernel 2.6.31. When I generated TRIM command using the hdparm, I can find TRIM command. So, I think current linux kernel version does not support TRIM command.