On mkfile:
OPTIONS
-n Create an empty filename. The size is noted, but disk blocks aren't allocated until data is
written to them.
Does this mean the file is truly empty and occupies the stated space?
Also, I don't have the ability to enable trim on my SSD, when I create and remove the file, are you telling me this will have an effect like TRIM or that it is a way of forcing trim on a previously untrimmed SSD (after trim is enabled)?
Finally, supposedly the Two Samsung 840 EVO's I'm using have built-in garbage collection.... I am skeptical, any idea if this is accurate?
Try
mkfile -nv 10g tmp.tmp
If it takes 20 seconds or more to complete (on fast SSD), it's zeroing the file. If it takes milliseconds, it's not.
If the free space on the disk dropped by 10 GiB, it allocated the file. If the free space stayed the same, it only changed the meta-data (it created a sparse file).
If you don't have TRIM, this just adds unnecessary wear to the drive - unless you have a compressing controller.
*All* SSDs have garbage collection - if they didn't they'd be "write once" drives. Write 128 GB to a 128 GB drive and it would stop working (actually, you'd probably be able to write 128 GiB due to over-provisioning).
_______
If you don't have TRIM, the key to keeping the drive fast is to over-provision - give the SSD controller a pool of free blocks to make garbage collection easier.
Your typical SSD comes with about 7% of the space over-provisioned. That 128 GB drive really has 128 GiB of flash, and the difference is the pool for GC. (128,000,000,000 bytes visible, 137,438,953,472 bytes actual, 9,438,953,472 bytes for the garbage collector.) Note that many drives made for heavier duty have higher levels of over-provisioning - for example a 120 GB drive probably still has 128 GiB of flash, but 8GB more in the GC pool. An enterprise drive may have 100 GB of the 128 GiB visible, with over 37 GB in the GC pool.
With TRIM, all free space on the volume is available for the GC - the pool expands and contracts as the free space changes. So, unless you run it almost full you have a huge GC pool.
If I had to run a drive without TRIM, I'd leave a hefty chunk of the drive unpartitioned to ensure a big GC pool.
- If the drive isn't brand new (never used), run the drive's manufacturer's low level tool to mark the entire drive as *UNUSED*. "Secure Erase" usually does this, but check. (Or, connect the drive to a Windows 7 system, create a full-size NTFS volume, then delete the volume)
- Partition the drive, leaving about 20% or more unused - paying attention to binary vs decimal arithmetic. (For that 128 GB drive with 128 GiB of flash, a 110 GB partition would leave about 20% of the 137 GB free.)
- Never, ever read or write to the GC area. Once a block is used, only TRIM (or secure erase) can put it back to *UNUSED*. (Of course, you'd have to make a partition to use the GC pool.)
If you are interested in more details, the article
http://en.wikipedia.org/wiki/Write_amplification has a good explanation of SSD operation, garbage collection and TRIM.