Wear Levelling on Flash Memorychris_admin
What is wear levelling?
From the very first moment that you crack open your new Flash memory based device and start to use it you are entering into a process that will, eventually, result in the failure of individual blocks on the device and eventually, the device will fail completely. This is due to the nature of flash memory, it can only be written to a finite number of times – in the early days of flash this number of cycles was significantly lower than the number that you can expect from a high quality flash device today – but it is still very real. Typically this finite number of read cycles will be a lot (up to perhaps 100,000) however it does mean that, despite what many people think, a solid state device is not going to last forever.
With this in mind you are well advised to NOT rely on a single flash drive as a sole storage for critical data. The policy should always be to keep multiple backups for data that is irreplaceable.
Wear levelling itself is a method of prolonging the usable life of a flash memory device by spreading the data out using algoritms and techniques that prevent any one area of the flash from being used more than any other. This process and the implementation of it varies as does the effectiveness of the approach, but all modern flash, from SD cards and Compact Flash and consumer grade SSD right through to enterprise storage. The method breaks the data down into small chunks and sees to it that these chunks are distributed evenly, data can be (and is) moved around the flash memory between file versions, during routine housekeeping and in the event of errors.
What does this mean for Data Recovery?
As a process Wear Levelling works by the controller chip and firmware allocating the data to the Flash NAND chip either statically or dynamically. This process varies depending upon the type of comtroller, manufacturer’s implementation of the wear levelling algorithm as well as the capacity, quality and page size of the flash memory chip itself.
Whilst this process happens transparently (for the most part), it does pose an issue when it comes to attempting to retrieve lost data from the flash memory chips directly. The challenge, following initial reading and image creation of each flash chip, is to work out how the data was written to the medium in the first place. This process can vary from straight forward to highly complex depending on who implemented it and how.
The purpose of this article isn’t to go into too much detail about wear levelling, more to warn users of these extremely handy devices not to rely on them as unlikely to fail. Like any manufactured device, despite any inbuilt systems to negate failure, they can and will fail at some point in the future. The secret is for you to have decommissioned the device before it fails on you causing stress and data loss.
If the device does fail then the chances of a successful recovery are extremely good, but as they say prevention is better than cure.