Author Topic: Are there multiple patition table records on a disk (i.e. a flash drive?)  (Read 26736 times)

st2000

  • Member
  • ***
  • Posts: 44
Hi...

I am having problems with embedded Linux.  An SDCard just does not want to work in this device.  I reformatted the SDCard in a Win7 box and the Win7 box can mount the SDCard.  But the embedded Linux box sees all kinds of errors. When I try to manually mount the device it says the device is not there.

Are there multiple copies of the partition table on a disk.  Could it be the embedded Linux box is looking at the wrong copy?

-thanks

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Does the host system support the file system on the SD card?

Also see Debugging here:

http://www.lvr.com/mass_storage.htm#basics

It's about USB mass storage but the issues may also apply to SD cards.

Jan

st2000

  • Member
  • ***
  • Posts: 44
Does the host system support the file system on the SD card?

Yes.  We have used FAT16 cards on the embedded Linux target box hundreds of times.  A few of these cards have somehow been corrupted.  Perhaps we pulled them while still mounted.  We reprogram these cards many times in a day trying new software.  Every once in a while the cards end up in this state.  They mount on Win7, WinXP and Linux Fedora13 boxes.  But they do not mount on the target Linux box.  I have spent hours on this problem.  The only indication there is a problem out side of the target Linux box is when I do a fdisk on the Linux Fedora13.  Then I see some errors.  Why does not either Win box complain?  Why does not a reformat of the card on a Win box fix the problem?  Why is Win such a crummy OS?

So far, the only way I have been able to fix this problem is to do a byte by byte copy on an SDCard duplicator from a good card to a bad card.  I suspect a dd type copy on the Linux Fedora13 box will work as well.

Thoughts of one good and one bad partition table record crossed my mind.  That the embedded Linux OS was not picking the good copy.  But I have not been able to find much evidence that is how disk partitioning works.

Also see Debugging here:

http://www.lvr.com/mass_storage.htm#basics

It's about USB mass storage but the issues may also apply to SD cards.

Jan

Thanks, I'll take a look.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Reformatting a volume or partition doesn't help if the problem is in the master boot record.

Each volume has two copies of the FAT, but the second one is just for use in repairing a damaged FAT.

Windows and Fedora13 may just have more tolerant or robust mass-storage drivers.

A low-level reformatting as you're doing may be the best way to reclaim the cards.

Jan