[TAG] USB Drive Bad Sectors

Rick Moen rick at linuxmafia.com
Tue Oct 31 21:24:33 MSK 2006


Quoting Brandon M. Reynolds (breynolds at comtime.com):

> I have Linux (2.6.15.6) booting from a USB drive.  My application is
> machine control and I wanted to use something solid-state.  A USB stick
> seemed like a good idea because it is cheap and readily available and
> reasonably fast.
> 
> My problem is that I get file system corruption and "bad sectors" some
> times, presumably due to an unclean shut down.  I am using an ext2
> filesystem with the thinking that a journal would just wear out the
> drive in a certain spot.  Maybe that's not correct -- I am not sure if
> the drive has a wear-leveling algorithm implemented or not.
> 
> Questions:
> 
> 1. Is ext2 the right choice?  Or would reiserfs be better? Vfat??

Flash-memory drives have some peculiar physical characteristics, and
choice of filesystem for them depends on whether you value multi-OS
compatibility (which suggests VFAT) or whether you value drive life and
even-ness of wear (which suggests JFFS2 or YAFFS).  Essentially, they
have a limited number of erase/write cycles per sector, and each sector
must be read, erased, and rewritten any time any data in the sector
changes.  The reasons why VFAT is bad for drive life, not to mention
atime updating, follow logically from that, and should be obvious.

I imagine that the wear resulting from ext2/ext3 or ReiserFS would be
absolutely excessive.

> 2. Is their a quick way to detect bad sectors?  I tried running e2fsck
> -c but it has been 45 minutes so far!

I imagine that the wear resulting from e2fsck would be absolutely
frightful, sorry to say.

More at:
http://www.linuxjournal.com/article/6867
http://en.wikipedia.org/wiki/Flash_memory

-- 
Cheers,             The genius of you Americans is that you never make 
Rick Moen           clear-cut stupid moves, only complicated stupid moves 
rick at linuxmafia.com that make us wonder at the possibility that there may be 
                    something to them that we are missing. --Gamel Abdel Nasser





More information about the TAG mailing list