THE WELCH COMPANY
440 Davis Court #1602
San Francisco, CA 94111-2496
415 781 5700
rod@welchco.com
S U M M A R Y
DIARY: May 25, 2012 10:33 AM Friday;
Rod Welch
C18 defragment SSD research Mydefrag beneficial no harm.
1...Summary/Objective
........Will MyDefrag reduce the lifespan of my flash/SSD memory disk?
........5...Trim Resolves SSD Fragmentation
............Memory block fragmentation, filesystem fragmentation, and TRIM
..............
Click here to comment!
CONTACTS
SUBJECTS
Default Null Subject Account for Blank Record
0403 -
0403 - ..
0404 - Summary/Objective
0405 -
040501 - Follow up
040502 -
040503 -
040504 -
040506 - ..
0406 -
0407 -
0408 - Progress
0409 -
040901 - Purchased c18 with SSD reported on 120314 0832, ref SDS 3 PF4M, based
040902 - on recommendation by Peter in HP Technical Support 2 weeks earlier on
040903 - 120302 0832. ref SDS 1 9J3L
040905 - ..
040906 - On 120313 research indicates defragmentation is not needed for SSD
040907 - storage devices, and that Windows 7 disables this feature and relies
040908 - on "trim" technology to optimize performance of SSD devices.
040909 - ref SDS 2 084G
040911 - ..
040912 - On 120313 research another article warns defragmentation degrades
040913 - performance of SSD storage devices. ref SDS 2 HT72
040915 - ..
040916 - On 120402 1329 bought secondary Samsung SSD model 830 256 GB 6 G/s
040917 - disk for $370, including drive bay converter, which is $100 less than
040918 - HP charged. ref SDS 4 EO6L
040920 - ..
040921 - On 120411 1018 Morris installed 2nd SSD Samsung model 830 as 2nd SSD
040922 - and 3rd HHD in c18. ref SDS 5 EU3F
040924 - ..
040925 - Research today on the Internet shows...
040926 -
040927 - Will MyDefrag reduce the lifespan of my flash/SSD memory disk?
040928 -
040929 - http://www.mydefrag.com/FAQGeneralInformation-WillMyDefragReduceTheLifespanOfMyFlashSSDMemoryDisk.html
040930 -
040931 - 1. Yes. Flash memory disks (such as USB memory sticks and
040932 - Solid State Disks (SSD)) have a limited number of
040933 - erase-write cycles. The MyDefrag defragmentation and
040934 - optimization will move files to new locations, which
040935 - involves erasing and writing, so it will reduce the
040936 - lifespan of your flash memory.
040938 - ..
040939 - 2. But there is no cause for alarm. Modern flash memory disks
040940 - have at least 10,000 write cycles, more expensive types use
040941 - different hardware that is guaranteed for a minimum of
040942 - 100,000 cycles. All flash memory disks use a technique
040943 - called wear-leveling. The controller in the memory disk
040944 - will automatically reassign blocks in the memory so that
040945 - all the memory is worn down evenly. For a good explanation
040946 - of how this works see the article on the Corsair
040947 - website...
040948 -
040949 - Corsair USB Flash Wear-Leveling and Life Span
040950 -
040952 - ..
040953 - In order to wear out a cheap 10,000 cycle flash memory disk
040954 - in ten years, you would have to write to EVERY BLOCK in the
040955 - device about 2.7 times per day, every single day. This
040956 - does not take into account error correction, which will
040957 - extend the life even further, and the fact that the 10,000
040958 - cycles is a guaranteed minimum, typical flash memory will
040959 - handle an order of magnitude more write cycles.
040961 - ..
040962 - 3. The MyDefrag script to defragment and optimize Flash memory
040963 - is specially designed to move as little data as possible.
040964 - Fragmented files are defragmented (this takes just a single
040965 - write cycle), unfragmented files are not touched at all.
040966 - Gaps are filled by moving all the files together (also just
040967 - a single write cycle), if there are no gaps then MyDefrag
040968 - will do nothing.
040970 - ..
040971 - 4. Nevertheless, my advice is to use some discretion and not
040972 - defragment/optimize flash memory disks every day, but
040973 - only incidentally, for example once per month.
040975 - ..
040976 - 5. Trim Resolves SSD Fragmentation
040977 - Memory block fragmentation, filesystem fragmentation, and TRIM
040978 -
040979 - There are 2 kinds of fragmentation that concern SSD disks.
040981 - ..
040982 - 6. The first kind of fragmentation is memory block
040983 - fragmentation.
040984 -
040985 - 1. SSD disks are written in pages (generally 4KB in size)
040986 - but can only be erased in larger groups called blocks
040987 - (generally 128 pages or 512KB). This causes
040988 - fragmentation and results in severe performance loss
040989 - after the disk has been used for a while. Speed can
040990 - easily drop by 50% or more.
040992 - ..
040993 - 2. The SSD manufacturers have developed a solution called
040994 - the TRIM instruction, for more information see * this
040995 - Wikipedia article.
040996 -
040997 - http://en.wikipedia.org/wiki/TRIM_%28SSD_command%29
040998 -
040999 - 1. In computing, a TRIM command allows an operating
041000 - system to inform a solid-state drive (SSD) which
041001 - blocks of data are no longer considered in use and
041002 - can be wiped internally. While TRIM is frequently
041003 - spelled in capital letters, it is a command name,
041004 - not an acronym.[1]
041006 - ..
041007 - 2. Because of the way that file systems typically
041008 - handle delete operations, storage media (SSDs, but
041009 - also traditional hard drives) generally do not know
041010 - which sectors/pages are truly in use and which can
041011 - be considered free space. Delete operations are
041012 - typically limited to flagging data blocks as "not
041013 - in use" in the file system.[6][7] Contrary to, for
041014 - example, an overwrite operation, a delete will
041015 - therefore not involve a physical write to the
041016 - sectors that contain the data. Since a common SSD
041017 - has no access to the file system structures,
041018 - including the list of unused clusters, the storage
041019 - medium remains unaware that the blocks have become
041020 - available. While this often enables undelete tools
041021 - to recover files from traditional hard disks,[7][8]
041022 - despite their being reported as "deleted" by the
041023 - operating system, it also means that when the
041024 - operating system later performs a write operation
041025 - to one of the sectors, which it considers free
041026 - space, it effectively becomes an overwrite
041027 - operation from the point of view of the storage
041028 - medium. For traditional hard disks this is no
041029 - different from writing an empty sector, but because
041030 - of how some SSDs function at the lowest level, an
041031 - overwrite produces significant overhead compared to
041032 - writing data into an empty page, potentially
041033 - crippling write performance.[7][9
041035 - ..
041036 - 3. SSDs store data in flash memory cells that are
041037 - grouped into pages, with the pages (typically 4 kB
041038 - each) grouped together into blocks (typically 128
041039 - pages per block, totaling 512 kB).[6][10] NAND
041040 - flash memory cells can only be directly written to
041041 - when they are empty. If they are considered to
041042 - contain data, the contents first need to be erased
041043 - before a write operation can be performed reliably.
041044 - In SSDs, a write operation can be done on the
041045 - page-level, but due to hardware limitations, erase
041046 - commands always affect entire blocks.[10]
041048 - ..
041049 - 4. As a result, writing data to SSD media is very fast
041050 - as long as empty pages can be used, but slows down
041051 - considerably once previously written pages need to
041052 - be overwritten.
041054 - ..
041055 - 5. Since an erase of the cells in the page is needed
041056 - before it can be written again, but only entire
041057 - blocks can be erased, an overwrite will initiate a
041058 - read-erase-modify-write cycle:[6][11]: the contents
041059 - of the entire block have to be stored in cache
041060 - before it is effectively erased on the flash
041061 - medium, then the overwritten page is modified in
041062 - the cache so the cached block is up to date, and
041063 - only then is the entire block (with updated page)
041064 - written to the flash medium. This phenomenon is
041065 - known as write amplification
041067 - ..
041068 - 6. The TRIM command is designed to enable the
041069 - operating system to notify the SSD of which pages
041070 - of data are now invalid due to erases by the user
041071 - or operating system itself. During a delete
041072 - operation the OS will not only mark the sectors as
041073 - free for new data, but it will also send a TRIM
041074 - command to the SSD with the associated LBAs to be
041075 - marked as no longer valid. After that point the
041076 - SSD knows not to relocate the data from those LBAs
041077 - during garbage collection. This will result in
041078 - fewer writes to the flash, reducing write
041079 - amplification and increasing drive life. Different
041080 - SSDs will act on the TRIM command somewhat
041081 - differently so the final performance can also be
041082 - different between different SSDs.[3][8]
041084 - ..
041085 - 7. The command irreversibly deletes the data it
041086 - affects.
041088 - ..
041089 - 8. TRIM has been defined as a non-queued command by
041090 - the T13 subcommittee, and consequently incurs
041091 - massive execution penalty if used carelessly, e.g.,
041092 - if sent after each filesystem delete command. The
041093 - non-queued nature of the command requires the
041094 - driver to first finish any operation, issue the
041095 - TRIM command, then resume normal commands. TRIM
041096 - can take a lot of time to complete depending on the
041097 - firmware in the SSD and may even trigger a garbage
041098 - collection (GC) cycle. This penalty can be
041099 - minimized in solutions that periodically do a
041100 - batched TRIM, rather than TRIMming upon every file
041101 - deletion, by scheduling such batch jobs for times
041102 - when system utilization is minimal.
041104 - ..
041105 - 3. It is a hardware solution that needs support in the
041106 - operating system, and only applies when files are being
041107 - deleted. MyDefrag knows nothing about memory block
041108 - fragmentation because MyDefrag operates at the
041109 - filesystem level, not the hardware level. However, the
041110 - MyDefrag script for Flash memory disks will consolidate
041111 - free space, and this reduces the problems caused by
041112 - this kind of fragmentation.
041114 - ..
041115 - 7. The second kind of fragmentation is filesystem
041116 - fragmentation.
041117 -
041118 - 1. Files can be split into parts that are placed anywhere
041119 - on the disk, just like on harddisks. Many users think
041120 - that this kind of fragmentation does not matter for SSD
041121 - disks, because the disks have a very low latency (no
041122 - harddisk heads that have to move about). But Windows
041123 - still has to do more work when a file is fragmented, to
041124 - gather all the fragments.
041126 - ..
041127 - 2. There is significant overhead inside Windows, nothing
041128 - to do with the hardware, and it is all the more
041129 - noticeable because SSD is so fast. MyDefrag deals with
041130 - this kind of fragmentation.
041131 -
041132 -
041133 -
041134 -
041135 -
041136 -
041137 -
041138 -
041139 -
041140 -
041141 -
041142 -
0412 -