Filesystem to use on compact flash card.

Hi All,

I am working on a new embedded Linux project. We are using compact flash to store the whole OS image and a writeable partition for storing certain logged information. All other partitions on the CF are read only. The system currently uses ext3. Additionally the system will be installed at locations where power cycling can happen without warning (no UPS).

Can anyone recommend the best filesystem to use on the CF? The main requirements are:

- can survive power cycling without warning

- not wear out the CF with too many write operations

Thanks for any responses.

Reply to
sean.machin
Loading thread data ...

Not possible ! The CF itself can be damaged when power goes down while writing. This has nothing to do with the file system.

Even worse: the CF might be damaged so badly that in needs factory reformatting before it's accessible again.

Even worse: The CF manufactures don't provide any specification how long it needs power after a write to ensure that the CF data will not be damaged. So even a hardware based solution is not possible.

(This was already discussed here several times and no solution was found.)

The CF card does wear handling internally, so there is no use in trying not to write too often to the same address (which can be ensured eg by JFFS2). You just need to switch off maintaining the last access date (and whatever read statistics).

-Michael

Reply to
Michael Schnell

Your first look should be to find CF cards which WILL NOT BE DAMAGED by a power cycle in the middle of an operation. You will have to look at the "professional" series of CF cards with a builtin capacitor.

Or: You add an extra capacitor only for the CF card into your system.

For the file system: you should not use a journaling file system. It will produce much more wear out. Many people are using ext2.

Use the mount option "noatime".

regards

Wolfgang

Reply to
Wolfgang Mües

Do these really exist ?

Do the manufacturers guarantee that function in the docs ?

-Michael

Reply to
Michael Schnell

Thanks for the responses guys. On that project we also have the option of using different hardware. Would using an SD card with JFFS2 or YAFFS be a better solution in terms of handling power outages and wear handling?

Reply to
sean.machin

No. SD-cards behave in the same way as CF cards, as they have internal wear leveling.

JFFS2 is only applicable if you have flash that is directly addressable by the CPU.

-Michael

Reply to
Michael Schnell

Please understand that the problem of power outage is a problem of the INTERNAL controller inside a SD or CF card. If you want to avoid this problem, add an extra capacitor only for the SD/CF card to your board. It is not possible to cure such a failure with an external software.

And please, don't use an journaling file system on flashcards with internal controller (SD,MMC,CF), as they give your product a shorter lifetime because of accelerated wear out.

regards

Wolfgang

Reply to
Wolfgang Mües

Just HOW MUCH capacitance is needed?

--

Jerry McBride (jmcbride@mail-on.us)
Reply to
Jerry McBride

I never saw any spec by a memory card manufacturer on ho long the internal work after a write to the card will last and how much energy it takes. Unless you find such a spec you can't be sure. If you find it, please let us know !

-Michael

Reply to
Michael Schnell

Over the years, so engineers have measured the current into the MMC card to see how long it "runs on".

I don't have any links to such measurments, but it would be easy to setup again to see if more modern cards are any better.

donald

Reply to
donald

No chance !

In the card, the actions to do wear leveling take place after a write access.

Here it reorganizes it's memory structure, moving information from tiered pages to seldom used pages, all of which needs appropriate updating of lots of pointer tables, which - again - dwell in pages that might be prone to wear out and sometimes need to be moved. So this process is too rare to offer decent statistics and it's proceeding can't be predicted (unless the manufacturer who knows what is going on there releases decent specs on it).

-Michael

Reply to
Michael Schnell

I guess I was not clear, about "how much charge should the (battery, cap) needs to keep after a power fail".

If the spec sheets don't give a clue, watching the current after many read and writes would help to understand the algorithm.

donald

Reply to
donald

formatting link

Reply to
Wolfgang Mües

I don't agree. A new card will do many (millions) of write cycles without the need of reorganization. If the card is used a lot the time needed for housekeeping after a write will increase dramatically.

-Michael

Reply to
Michael Schnell

On the first sight, I don't see such a parameter. I'll have to take a deeper look at the data sheet

-Michael

Reply to
Michael Schnell

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.