Author Topic: How to mark a bad sector on the SD card  (Read 7188 times)

orthogonal

  • Newbie
  • *
  • Posts: 34
    • View Profile
How to mark a bad sector on the SD card
« on: August 10, 2004, 02:00:01 am »
I have at least one bad sector on my vfat formatted SD card. fsck.vfat finds it but fails to fix it.

What do I need to do to mark the sector bad so it's not used?


(I primarily use the SD card for MP3s and larger (0.05MB to 0.5MB) document files (books), and am willing to use whatever filesystem will maximize space.; if it's easier to make it not vfat, that's a possibility.

While I don't want to make the entire card a cramfs, I'd accept making part a cramfs if it saved a significant amount of space (which seems unlikely, as I'm dealing with already compressed data).)

The SD card is a 512 MB SanDisk
Sharp Zaurus 5600  \"Special ROM\" 1.3   Ambicomm WL1100C CF Wifi  SanDisk 512MB SD

VeeDubb

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • http://
How to mark a bad sector on the SD card
« Reply #1 on: August 10, 2004, 02:36:41 am »
I'm not trying to be a smart a$$, but seriously, the reason you are having this problem is because you have a SanDisk brand card.

The only way you are going to actualy fix it is to throw it out and buy a card from a quality manufacturor such as lexor.

As for a temporary fix for this card, I'm not realy sure.  Perhaps someone else can help you there.

As for the file system you choose, it realy doesn't matter if you're not putting software on it.  If you run windows on the desktop, I'd use vfat.  If you run linux, or if you install software to the card, I'd format it ext2.

omega

  • Hero Member
  • *****
  • Posts: 626
    • View Profile
    • http://
How to mark a bad sector on the SD card
« Reply #2 on: August 10, 2004, 03:16:44 am »
haven't tried it, but can you format it with fdisk and enable bad sector checking?
Gorgeous C860, 256 Sandisk SD, 1Gig Pretec 40x CF, PDAIR leather case & the really cool retractable iPDA USB sync/charge cable. Powered by PDAXROM BETA 1.

My wish - to have a Command & Conquer style game on my Z! (FREECNC!!!) Simcity 2000 would also be great.

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
How to mark a bad sector on the SD card
« Reply #3 on: August 25, 2004, 12:47:55 pm »
May have some bad news for you...

Some flash memory technology moves block allocations around to spread the load across the card since flash technology has a high but limited number of write cycles. You may therefore find that your bad block is constantly on the move.

My suggestion is actually to use something like ext2 or ext3 where you can get e2fsck to check and log bad blocks to the bad block inode. I would then try filling the card, emptying and rerunning e2fsck to gain some confidence in the card (repeat as necessary as they say on shampoo bottles).

If you really want to stick with FAT then try dosfsck -t as this marks unreadable blocks as bad.

If your errors start moving then it's time to chuck the thing though.
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card