Upgrading And Repairing PCs 21st Edition: Flash Storage

SSDs: SLC Versus MLC And TRIM Command

SLC Versus MLC

Note that, because of the way SSDs work internally, the concept of file fragmentation is immaterial, and running a defragmenting program on an SSD does nothing except cause it to wear out sooner. Unlike magnetic drives, which must move the heads to access data written to different physical areas of the disk, an SSD can read data from different areas of memory without delay. The concept of the location of a file becomes moot with wear leveling, in that even files that are presented as contiguous to the file system are actually scattered randomly among the memory chips and cells in the SSD. Because of this, SSDs should not be defragmented like traditional magnetic drives.

Note: Windows 7 and 8 are SSD-aware, which means they can tell an SSD from a standard magnetic drive. These versions of Windows determine this information by querying the drive’s rotational speed via the ATA IDENTIFY DEVICE command. (SSDs are designed to report 1 RPM.) When Windows detects that an SSD is attached, it automatically turns off the background Disk Defragmenter function, thus preserving drive endurance. When using SSDs with Windows Vista and earlier versions, you should manually disable or otherwise prevent any form of defragmentation program or operation from running on SSDs.TRIM CommandAnother technique to improve SSD endurance and performance is an extension to the ATA interface called the TRIM command. This allows an SSD-aware OS (such as Windows 7 or later) to intelligently inform the SSD which data blocks are no longer in use, thus allowing the drive’s internal wear leveling and garbage collection routines much more space to work with, which allows the drive to maintain a high level of performance especially after all blocks have been written to at least once. For this to work, both the drive and the OS must support the TRIM command. Windows 7 and Server 2008 R2 and later are SSD aware and support the TRIM command, whereas earlier versions of Windows do not. SSDs released in 2009 or later generally support the TRIM command, whereas those that do not may be able to add support via a firmware upgrade. When you are upgrading the firmware on an SSD, it is highly recommended to have a full backup because in some cases a firmware upgrade reinitializes the drive, wiping all data in an instant.When an OS deletes a file or otherwise erases data from a drive, it doesn’t actually erase data. Instead, the OS simply marks the file allocation or master file tables to indicate that those blocks are available, while leaving the data in them untouched. This works fine on a normal HDD because overwriting is the same as writing, but it greatly hinders a flash drive since a flash drive cannot overwrite data directly. On a flash drive, any overwriting causes the drive to first write any previously existing data to a new block, then erase the block, and finally write the new data. Over time, this results in the SSD filling up and slowing down, even though from the OS point of view there is a lot of empty space.When TRIM is used, whenever a file is deleted, copied, or moved or the drive is reformatted, the drive is immediately informed of all the blocks that are no longer in use. This allows the drive controller to erase the unused blocks in the background, ensuring that there is always a sufficient supply of erased blocks available to keep write performance at near like-new levels.To further improve SSD performance, Windows 7 and later disable features such as Superfetch and ReadyBoost as well as prefetching on SSDs with random read, write, and flush performance above a certain threshold.When running a non-TRIM aware OS (Vista, XP, and earlier), you may still be able to take advantage of TRIM by installing a TRIM-aware application. For example, Intel provides a program called the Intel SSD Optimizer (part of the Intel SSD Toolbox) that you can periodically run to report to the drive which files have been deleted. Other SSD manufacturers provide similar tools (often called wiper.exe) as well. If you are running a non-TRIM aware OS with an SSD, check with the SSD manufacturer to see if it has an optimization tool available.

Image
Upgrading and Repairing PCs: 21st Edtion

Tom's Hardware is the leading destination for hardcore computer enthusiasts. We cover everything from processors to 3D printers, single-board computers, SSDs and high-end gaming rigs, empowering readers to make the most of the tech they love, keep up on the latest developments and buy the right gear. Our staff has more than 100 years of combined experience covering news, solving tech problems and reviewing components and systems.