I recently purchased a Crucial C300 SSD and set it up as my primary drive. I wanted to use LVM, and my reading indicates that LVM added support to pass-through TRIM commands with kernel 2.6.37. I'm running Ubuntu 10.10, but I installed the latest 11.04 kernel, so I'm running kernel 2.6.38-8. I added "discard" to fstab so my mountpoint looks like:<br /><br />/dev/mapper/vg0-vol0 on / type ext4 (rw,noatime,nodiratime,errors=remount-ro,discard,commit=0)<br /><br />I found directions on various sites like:<br />http://duopetalflower.blogspot.com/2010/11/enterprise-kernel-6-has-ssd-trim.html<br />on how to confirm if TRIM is working. I ran (as root):<br /><br />dd if=/dev/urandom of=tempfile count=100 bs=512k oflag=direct<br />hdparm --fibmap tempfile<br />(then took the first begin_LBA)<br />hdparm --read-sector 191710208 /dev/sda<br /><br />and it printed:<br /><br />/dev/sda:<br />reading sector 191710208: succeeded<br />3254 3a32 3834 313a 2b36 3030 303a 2030<br />4544 5542 2047 3728 3a29 5320 7661 6e69<br />2067 6e69 6564 2078 6f66 2072 7270 646f<br />............<br /><br />Then I ran:<br />rm tempfile<br />sync<br />hdparm --read-sector 191710208 /dev/sda<br /><br />and it still returned:<br />/dev/sda:<br />reading sector 191710208: succeeded<br />3254 3a32 3834 313a 2b36 3030 303a 2030<br />4544 5542 2047 3728 3a29 5320 7661 6e69<br />2067 6e69 6564 2078 6f66 2072 7270 646f<br />.............<br /><br />If TRIM is working, the sector is supposed to contain all zeros.<br /><br />Am I doing something wrong or do I need to do something more to get LVM to pass down the TRIM command?<br /><br />Nick