[haiku-development] Re: fstrim: Call for testing

  • From: Sean Collins <smc.collins@xxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 28 Oct 2013 23:00:42 -0400

Axel Dörfler wrote:
Hi there,

AFAIK I've completed TRIM support for SSDs. The approach is rather simple as it currently requires a manual trigger of the "fstrim" command which will then call into the file system (only BFS supports this so far), and then that one through the SCSI layer into AHCI -- it won't work with an ATA driver at this point.

Changing the latter would be fairly trivial, though, I but I want to make sure that what there is now works.

However, since I do not own a spare SSD, and currently cannot afford to lose the data on the one I do own, I was not able to test the last step. I checked that BFS builds the requests correctly, but the later layers haven't been tested yet.

So if you have a spare SSD, I would be glad if you could give it a try.
This is how you could test it:
1) Put aside a small partition for testing.
2) Fill that partition with random or fixed data, for example via:
    dd if=/dev/random of=/dev/disk/scsi/0/9/0 bs=1M
(make sure you replace the device path with the one your using)
3) Create a BFS volume on that partition, copy a few files to it.
4) Check with DiskProbe that the unused parts of the partition still contain the data you filled it with in 2).
5) Trim the unused data:
    fstrim /MyTestPartition
6) Reboot.
7) Check that the volume and its files are still intact.
8) Check with DiskProbe that the data you filled the unused parts of the partition with in 2) is gone.
9) Report back to me.

You can find the branch with the implementation here:
https://github.com/axeld/haiku/tree/trim

Since it visibly only adds the fstrim command, I guess I could merge it already, too, though.

Bye,
   Axel.


I'll make you a deal, I'll go buy and test a SSD , if you fix distcc so it works on haiku


Sean

Other related posts: