You are not logged in.

#1 2011-06-23 14:27:42

lynix
Member
From: Karlsruhe, Germany
Registered: 2008-04-23
Posts: 230

verifying TRIM on ext4+LVM

I recently switched to a SSD and like to know whether TRIM is working. Therefore, I followed one of the many guides I found google'ing:

1) creating a test file:

[root@pluto var]# dd if=/dev/urandom of=tempfile count=100 bs=512k oflag=direct
100+0 records in
100+0 records out
52428800 bytes (52 MB) copied, 30.9025 s, 1.7 MB/s

2) searching its LBA:

[root@pluto var]# hdparm --fibmap /var/tempfile

/var/tempfile:
 filesystem blocksize 4096, begins at LBA 0; assuming 512 byte sectors.
 byte_offset  begin_LBA    end_LBA    sectors
           0    1313792    1317887       4096
     2097152    1359872    1363967       4096
     4194304    1384448    1441791      57344
    33554432    1507328    1544191      36864
[root@pluto var]# sync

3) reading one block raw:

[root@pluto var]# hdparm --read-sector 1313792 /dev/sda

/dev/sda:
reading sector 1313792: succeeded
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000

As you can see, the problem is that the sector is zeroed although the file has been written to disk.

Did I get something wrong? Does the fact that /var lies on a logical volume of my LVM setup influence the LBA?

Last edited by lynix (2011-06-23 14:28:16)

Offline

Board footer

Powered by FluxBB