©2015 -
Windows
NOTE: Windows 7 and Windows 2008 R2 supports TRIM only on SATA SSD. Windows 8 and higher, expands TRIM support on PCIe only for NVMe flash Drives.
To check TRIM:
Open the Start Menu, type CMD
Right click the icon and Run as Administrator
Type: fsutil behavior query disabledeletenotify
DisableDeleteNotify = 1 (Windows TRIM commands are disabled)
DisableDeleteNotify = 0 (Windows TRIM commands are enabled)
To enable TRIM:
Open the Start Menu, type CMD
Right click the icon and Run as Administrator
Type: fsutil behavior set disabledeletenotify 0
Reference: Sean’s Windows 7 Optimization For SSDs
RedHat / Fedora
TRIM is supported starting at v6.5+
Reference:
RedHat 6 Solid State Disk Guideline
Edit /etc/fstab and add ,discard in addition to the defaults option.
Example:
[chad@lxnode5 ~]$ cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sun Jul 19 02:29:21 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=9895ecef-
UUID=bdb8463d-
UUID=5bca9cf4-
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
[chad@lxnode5 ~]$
SSD AND FLASHDRIVE TRIM
Chad’s Blog November 2015
Recently, I have been involved on projects related to Big Data covering Hadoop and NoSQL implementations. It has come to my attention when one of the NoSQL vendors -
So, here we go...
Basic SSD Write operation
An SSD (Solid State Drive) is comprised of Flash Memory based on a NAND component. Data are stored on individual NAND cells. Before data is written, it needs to perform an erase procedure on the cell. Thus, a cell is "available" to store data if it is only in an erased state.
So, if we take this thought further -
All of this type of operational procedures occurs regardless of the type of i/o (create, overwrite, or even delete). Compare this to a hard disk to where such write operation is as simple as overwriting a sector. However, since SSDs are basically flash memory, it's write operation is still fast despite the number of procedures that is being executed.
The LBA (Logical Block Address) and the Life Of A NAND Cell
The SSD Controller manages the flow of data between the Flash Memory (NAND cells) and the Interface (i.e. IDE/PATA, SATA) using a logical-
When a changed data needs to be written no matter how small it is (i.e. 1KB), the Controller reads an entire Page onto its cache to make its modifications before dumping it. And so, a write operation affects a lot cells despite the fact only a few of them requires changes.
However, for some strange Controller related reasons, delete operations are handled in blocks. So, if a delete transaction only affects a few pages of a block, that entire block is loaded into the cache for modification and dump it back to a new set of cells.
There are limits as to the number of times a cell can be written (cycles). And depending on the NAND design, the following are the known life cycles based on the cell type:
SLC (Single Level Cell) rated for 50,000 to 100,000 cycles
MLC (Multi Level Cell, also known as DLC "Dual Level Cell") rated for 3,000 to 5,000 cycles
TLC (Triple Level Cell) rated for ~1,000 cycles
Ref: SSD Endurance Test
V-
V-
To attain the target warranty of an SSD device, the Manufacturer tries to avoid rewriting onto the same cell during an overwrite operation and chooses to write to another available cell to prolong the life of all cells. Thus as an example, an SSD having 1TB capacity has to curve out some space for cycling to attain a target lifespan of an SSD and thus making available only 960gb to the host system. This logical 64gb "reserved" cells (also called over-
TRIM Operation and Garbage Collection
Now that we understand the basic internal operation of an SSD and the role of a "Garbage Collection" process which basically makes the unused cells available again for writing by erasing the cells, TRIM comes in to speed-
A TRIM is an operating system function that sends a message to the SSD device to immediately make the Block/Page/Cell available by making an erase operation for a cell to occur within a write transaction. This can be useful in a scenario where the SSD is always busy and there's not much idle time where the Garbage Collection process usually kicks-
A busy SSD makes the Garbage Collection ineffective since it could not run its process due to the absence of idle time, and thus making the unused cells unavailable for writing as they were not in an erased state yet. So in this scenario, generally the Controller is unaware of the unused cells which causes the on-
A TRIM operation can only work on SSDs that support it and I think as of this writing, majority of the manufacturers' newer models support this.
If you have an older SSD, you may check the manufacturer website or its support group for an update of the firmware.
IMPLEMENTING TRIM
Mac OS X
TRIM support in Mac OS X is available starting in the Snow Leopard version (10.6.8). By default, this is enabled in all their products equip with Apple SSD and Flash Drive. However, the TRIM function is disabled when you attach a non-
Download the free version of TRIM enabler software for Mac OS X 10.6.8 (Snow Leopard) to 10.9.x (Mavericks) from cindori.org
To enable TRIM on version Yosemite (10.10.4) and higher, type the following command at your terminal-
sudo trimforce enable
To verify if TRIM is enabled,
Go to the top bar left corner and click on the Apple logo → About This Mac → [System Report] → SATA/SATA Express
Select your SSD device and a list of status and description will be displayed. TRIM Support should indicate “Yes”.