detect and disable bad sectors on an USB Flash?

Discussion in 'PC Hardware, Software and Displays' started by Npl, May 30, 2009.

  1. Npl

    Npl
    Veteran

    Joined:
    Dec 19, 2004
    Messages:
    1,905
    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 :???:
     
  2. Davros

    Legend

    Joined:
    Jun 7, 2004
    Messages:
    12,925
    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.
     
  3. ShaidarHaran

    ShaidarHaran hardware monkey
    Veteran

    Joined:
    Mar 31, 2007
    Messages:
    3,941
    /r implies /f so I only ever us the /r switch in my line of work
     
  4. Npl

    Npl
    Veteran

    Joined:
    Dec 19, 2004
    Messages:
    1,905
    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?
     
  5. Bouncing Zabaglione Bros.

    Legend

    Joined:
    Jun 24, 2003
    Messages:
    6,363
    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.
     
  6. Blazkowicz

    Legend Veteran

    Joined:
    Dec 24, 2004
    Messages:
    5,376
    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
     
    #6 Blazkowicz, Jun 2, 2009
    Last edited by a moderator: Jun 2, 2009
  7. Zaphod

    Zaphod Remember
    Veteran

    Joined:
    Aug 26, 2003
    Messages:
    2,162
    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.
     
  8. Grall

    Grall Invisible Member
    Legend

    Joined:
    Apr 14, 2002
    Messages:
    9,337
    Location:
    La-la land
    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.
     
  9. Npl

    Npl
    Veteran

    Joined:
    Dec 19, 2004
    Messages:
    1,905
    Its a cheap one I guess.. I dint pay for it so I dont know :grin:

    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.
     
  10. Zaphod

    Zaphod Remember
    Veteran

    Joined:
    Aug 26, 2003
    Messages:
    2,162
    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.
     

Share This Page

  • About Beyond3D

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...