Re: Working TRIM for md RAID
From: Alex Besogonov <hidden>
Date: 2011-11-07 20:15:57
On Mon, Nov 7, 2011 at 2:54 PM, David Rees [off-list ref] wrote:
quoted
Since it calls TRIM on raw devices there is a possibility of really bad data corruption bugs. So there's test/test.sh script which try to test mdtrim by creating MD array on a single SSD drive, filling it up with random data and then TRIMing empty space. So far, it works for me but it would be great to have more test results. You can get it here: https://github.com/Cyberax/mdtrimNice - I'll have to give this a shot - have you found that SSDs generally "zero" out the trimmed space so that the mismatch_cnts stay in sync?
Modern drives generally do. You can check it by running "hdparm -I /dev/sda" and checking that "Deterministic read ZEROs after TRIM" is on.
I had worked on modifying the raid1ext4trim.sh to run on MD1 arrays, but was never brave enough to test it on live data yet and don't have spare SSDs to use for testing.
I've actually used our spare drive on production server to do testing. You can create MD array on /dev/sda1 and /dev/sda2 :) The test script actually does exactly that. I'm working on RAID0 support, should be ready soon.