World Library  
Flag as Inappropriate
Email this Article

Wear leveling

Article Id: WHEBN0000343505
Reproduction Date:

Title: Wear leveling  
Author: World Heritage Encyclopedia
Language: English
Subject: Solid-state drive, Flash file system, Flash memory, Write amplification, Flash memory controller
Collection: Computer Memory, Flash File Systems, Non-Volatile Memory, Solid-State Computer Storage
Publisher: World Heritage Encyclopedia

Wear leveling

Wear leveling (also written as wear levelling) is a technique[1] for prolonging the service life of some kinds of erasable computer storage media, such as flash memory used in solid-state drives (SSDs) and USB flash drives. There are a few different wear leveling mechanisms used in flash memory systems, each with varying levels of flash memory longevity enhancement.[2][3]

The term preemptive wear leveling (PWL) has been used by Western Digital to describe their preservation technique used on hard disk drives (HDDs) designed for storing audio and video data.[4] However, HDDs generally are not wear-leveled devices in the context of this article.


  • Rationale 1
  • Types 2
    • No wear leveling 2.1
    • Dynamic wear leveling 2.2
    • Static wear leveling 2.3
    • Comparison 2.4
  • Techniques 3
  • See also 4
  • References 5
  • External links 6


EEPROM and flash memory media have individually erasable segments, each of which can be put through a limited number of erase cycles before becoming unreliable. This is usually around 3,000/5,000 cycles[5][6] but many flash devices have one block with a specially extended life of 100,000+ cycles that can be used by the Flash memory controller to track wear and movement of data across segments. Erasable optical media such as CD-RW and DVD-RW are rated at up to 1,000 cycles (100,000 cycles for DVD-RAM media).

Wear leveling attempts to work around these limitations by arranging data so that erasures and re-writes are distributed evenly across the medium. In this way, no single erase block prematurely fails due to a high concentration of write cycles. In flash memory, a single block on the chip is designed for longer life than the others so that the memory controller can store operational data with less chance of its corruption.[3][7]

Conventional file systems such as FAT, UFS, HFS, ext2, and NTFS were originally designed for magnetic disks and as such rewrite many of their data structures (such as their directories) repeatedly to the same area. When these systems are used on flash memory media, this becomes a problem. The problem is aggravated by the fact that some file systems track last-access times, which can lead to file metadata being constantly rewritten in-place.[8]


There are three basic types of wear leveling mechanisms used in flash memory storage devices:[2]

No wear leveling

A flash memory storage system with no wear leveling will not last very long if data is written to the flash. Without wear leveling, the underlying flash controller must permanently assign the logical addresses from the operating system (OS) to the physical addresses of the flash memory. This means that every write to a previously written block must first be read, erased, modified, and re-written to the same location. This approach is very time-consuming and highly written locations will wear out quickly, while other locations will not be used at all. Once a few blocks reach their end of life, such a device becomes no longer operable.[2]

Dynamic wear leveling

The first type of wear leveling is called dynamic wear leveling and it uses a map to link logical block addresses (LBAs) from the OS to the physical flash memory. Each time the OS writes replacement data, the map is updated so the original physical block is marked as invalid data, and a new block is linked to that map entry. Each time a block of data is re-written to the flash memory, it is written to a new location. However, flash memory blocks that never get replacement data would sustain no additional wear, thus the name comes from only the dynamic data being recycled. Such a device may last longer than one with no wear leveling, but there are blocks still remaining as active that will go unused when a device is no longer operable.[2][3]

Static wear leveling

The other type of wear leveling is called static wear leveling which also uses a map to link the LBA to physical memory addresses. Static wear leveling works the same as dynamic wear leveling except the static blocks that do not change are periodically moved so that these low usage cells are able to be used by other data. This rotational effect enables an SSD to continue to operate until most of the blocks are near their end of life.[2][3] This is also sometimes referred to as global wear leveling, as the entire image is leveled.


The following table compares static and dynamic wear leveling:[3]

Item Static Dynamic
Endurance Longer life expectancy Shorter life expectancy
Performance Slower Faster
Design Complexity More complex Less complex
Typical Use SSDs[2] USB Flash Drives


There are several techniques for extending the media life:

  • A checksum or error-correcting code can be kept for each block or sector in order to detect errors or correct errors.
  • A pool of reserve space can also be kept. When a block or sector does fail, future reads and writes to it can be redirected to a replacement in that pool.
  • Blocks or sectors on the media can be tracked in a least frequently used (LFU) queue of some sort. The data structures for the queue itself must either be stored off-device or in such a way that the space it uses is itself wear-leveled or, in the case of flash memory, in a block with a specially extended life. However, usual cache algorithms are designed to manage the data flow into and out of RAM-based caches, making them not directly suitable for flash-based storage devices as they have an asymmetrical nature – reads are usually much faster than writes, and erase operations can be performed only one "block" at a time.[9]

M-Systems' product DiskOnChip used a software driver named TrueFFS which performed wear-leveling of NAND flash chips and made them appear to the OS like a conventional disk drive. On most contemporary flash memory devices, such as CompactFlash and Secure Digital cards, these techniques are implemented in hardware by a built-in microcontroller. On such devices, wear leveling is transparent and most conventional file systems can be used on them as-is.

Wear leveling can also be implemented in software by special-purpose file systems such as JFFS2 and YAFFS on flash media or UDF on optical media. All three are log-structured file systems in that they treat their media as circular logs and write to them in sequential passes. File systems which implement copy-on-write strategies, such as ZFS, also implement a form of wear leveling.

See also


  1. ^ U.S. Patent 6,850,443 Wear leveling techniques for flash EEPROM systems.
  2. ^ a b c d e f Perdue, Ken (2010-04-30). "Wear Leveling Application Note" (PDF).  
  3. ^ a b c d e "USB Flash Wear-Leveling and Life Span" (PDF).  
  4. ^ "Western Digital AV Hard Drive Product Information". Western Digital. Retrieved 2010-06-01. 
  5. ^
  6. ^
  7. ^ Arnd Bergmann (2011-02-18). "Optimizing Linux with cheap flash drives".  
  8. ^ Jonathan Corbet (2007-08-08). "Once upon atime".  
  9. ^ Qing Yang (2012-02-25). "Why Standard Cache Algorithms Won’t Work For SSDs". Retrieved 2013-11-26. 

External links

  • Flash SSDs – Inferior Technology or Closet Superstar?,, archived from the original on February 2, 2007
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.