I installed OpenSuse on two SSDs in RAID0. I enabled TRIM by adding discard to all EXT4 partitions in fstab. The thing is that I would like to test that the TRIM really works (since it’s in RAID 0). There is a method for that when you simply create a file, delete it and then using hdparm directly access sectors of the deleted file. If TRIM works, there should be only zeros after a while. My problem is that I don’t know how to access sectors on RAID 0.
~ # hdparm --read-sector 234346496 /dev/md125
/dev/md125:
/dev/md125 is a RAID device: please specify an absolute LBA of a raw member device instead (raid1 only)
Aborting.
It tells me to specify an aboslute LBA but I’m not sure how to do that.
> I know the position, but I can’t access it:
>
>
> Code:
> --------------------
> ~ # hdparm --read-sector 234346496 /dev/md125
>
> /dev/md125:
> /dev/md125 is a RAID device: please specify an absolute LBA of a raw member device instead (raid1 only)
> Aborting.
> --------------------
>
>
> It tells me to specify an aboslute LBA but I’m not sure how to do that.
The same as above, but on /dev/sda, /dev/sdb, or equivalent. You have to
access the members of the array, not the array.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
Well that is possible… but how does it work? hdparm --fibmap prints one exact sector number and no device so I guess the sector number is relevant to the whole raid array. It’s not clear which array member to use (and since it’s RAID 0 the data would be split anyway). There must be some kind of translation or a way to access directly the RAID array…
> so I guess the sector number is
> relevant to the whole raid array. It’s not clear which array member to
> use (and since it’s RAID 0 the data would be split anyway). There must
> be some kind of translation or a way to access directly the RAID
> array…
You have to assume that, being raid 1, both members are identical.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
I’m not sure I understand. I have two 256GB SSDs in RAID 0 which means block-level striping. When I save a 2MB file, 1MB goes to /dev/sda and 1MB goes to /dev/sdb (generally speaking). That’s what makes it so fast. Hdparm gives me only one number and no disk so I assume that the number is the number of the first sector on the “virtual” 512GB disk. How do I access the sector directly? Maybe my whole approach is wrong… how would you suggest I should test that the TRIM is working?
This setup (two SSDs in RAID 0) came preinstalled in this laptop with Windows 8. I simply treated the configuration as it was only one 512GB disk and installed OpenSUSE on it. After the installation I enabled TRIM (as it was suggested) and I suppose it works. There is no error in dmesg and hdparm -I /dev/sda |grep TRIM shows Data Set Management TRIM supported (limit 16 blocks). It says “supported” but does it mean that it’s actually “on”? That’s why I would like to really test it. And I would also like to see the raw data magically turn into zeros