pervin_1 Posted July 4, 2018 Posted July 4, 2018 How does Unraid handle SSD TRIM when SSD drive is passed to VM entirely? I am not talking about passing an entire SATA controller to Ubuntu 18.04 VM, but the disk itself "/Dev/disk/by-id/ata-XXXXXX. In this case SSD will be presented as some virtual disk "VDA". Is TRIM gonna be handled in host or guest OS? Planning on purchasing Samsung 860 EVO BTW. Open to any suggestions, even using vdisks too, all I need is to make sure TRIM command will be working correctly. Thank you!!
pervin_1 Posted July 4, 2018 Author Posted July 4, 2018 Bumped. Was wondering @johnnie.black if you could help me with this question above? I saw you posts regarding the vdisks and TRIM in Windows 7, but I am passing the disk itself entirely to Ubuntu VM (posted my question above), not the controller, just a disk itself. Thank you!!
pervin_1 Posted July 4, 2018 Author Posted July 4, 2018 3 hours ago, johnnie.black said: Sorry, no idea. Thank you anyway!!
Jcloud Posted July 6, 2018 Posted July 6, 2018 I honestly have no idea, but I would hazard my guess on the answer being, it is the guest OS that will do the TRIM. Such that guestOS sends TIRM, passed to SATA (guestOS), which is passed through to host sata layer, which gives it to block device and ultimately the drive's own internal logic does trim. Only the guestOS is going to be aware of the unused blocks and issue the addresses to clear.
pervin_1 Posted July 8, 2018 Author Posted July 8, 2018 On 7/5/2018 at 9:58 PM, Jcloud said: I honestly have no idea, but I would hazard my guess on the answer being, it is the guest OS that will do the TRIM. Such that guestOS sends TIRM, passed to SATA (guestOS), which is passed through to host sata layer, which gives it to block device and ultimately the drive's own internal logic does trim. Only the guestOS is going to be aware of the unused blocks and issue the addresses to clear. That's what's I figured, gotta do some testing to see if it works, these are just assumptions for now, will post results later. Thank you!!
pwm Posted July 9, 2018 Posted July 9, 2018 If you pass the controller to the VM, then the VM will know it's a SSD and can directly perform trim. If you only pass the drive, then the OS will normally not perform trim because it doesn't understand that it's a SSD. The whole idea with VM is to virtualize the hardware allowing you to switch to different hardware without the VM knowing about it. The only thing I have seen earlier is that it's possible to configure the image file to be underprovisioned, and have the VM sends trim so unused parts of the image file can be returned. But I'm not sure if this would be applicable if running directly on a SSD, and if the SSD will see any trim requests.
pervin_1 Posted July 14, 2018 Author Posted July 14, 2018 On 7/9/2018 at 9:46 AM, pwm said: If you pass the controller to the VM, then the VM will know it's a SSD and can directly perform trim. If you only pass the drive, then the OS will normally not perform trim because it doesn't understand that it's a SSD. The whole idea with VM is to virtualize the hardware allowing you to switch to different hardware without the VM knowing about it. The only thing I have seen earlier is that it's possible to configure the image file to be underprovisioned, and have the VM sends trim so unused parts of the image file can be returned. But I'm not sure if this would be applicable if running directly on a SSD, and if the SSD will see any trim requests. Exactly, I can't pass the controller unfortunately, I have 4 SATA ports on MB with single controller, passing an entire controller means, passing all my drives. I can possibly use my SATA expansion card to pass it to the VM, it will solve the problem. VM image is another issue, I have seen some posts regarding TRIM command inside of VM and how to set it up to make sure VM reports unused space to host. Good post (although a little unrelated) link edit: I thought you would be interested in this article link https://serverfault.com/questions/896448/qemu-trim-and-discard-on-a-physical-ssd-device It's pertinent to my issue, too bad I am no longer interested in this option anymore, I am not gonna be able to test it as of this moment. Ended up passing the entire controller by adding a dedicated PCI SATA HBA card to the motherboard. Thank you anyway!!!
UnraidUser_2020 Posted December 20, 2018 Posted December 20, 2018 @pervin_1 So were you able to get TRIM working on the SSD by passing through the entire controller? I want to do this for my M.2 PCI nvme drive and run OSX on it, but want to make sure TRIM will work, if not i think the drive will come to a crawl after heavy months of use...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.