0

I'm working on a project which uses FatFs lib to mount a partition in an External Flash memory, to store image and audio files. The application, anyway, is vehicular, and the file system sometimes looses its memory references due to the unavoidable electrical noise and oscillation of this kind of environment.

(That is: The files are still there, but no one can see any of them - or sometimes, can see only some of them! - if they can manage to mount the FAT partition again).

One of the solutions I came up with to deal with this problem is to create a backup copy of the partition, so I can restore it automatically if the file system looses its references.

Could anyone help me or shed some light on how I could manage to do this?

Mike
  • 4,041
  • 6
  • 20
  • 37
ulissesBR
  • 93
  • 11
  • 2
    Copying a *partition* is traditionally file-system agnostic, you just make sure the file system is umounted or at least closed out to a fixed read-only state, and then you simply copy all of the blocks - the `dd` tool for example knows nothing about filesystem structure. It's likely though that the issues you face are more fundamental, starting with faulty electrical design and continuing through a likely suboptimal choice of filesystem. Along the way you need to understand what the flash translation layer *actually* does, and you'll probably want to pick something journaling. – Chris Stratton Aug 06 '19 at 05:22
  • It may be better to copy the actual data into newly created files on a new filesystem – Chris Stratton Aug 06 '19 at 05:24
  • It's fine if you use FAT on memory card to download/upload data from embedded device. However, for long running embedded operation FAT is a really suboptimal choice and you should consider using filesystem that is designed for that, if at all possible. – user694733 Aug 06 '19 at 09:38

0 Answers0