07-15-2024, 08:12 AM
Careful @Froggie. No where did I reference Windows. Read what I said again. Windows was never brought up. You're getting all working up over this, when it's really very simple, I want to prevent write amplification when restoring an image. Thus I need to temporarily disable trim.
Let me give a little background. An SSD write operation can be done to a single page but, due to hardware limitations, erase commands always affect entire blocks, so writing data to empty pages on an SSD is very fast, but slows down considerably once previously written pages need to be overwritten. So, restoring an image to an SSD is slower because the blocks are not empty in the first place. Since an erase of the cells in the page is needed before it can be written to again, but only entire blocks can be erased, an overwrite will initiate a read-erase-modify-write cycle the contents of the entire block are stored in cache, then the entire block is erased from the SSD, then the overwritten page(s) is written into the cached block, and only then can the entire updated block be written. So, as I said before, in order to eliminate this need to first cache the drives original contents before it can be erased it's best to temporarily disable trim in order to speed the restore up. Of course, this assumes the drive is not empty.
#themoreyouknow.
Let me give a little background. An SSD write operation can be done to a single page but, due to hardware limitations, erase commands always affect entire blocks, so writing data to empty pages on an SSD is very fast, but slows down considerably once previously written pages need to be overwritten. So, restoring an image to an SSD is slower because the blocks are not empty in the first place. Since an erase of the cells in the page is needed before it can be written to again, but only entire blocks can be erased, an overwrite will initiate a read-erase-modify-write cycle the contents of the entire block are stored in cache, then the entire block is erased from the SSD, then the overwritten page(s) is written into the cached block, and only then can the entire updated block be written. So, as I said before, in order to eliminate this need to first cache the drives original contents before it can be erased it's best to temporarily disable trim in order to speed the restore up. Of course, this assumes the drive is not empty.
#themoreyouknow.