|
Home »
Hardware
»
Disks and Mass Storage
Summary: We've all been told that defragmenting a hard disk is a good thing for performance, but the same is most definitely not true for flash drives.
You've hit one nail squarely on the head: flash devices (or any "solid state" devices) don't gain a performance benefit from being defragmented. But in reality things get worse. Much, much worse. You should never defragment a flash drive. • Files are stored on hard disks in pieces; frequently in 512 byte chunks. Now, there's no requirement that these chunks be next to, or even near each other. That means that a file could have its contents spread out in totally random places on the hard disk. You normally never see this, because the file system takes care of locating all those chunks when you read or write a file. On a traditional hard disk there's a physical read/write head that moves around on the media when data is being accessed. Much like the laser in a CD player (or the needle on a record player) the disk spins underneath it, while the head moves in and out to locate the proper "track" that contains the next chunk of the file that's being accessed. "The more you write to a flash device the shorter its
lifespan will be."
Moving that read/write head takes time. So, if you can ensure that all the chunks of a file are next to each other or "contiguous", the head doesn't need to move as much, and reading the file is faster. And that's what defragmenting or "defragging" a hard disk is all about: rearranging where on the disk the file chunks are stored so that when the time comes to access a particular file, all the chunks are together and the read/write head doesn't need to move as much. Flash drives have no read/write head. In fact, flash drives have no moving parts at all. Everything that makes it look and act like a hard drive is actually done by mimicking the characteristics of a hard drive in the flash drive's circuitry. Defragging a flash drive will get you no performance benefits. Since there's no head to move, there's no additional time cost in fetching one chunk of data from a flash drive over any other. It doesn't matter how the files are laid out, it's all just as fast. So now that I've convinced you that there's no point in defragging a flash drive, why did I say that you should never do it? Writing to flash memory causes it to degrade ever so slightly. (Reading does not.) The more you write to a flash device the shorter its lifespan will be. Now, don't get me wrong, "normal" usage should be just fine. And the technology continues to improve almost daily. Not only is the underlying technology improving, but the techniques to mitigate the problem are improving as well. For example, most flash drives try to "spread out" write activity across the entire device, so that even if you're constantly re-writing the same data over and over again, the device will "move it around" so you're not wearing a single spot on the device faster than any other. But still ... flash memory wears out. If you're regularly defragging a flash drive you're adding thousands upon thousands of write operations each time you do so. Whatever the expected lifespan of the device, you could easily be cutting it in half or worse. For no benefit. (Full disclosure: OK, a reader did comment on a prior article with a potential benefit - defragmented files are easier for recovery utilities to recover. Fair enough. In my opinion that's not even close to a good enough reason to shorten your flash drive's lifespan. Use a good backup strategy instead.) So defrag your hard drives every so often. But never defrag your flash drives, there's just no point. Related:
Article 12239 | Posted February 19, 2008 |
Stay Informed Archives Advertisers |
|
•
Hmmmm... makes me wonder how many MacBook Air owners may defrag their new SSD drives, potentially reducing the lifespan of the device. Using Flash for hard drives (Solid State Drives) is still an expensive, limited storage medium that is slowly gaining momentum. As more manufacturers (such as Samsung) throw their weight behind the technology we should see lower prices and increased capacities. The next couple of years could yield some very interesting drives in this arena - low power consumption, fast boot times, and potentially better performance that disk based drives.
Posted by: David Ball at February 20, 2008 9:24 PMThe magnetic hardrive is a -mechanical- device that is, by orders of magnitude, the slowest* component in a modern PC of which all other components are solid state (CPU, RAM, GFX etc). File fragmentation increases the work that this mechanical device has to do, thereby worsening an existing performance bottleneck. Hence the need for defragmentation. In addition to preserving overall system performance, defragmentation may also improve the life of the drive in the long term, improve chances of file recovery (if the HDD crashes) and a defragmented drive may also reduce battery consumption in laptops. Infact, in the corporate space, unattended intelligent automatic defrag of workstations and servers is becoming the norm since it eases the workload of the IT people yet reduces user complaints of poor performance.
However, as Leo has so precisely explained, flash drives derive none of the benefits of defragmentation that are applicable to mechanical HDDs. So, there is no use defragging your thumb drive or ipod nano.
IMO, even with the rising popularity of SSDs, there is still a long way to go before they can seriously threaten the trusty magnetic-mechanical workhorse in our homes. As of now, the SSDs simply cannot compete on the price to performance ratio for home users.
* Excluding optical drives, that are infact even slower, but are only of peripheral interest (pun unintended) compared to a HDD.
Posted by: Tensor at February 25, 2008 6:41 AM"Use a good backup strategy instead." isn't that what the USB drive is?
Posted by: Justin at February 26, 2008 10:39 PM"Hmmmm... makes me wonder how many MacBook Air owners may defrag their new SSD drives, potentially reducing the lifespan of the device."
Fortunately for OSX users, fragmentation isn't much of a problem. HFS+ (the standard file system for MAC users) uses a combination of methods to reduce fragmentation.Such as aggressive read ahead and write behind caching, journaling, and delayed allocation. not to say that files don't get fragmented, but there is much less of a performance hit from the few files that do get scattered across the drive.
That being said, great tip. Never, ever, ever defrag a SSD.
Posted by: Gramps at February 26, 2008 10:48 PMWhat is the best Virus protection package for 4 computers?
Posted by: Connie Ramirez at March 2, 2008 9:38 PMConnie Ramirez -
In the May 1, 2008 edition of Windows Secrets several anti-virus programs were evaluated. The results were obtained from Virus Bulletin's April 2008 edition and tested 37 antivirus solutions. The tests were run on Windows Vista PCs and included a list of viruses known to be circulating in the wilds of the Internet as of January 2008: worms, bots, polymorphic viruses, file infector viruses, and even legacy virus strains.
Five products notched perfect 100% detection rates (prices include one year of virus-signature updates): Avira Antivir Personal (free for noncommercial use), ESET NOD32 ($40), Fortinet FortiClient ($28), Frisk FPROT Antivirus ($29 for up to five PCs), and Symantec Norton Antivirus ($40).
You can install and register free copies of Avira on each of your 4 computers from www.free-av.com. Understand that AV products seem to change rankings with each other depending on latest updates, test authorities, etc. As Leo has said many times, better to use something rather than nothing at all.
http://ask-leo.com/whats_the_best_popup_blocker_antivirus_software_antispyware_software.html
Posted by: Ben at May 7, 2008 6:47 AMinteresting article leo, i totally agree about the wearing out of flash/solid state storage.
But i have been testing numerous SD and micro SD cards and the read/write benchmarks show a noted improvment after a defrag! how can this be explained?
Posted by: henry cossak at September 1, 2008 1:25 AM@ Henry Cossak:
You might be noticing a performance increase in regards to file writes; it's been proven to my personal satisfaction that writing to fragmented free space will be slower than writing to contiguous free space. The bigger the file being written, the bigger the performance impact. No noticable difference in read time, though.
Personally, I defrag my heavily written flash drives once every 6 months or so.
Posted by: El Bogarto at September 25, 2008 11:26 AMI have an ocz 64gb SSD, which when new windows reported as 56GB. everytime I do a diskclean up I lose space not gain it. Last time I checked it I found I had 26GB installed inclunding hidden system file. 56-26 = 30GB of free space, but windows reported it as 20GB. I had lost 10GB over a few weeks. I decided to defrag the drive and got all the space back. Is this a windows or drive problem. Vista 64bit btw.
Posted by: Paulc at October 5, 2008 8:56 AM