NSLU2-Linux
view · edit · print · history

Flash Drive Lifespan Survey

Flash memory is known to support a finite number of write/erase cycles. This limited lifespan may make it less suitable than a hard disk for some storage applications.

In order to gauge the actual lifespan that NSLU2 users get from their flash drives, please take part in this survey. Please add details of all your flash drives: it's important that we have details of working drives, not just failed ones.

Expected Lifespan

All modern flash drives should include wear levelling, so you shouldn't need to worry about some parts of the drive wearing out before others. If a flash device supports, say, 10000 write/erase cycles, then a 1 GByte flash drive should be able to do 10000 x 1 GByte = 10 TBytes of writes before failing. 10000 write cycles is at the bottom end of the expected range. At a write rate of 1 MByte/second it would take 10 million seconds to write 10 TBytes; that's about 100 days. So even if your NSLU2 is spending 10% of its time writing at that speed, you should still expect to get at least a few years life from your drive before any sectors fail. The iostat program can give you an idea of the write rate on your system.

(One factor that this doesn't allow for is short writes; a whole sector will be erased if you write just a few bytes.)

An interesting article on this subject can be found at http://www.storagesearch.com/ssdmyths-endurance.html.

Measuring Total Writes

To accumulate the total writes over the life of the disk you need to log periodic measurements. Scripts to do this are described on LogFlashDiskWriteStats.

Failure Modes

One would expect that a flash drive with bad sectors would fail gracefully, i.e. writes might become impossible but the drive would still be readable. Catastrophic failure, i.e. none of the disk can be read, have been known to occur. It is likely that this is the result of an effect other than the lifespan of the flash, and could be related to the quality of the manufacturing process.

Read and write speeds

Some flash drives are faster than others. Please also measure the speed of your drive as follows:

$ dd if=/dev/zero of=/file/on/drive bs=8192 count=1024 conv=fsync
1024+0 records in
1024+0 records out
8388608 bytes (8.4 MB) copied, 6.66182 seconds, 1.3 MB/s

((Request: I could not get dd to work despite changing the output file and many attempts [always "No Help available"].  Read several man pages and examples, looks like conv=fsync should be conv=sync.  Anyone who can elucidate, please do so.))

$ hdparm -t /dev/drivedevicenode
 Timing buffered disk reads:   28 MB in  3.03 seconds =   9.23 MB/sec

I am not convinced that conv=fsync really ensures that the data is flushed to the drive - any suggestions?

These numbers are only a guide. I suggest running these commands at least 3 times and reporting the median value. They may be affected by other activity on your system.

Tips for minimizing writes

  1. Make sure that your drive is mounted with the noatime option. If you don't use noatime, every file read will also perform a write to update the access time information. See Ext3flash for up to date information on achieving this.
  2. Look at your log files, and see if you are recording more than you need. You can also instruct syslog to buffer its output, avoiding writes after every line, by putting a - before the filename in syslog.conf.
  3. If you have a swap partition on flash, it might be a good idea to change the kernel's swapping behaviour to minimize swapping.
$ cat /proc/sys/vm/swappiness
60

$ echo "0" > /proc/sys/vm/swappiness

To make it permanent add the following line to /etc/sysctl.conf vm.swappiness=0

The Survey

Please add your details below.

UserManufacturerModelSizeRead speedWrite speedEntered serviceApplicationTotal writes (GBytes)Still workingFailedFailure mode
endecotpKingstonDataTravelerII512 MBunknownunknown2005-09Root fileystem 24/7  2006-10Entirely unresponsive
endecotpTranscendJetFlash V301 GB9 MByte/s1.4 MByte/s2006-11Root fileystem 24/71802007-05  
endecotpMy Flash 4 GB10.6 MByte/s3.9 MByte/s2006-04NFS exported /home5002007-05  
endecotpniKKin 1 GB11 MByte/s5 MByte/s2006-12Root fileystem light use 2006-12  
Steve GKingstonDataTravelerII1 GB8.3 MByte/s2.0 MByte/s2006-10Root fileystem 24/7 2006-12  
cyrxiSanDiskcruzer mini256 MBunknownunknown2007-05-04root fs 24/7not logging   
johlinSanDiskCruzer Micro1 GB9.83 MByte/s3.7 MByte/s2007-08-12Root filesystem, swap 24/7added later   
socorsKingstonData Traveller1 GB25.10 MByte/s4.5 MByte/s2007-08-13Root FS /home0,62008-01  
farealePNY 1 GBunknownunknown2007-Oct-08Root filesystem, swap - medium usenot logging   
fantuzPNY 2GBuknown3.04 MB/sec2007-Mar-15root FS - H24not logging2008-01  
fantuzPNY 4GBuknown2.50 MB/sec2007-Set-01root FS+swap - H24not logging2008-01  
fantuzDiCOM 1GBuknown1.82 MB/sec2007-Aug-15root FS+swap - H24not logging2008-01  
fantuzKINGSTONData traveller 2.02GBuknown7.52 MB/sec2007-Dec-25root FS - H24not logging2008-01  
RigasKINGSTONData traveller 2.02GBuknownunknown2008-April-09root FS - H24  2008-09Input/Output Errors
dbhSandiskCruzer Mini2GB5.76 MB/s 2009-02-02root/swap 24x7 2009-02-06  
Page last modified on February 06, 2009, at 09:49 PM