Welcome, Unregistered.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Reply
Old 30-May-2009, 22:45   #1
Npl
Senior Member
 
Join Date: Dec 2004
Posts: 1,900
Default detect and disable bad sectors on an USB Flash?

I got an 8GB Kingston USB Stick as gift, but it reliably produces errors... like deleting and copying a file again will result in the very same fault in the file.
So I assume it has bad blocks, is there any way to detect and mark these as "don`t use"?

Ps. A friend who bought bought himself a Kingston USB Stick experiences the same problems, 2 out of 2 Kingston Sticks broken
Npl is offline   Reply With Quote
Old 30-May-2009, 23:41   #2
Davros
Regular
 
Join Date: Jun 2004
Posts: 11,088
Default

chkdsk /F

Chkdsk corrects disk errors only if you specify the /f command-line option. Chkdsk must be able to lock the drive to correct errors.

/r : Locates bad sectors and recovers readable information. The disk must be locked.
__________________
Guardian of the Bodacious Three Terabytes of Gaming Goodness™
Davros is offline   Reply With Quote
Old 31-May-2009, 14:19   #3
ShaidarHaran
hardware monkey
 
Join Date: Mar 2007
Posts: 3,910
Default

/r implies /f so I only ever us the /r switch in my line of work
ShaidarHaran is offline   Reply With Quote
Old 31-May-2009, 16:16   #4
Npl
Senior Member
 
Join Date: Dec 2004
Posts: 1,900
Default

Hmm, I dont want to repair data or the filesystem, I want to mark defect sectors as unuseable so files aint instantly corrupted if I copy them over one of these blocks.
Not sure if FAT32 even has support for that?
Npl is offline   Reply With Quote
Old 31-May-2009, 16:52   #5
Bouncing Zabaglione Bros.
Regular
 
Join Date: Jun 2003
Posts: 6,359
Default

Quote:
Originally Posted by Npl View Post
I got an 8GB Kingston USB Stick as gift, but it reliably produces errors... like deleting and copying a file again will result in the very same fault in the file.
So I assume it has bad blocks, is there any way to detect and mark these as "don`t use"?

Ps. A friend who bought bought himself a Kingston USB Stick experiences the same problems, 2 out of 2 Kingston Sticks broken
I have seen sticks that produce this kind of error on front panel USB sockets, but not on the back panel USB sockets that are connected directly to the motherboard. I'm guessing that there are issues with some of the cabling or interference with some front ports on cases. Either that or the USB 2 sticks aren't properly backwards compatible with USB 1.1

The same sticks would work perfectly on more up to date motherboards/cases, so it may be an incompatibility issue, rather than a faulty memory stick.
Bouncing Zabaglione Bros. is offline   Reply With Quote
Old 02-Jun-2009, 21:19   #6
Blazkowicz
Senior Member
 
Join Date: Dec 2004
Posts: 4,979
Default

I remember coming across dysfunctional panel USB ports, too. They were fine for a gamepad but not much else, so that had to be some terrible cabling quality or something. using the same motherboard's port on a rear bracket worked.

one weird way to deal with that USB drive, if your BIOS supports a "USB legacy storage" option that make the drive usable under DOS : boot a win98 floppy (i.e. win98 DOS) in some way and launch scandisk in "minutious" mode. it looks nice and colored. This is how we marked bad sectors in the good old times

another way would be, boot a linux install, or live CD, or live USB, and run fsck.vfat -t

Last edited by Blazkowicz; 02-Jun-2009 at 21:28.
Blazkowicz is offline   Reply With Quote
Old 02-Jun-2009, 21:33   #7
Zaphod
Remember
 
Join Date: Aug 2003
Posts: 2,117
Default

Quote:
Originally Posted by Npl View Post
Hmm, I dont want to repair data or the filesystem, I want to mark defect sectors as unuseable so files aint instantly corrupted if I copy them over one of these blocks.
Not sure if FAT32 even has support for that?
Not possible with flash memory at all (the controller should detect defects itself and physical blocks doesn't correspond to addressing blocks). Are they from a reputable dealer? Lots of "hacked" USB sticks around where the file system reports more space than is actually there and files will corrupt once filled with more than the actual capacity.
Zaphod is offline   Reply With Quote
Old 06-Jun-2009, 14:26   #8
Grall
Invisible Member
 
Join Date: Apr 2002
Location: La-la land
Posts: 6,866
Default

If there's some kind of wear leveling employed in this flash stick then marking sectors on a filesystem level won't help. When you start writing to it data will just move around to wear all flash pages more or less evenly. thus moving the filesystem sectors marked as bad to new cells...

As zaphod mentioned the controller should deal with this. Theoretically anyway. Could be just a cheap flash stick.

I'd put it in to be recycled, then buy a new fresh stick. If cells are bad on it right off the bat chances are it'll just keep on corrupting your data no matter what you do. Flash sticks are so cheap, it's not worth the trouble faffing with a partially borked one. You don't need the headaches if it garbles any important data for you.
Grall is offline   Reply With Quote
Old 06-Jun-2009, 17:30   #9
Npl
Senior Member
 
Join Date: Dec 2004
Posts: 1,900
Default

Quote:
Originally Posted by Grall View Post
As zaphod mentioned the controller should deal with this. Theoretically anyway. Could be just a cheap flash stick.
Its a cheap one I guess.. I dint pay for it so I dont know

There seems to be no sort of wear-leveling, the same blocks always get damaged if I copy files over. And running it on a port on the backisde of the PC makes no difference.
Npl is offline   Reply With Quote
Old 06-Jun-2009, 17:48   #10
Zaphod
Remember
 
Join Date: Aug 2003
Posts: 2,117
Default

Sounds like a "hacked" one to me. You could try a utility that will fill it write/verifying a series of files to check whether the size has been faked (or just do in manually with large files). Here's a guide that also has instructions on how to revive it (down to actual size) if it's been capacity faked.
Zaphod is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:45.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.