Do you have a question? Post it now! No Registration Necessary
- sean.machin
April 25, 2008, 7:56 pm

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

Re: Filesystem to use on compact flash card.

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

Re: Filesystem to use on compact flash card.
Hello Sean,

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

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

Re: Filesystem to use on compact flash card.
On Apr 26, 5:32A0%am, 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?

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?

Re: Filesystem to use on compact flash card.

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

Re: Filesystem to use on compact flash card.

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

Re: Filesystem to use on compact flash card.

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

Re: Filesystem to use on compact flash card.

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
Site Timeline
- » i2c driver in linux
- — Next thread in » Embedded Linux
-
- » x86 kernel with bios assumptions
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » OT China seeing a major resurgence in COVID-19
- — The site's Newest Thread. Posted in » Electronics Design
-
- » name drop
- — The site's Last Updated Thread. Posted in » Electronics Design
-