TRIM function not working

Post Reply
jeanluca
Posts: 1
Joined: Mon Jul 20, 2009 3:35 pm

TRIM function not working

Post by jeanluca »

Hi

I just installed Fedora 16. First it didn't boot, but when I installed Fedora without gpt it worked!

Next, I tested the trim function. BTW, I have a brand new ssd (Intel Solid-State Drive 520 Series)

Anyway, according to the docs you can test TRIM with the following commands:

Code: Select all

$> dd if=/dev/urandom of=tempfile bs=1M count=3
$> sync
$> hdparm --fibmap tempfile
tempfile:
 filesystem blocksize 1024, begins at LBA 2048; assuming 512 byte sectors.
 byte_offset  begin_LBA    end_LBA    sectors
           0      84486      90629       6144

$> hdparm --read-sector 84486 /dev/sda
/dev/sda:
reading sector 84486: succeeded
1b37 44d7 e3d8 a22d 19aa 4b4b 0daf 0d63
b8d0 c05a 7e1d 10cc 5a9d c7a4 07f0 0625
.....
Now when you delete the file (and sync) the last command should only show zeroes.
But when I do this, I still get the content of the file.
Furthermore, I have added the 'discard' option to my ext4 partitions

Any suggestions ?

cheers

UPDATE: on ext4 I see now that TRIM is working. In the above example I only checked the first block, but when you check the second/third I see only zeroes. Is there any way to check this with btrfs ?

Post Reply

Return to “Linux on fit-PC3”