LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   USB memory stick - badblocks - how to format? (https://www.linuxquestions.org/questions/linux-hardware-18/usb-memory-stick-badblocks-how-to-format-593056/)

mazzo 10-19-2007 12:07 PM

USB memory stick - badblocks - how to format?
 
Hi

I recently got errors on my 1G memory stick. I checked using a badblocks -w test which picked up over 73M ofbad blocks.

What I want to know is if there is a way to format the stick so that it locks out the bad blocks. Unfortunately I haven't worked out how to do it and everytime I use mkfs.vfat -c it doesn't block them.

Peacedog 10-20-2007 10:34 AM

Hi mazzo, You could try
Code:

dosfsck
Good luck. ;-)

Junior Hacker 10-20-2007 12:17 PM

There is also a dos utility that can be run from a CD or Floppy called "SpinRite" that isolates bad sectors while re-mapping the data contained in those sectors to spare sectors. This is handy when working on storage mediums with data you don't want to loose. I've never tried it on a flash drive, but because it works on hard drives and floppy disks, I would think it would work on flash drives also.
Flash drives did not exist when it was designed, and it is not highly used anymore as modern hard drives have the ability to remap bad sectors on their own compared to older drives that could not.

jschiwal 10-20-2007 12:39 PM

Spinrite is a great program but for $80, might as well get a new pendrive. It is probably at the end of it's life anyway. Since you don't know for sure if SpinRite would work on pendrives.

If you mount a pendrive, make sure you use the "noatime" and "flush" options.

Check the manpage for the dosfsck program mentioned above. It may have an option to map bad sectors when formatting. Also look at the mtools programs. This assumes that the filesystem is a FAT type.

I don't know if you can run badblocks directly on a pen drive. Pen drives may work differently then hard drives or floppys.
I think the driver has to read a larger segment then you may by writing to, write the changes to the buffer, erase the segment and rewrite it. A tool like badblocks & SpinRite may exercise the read/erase/write cycle too much shortening the life of the device.

borosspet 10-28-2008 06:05 AM

Quote:

Originally Posted by jschiwal (Post 2930853)
I don't know if you can run badblocks directly on a pen drive. Pen drives may work differently then hard drives or floppys.
I think the driver has to read a larger segment then you may by writing to, write the changes to the buffer, erase the segment and rewrite it. A tool like badblocks & SpinRite may exercise the read/erase/write cycle too much shortening the life of the device.

Yes of course, it works on USB sticks too, i tried it. However, my problem is a little bit more problematic:
My stick has some untrustable sectors, the data copied to them becomes damaged almost immediately; but neither fsck, neither badblocks, neither Windows fsck programs (chkdsk, scandisk, ndd) cannot find any problematic block.

Is there a thorough badblock tester for hdd/fdd/usb drives (which operates like memtest86+ for memory modules), which tests more times and very thoroughly the drives, to find not only the real bad, but the just untrustable (sometimes looks like bad, sometimes looks like good) sectors too?

Boross Péter
Hungary

michaelk 10-28-2008 08:39 PM

Not an expert on Flash memory but they have their own built in bad block / error detection system sometimes known wear leveling. jschiwal is correct that flash memory must erase an entire block to modify a single cell. I also agree that regular hard disk drive utilities may not work. The drive may just be broken and not sure if there is any decent repair software.

Junior Hacker 10-29-2008 12:26 AM

Quote:

Originally Posted by borosspet (Post 3323885)
Is there a thorough badblock tester for hdd/fdd/usb drives (which operates like memtest86+ for memory modules), which tests more times and very thoroughly the drives, to find not only the real bad, but the just untrustable (sometimes looks like bad, sometimes looks like good) sectors too?

Boross Péter
Hungary

Look up SpinRite.


All times are GMT -5. The time now is 03:27 PM.