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.
Re: Filesystem to use on compact flash card.
>[color=blue]
> Can anyone recommend the best filesystem to use on the CF? The main
> requirements are:
>
> - can survive power cycling without warning[/color]
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.)
[color=blue]
> - not wear out the CF with too many write operations[/color]
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,
[email]sean.machin@thompsontec.com[/email] wrote:
[color=blue]
> 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).[/color]
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.
> CF cards which WILL NOT BE DAMAGED...
Do these really exist ?
Do the manufacturers guarantee
that function in the docs ?
-Michael
Re: Filesystem to use on compact flash card.
On Apr 26, 5:32*am, Michael Schnell
<mschnell_at_bschnell_dot...@aol.com> wrote:[color=blue][color=green]
> > CF cards which WILL NOT BE DAMAGED...[/color]
>
> Do these really exist ?
>
> Do the manufacturers guarantee
> that function in the docs ?
>
> -Michael[/color]
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.
> Would using an SD card with JFFS2 or YAFFS be a better solution in[color=blue]
> terms of handling power outages and wear handling?[/color]
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
Re: Filesystem to use on compact flash card.
Sean,
[email]sean.machin@thompsontec.com[/email] wrote:
[color=blue]
> 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?[/color]
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.
Wolfgang Mües wrote:
[color=blue]
> Sean,
>
> [email]sean.machin@thompsontec.com[/email] wrote:
>[color=green]
>> 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?[/color]
>
> 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.[/color]
Just HOW MUCH capacitance is needed?
--
Jerry McBride (jmcbride@mail-on.us)
Re: Filesystem to use on compact flash card.
> Just HOW MUCH capacitance is needed?
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.
Michael Schnell wrote:[color=blue][color=green]
>> Just HOW MUCH capacitance is needed?[/color]
>
> 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[/color]
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
Re: Filesystem to use on compact flash card.
> Over the years, so engineers have measured the current into the MMC card[color=blue]
> to see how long it "runs on".[/color]
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.
Michael Schnell wrote:
[color=blue][color=green]
>> CF cards which WILL NOT BE DAMAGED...[/color]
>
> Do these really exist ?
>
> Do the manufacturers guarantee
> that function in the docs ?
>[/color]
[url]http://www.stec-inc.com/product/mach4cf.php[/url]
Re: Filesystem to use on compact flash card.
>[color=blue]
> If the spec sheets don't give a clue, watching the current after many
> read and writes would help to understand the algorithm.[/color]
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
Re: Filesystem to use on compact flash card.
> [url]http://www.stec-inc.com/product/mach4cf.php[/url][color=blue]
>[/color]
On the first sight, I don't see such a parameter. I'll have to take a
deeper look at the data sheet
-Michael