Its not for “whatever reason”. There is a VERY SPECIFIC reason why this happens. You can’t re-write to previously written blocks on a solid state storage device until those blocks have been wiped clean. The reason why it is much slower is because of the time it takes to wipe those previously used blocks.
Two easy solutions;
- Manually run fstrim on the filesystem:
# fstrim -v /mount/point
- automatically, by mounting the filesystem with the “discard” option.
Now this is the key to the process; the DRIVE can’t just trim itself, because after a block has been written to, it has no way to know if it is still in use or is available. That means that the OS has to TELL it what blocks are available and should be trimmed. The OS queries the filesystem, which tracks what is and is not in use, and sends the results to the disk, which should do the job in the background, rather than you actually having to wait for the whole disk to write over.
When you’re FORMATTING a disk, it issues a trim command for the entire, CONTIGUOUS, region that will be occupied by the new filesystem (typically the entire partition). Now formatting your disk just to trim it is, of course, very wasteful – both in terms of the longevity of the disk itself, as well as the work it takes to return the disk to the state it was in. My advice to you would be to mount the filesystem using the discard option, and then occasionally check with the fstrim command to make sure. This will optimize the disk performance without unduly hurting its longevity. After all, blocks need to be wiped prior to being rewritten anyway, might as well do it proactively.
Edit: one of the reasons why the discard mount option is so powerful, is because it has basically zero overhead. When you delete a file, that fact is recorded in the filesystem as an unlink. On a magnetic disk, that is ALL that happens, whatever data was pointed to by the inode that was just erased ends up being “lost” somewhere on the drive. Same happens without the discard option, which means that in order for the fstrim command to work, it has to run through the entire filesystem in order to track down all the blocks that are IN USE, and then invert that selection before feeding the results to the disk for a trim. So if you run the fstrim command, it can actually take quite a while sometimes. But if you mount with discard, then before unlinking, it takes the list of blocks from the inode RIGHT THEN and sends it to the disk to be trimmed. No need to search for it later.