Opinions on FS for CF? - Embedded

This is a discussion on Opinions on FS for CF? - Embedded ; Currently I'm working with an embedded setup that has ext3 as the filesystem on the CF card. At the moment I don't know all my needs for the filesystem other than to handle the files (mostly executables and config files) ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: Opinions on FS for CF?

  1. Opinions on FS for CF?

    Currently I'm working with an embedded setup that has ext3 as the
    filesystem on the CF card. At the moment I don't know all my needs for
    the filesystem other than to handle the files (mostly executables and
    config files) that are on the FS. I don't know if I need write access
    (I'd prefere not to). I know I won't have swap on the card (I'll
    recommend a micro-drive if I have to have swap). My immediate goals is
    to have a small memory usage foot print. I'm going to start off by
    setting the FS to read-only and see if anyone screems. I'm currently
    using a 2G CF card but at the moment I'm not using more than 256M. I
    doubt I can trim it to fit below 128M so I'm stuck with 256M.

    --
    Linux Home Automation Neil Cherry ncherry@linuxha.com
    http://www.linuxha.com/ Main site
    http://linuxha.blogspot.com/ My HA Blog
    Author of: Linux Smart Homes For Dummies

  2. Re: Opinions on FS for CF?

    Neil Cherry wrote:
    > Currently I'm working with an embedded setup that has ext3 as the
    > filesystem on the CF card. At the moment I don't know all my needs for
    > the filesystem other than to handle the files (mostly executables and
    > config files) that are on the FS. I don't know if I need write access
    > (I'd prefere not to). I know I won't have swap on the card (I'll
    > recommend a micro-drive if I have to have swap). My immediate goals is
    > to have a small memory usage foot print. I'm going to start off by
    > setting the FS to read-only and see if anyone screems. I'm currently
    > using a 2G CF card but at the moment I'm not using more than 256M. I
    > doubt I can trim it to fit below 128M so I'm stuck with 256M.
    >


    There are better filesystems for flash than ext3. if you want to use
    ext3, you need the "noatime" option. You could try something like jffs.
    Read about it on http://en.wikipedia.org/wiki/JFFS

  3. Re: Opinions on FS for CF?

    Neil Cherry ha scritto:
    > Currently I'm working with an embedded setup that has ext3 as the
    > filesystem on the CF card. At the moment I don't know all my needs for
    > the filesystem other than to handle the files (mostly executables and
    > config files) that are on the FS. I don't know if I need write access
    > (I'd prefere not to). I know I won't have swap on the card (I'll
    > recommend a micro-drive if I have to have swap). My immediate goals is
    > to have a small memory usage foot print. I'm going to start off by
    > setting the FS to read-only and see if anyone screems. I'm currently
    > using a 2G CF card but at the moment I'm not using more than 256M. I
    > doubt I can trim it to fit below 128M so I'm stuck with 256M.
    >


    best choice for CF is ext2

  4. Re: Opinions on FS for CF?

    wimpunk wrote:

    > Neil Cherry wrote:
    >> Currently I'm working with an embedded setup that has ext3 as the
    >> filesystem on the CF card. At the moment I don't know all my needs for
    >> the filesystem other than to handle the files (mostly executables and
    >> config files) that are on the FS. I don't know if I need write access
    >> (I'd prefere not to). I know I won't have swap on the card (I'll
    >> recommend a micro-drive if I have to have swap). My immediate goals is
    >> to have a small memory usage foot print. I'm going to start off by
    >> setting the FS to read-only and see if anyone screems. I'm currently
    >> using a 2G CF card but at the moment I'm not using more than 256M. I
    >> doubt I can trim it to fit below 128M so I'm stuck with 256M.
    >>

    >
    > There are better filesystems for flash than ext3. if you want to use
    > ext3, you need the "noatime" option. You could try something like jffs.
    > Read about it on http://en.wikipedia.org/wiki/JFFS


    JFFS is useless for CF cards. JFFS does its job on plain flash devices only.

    JB

  5. Re: Opinions on FS for CF?

    On Mon, 14 Jul 2008 21:42:04 +0200, Helix wrote:
    >Neil Cherry ha scritto:
    >> Currently I'm working with an embedded setup that has ext3 as the
    >> filesystem on the CF card. At the moment I don't know all my needs for
    >> the filesystem other than to handle the files (mostly executables and
    >> config files) that are on the FS. I don't know if I need write access
    >> (I'd prefere not to). I know I won't have swap on the card (I'll
    >> recommend a micro-drive if I have to have swap). My immediate goals is
    >> to have a small memory usage foot print. I'm going to start off by
    >> setting the FS to read-only and see if anyone screems. I'm currently
    >> using a 2G CF card but at the moment I'm not using more than 256M. I
    >> doubt I can trim it to fit below 128M so I'm stuck with 256M.
    >>


    >best choice for CF is ext2


    why not ext3 or some other journaling file system?

  6. Re: Opinions on FS for CF?

    AZ Nomad ha scritto:
    > On Mon, 14 Jul 2008 21:42:04 +0200, Helix wrote:
    >> Neil Cherry ha scritto:
    >>> Currently I'm working with an embedded setup that has ext3 as the
    >>> filesystem on the CF card. At the moment I don't know all my needs for
    >>> the filesystem other than to handle the files (mostly executables and
    >>> config files) that are on the FS. I don't know if I need write access
    >>> (I'd prefere not to). I know I won't have swap on the card (I'll
    >>> recommend a micro-drive if I have to have swap). My immediate goals is
    >>> to have a small memory usage foot print. I'm going to start off by
    >>> setting the FS to read-only and see if anyone screems. I'm currently
    >>> using a 2G CF card but at the moment I'm not using more than 256M. I
    >>> doubt I can trim it to fit below 128M so I'm stuck with 256M.
    >>>

    >
    >> best choice for CF is ext2

    >
    > why not ext3 or some other journaling file system?



    Many people ask what is the best filesystem to use on a CF.

    The best choice you can do is with the simplest filesystem: ext2

    Be careful: The CF can be damaged when power goes down while writing.
    This has nothing to do with the file system.
    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. 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).

    (This was already discussed several times in the net and no solution was
    found.)

  7. Re: Opinions on FS for CF?

    Please take a look at the forum backlog form one or two years. The theme
    "file system for Flash cards" has been already been discussed in depth
    many times.

    -Michael

  8. Re: Opinions on FS for CF?

    Helix wrote:
    > AZ Nomad ha scritto:
    >> On Mon, 14 Jul 2008 21:42:04 +0200, Helix wrote:
    >>> Neil Cherry ha scritto:
    >>>> Currently I'm working with an embedded setup that has ext3 as the
    >>>> filesystem on the CF card. At the moment I don't know all my needs for
    >>>> the filesystem other than to handle the files (mostly executables and
    >>>> config files) that are on the FS. I don't know if I need write access
    >>>> (I'd prefere not to). I know I won't have swap on the card (I'll
    >>>> recommend a micro-drive if I have to have swap). My immediate goals is
    >>>> to have a small memory usage foot print. I'm going to start off by
    >>>> setting the FS to read-only and see if anyone screems. I'm currently
    >>>> using a 2G CF card but at the moment I'm not using more than 256M. I
    >>>> doubt I can trim it to fit below 128M so I'm stuck with 256M.
    >>>>

    >>
    >>> best choice for CF is ext2

    >>
    >> why not ext3 or some other journaling file system?

    >
    >
    > Many people ask what is the best filesystem to use on a CF.
    >
    > The best choice you can do is with the simplest filesystem: ext2
    >
    > Be careful: The CF can be damaged when power goes down while writing.
    > This has nothing to do with the file system.
    > 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. 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).
    >
    > (This was already discussed several times in the net and no solution was
    > found.)


    I understand that CF does its own wear levelling, so flash-specific file
    systems like JFFS2 or YAFS are not appropriate. But why ext2 instead of
    ext3? All that ext3 adds (AFAIK) is a journal, which can help if there
    is an unexpected crash / power-out during a write. It won't help if CF
    card dies completely, but it *will* help keep your file system
    consistent (and the data, if you use data journalling - at the cost of
    extra write wear) if writes are partially completed. So if your main
    power is somewhat decoupled from the CF power, and you have a capacitor
    to support a couple of hundred millisecond's write time, ext3 will do
    much better than ext2 on power failures. It won't give you absolute
    guarantees, but it should give much better chances. Or am I missing
    something here?



  9. Re: Opinions on FS for CF?

    David Brown wrote:

    > I understand that CF does its own wear levelling, so flash-specific file
    > systems like JFFS2 or YAFS are not appropriate. But why ext2 instead of
    > ext3? All that ext3 adds (AFAIK) is a journal, which can help if there
    > is an unexpected crash / power-out during a write.


    It's a trade off. A journalling file system has more device writes - 3
    times as many, viz

    - write change to journal
    - make change to file
    - update journal to say file change complete

    Whether this translates to 3 times as many flash block erasures (one of
    the key lifetime factors for flash disks) sort of depends. But the
    odds are there will be more such erasures for a Journal based FS.
    However, a Journal based system does help with systems that may be
    inadvertantly power cycled or reset - they come back up a lot more quickly
    most of the time.

    As has been said, the biggest saving is to mount with noatime.

    Next, if your system does few file writes or there is possibility
    of random resets/powerloss then may be ext3 is ok. For a system with heavy
    write load, I'd use ext2 and battery backup the whole system, and hide the
    reset button :-)

    However lots of us would like to hear about better options.

  10. Re: Opinions on FS for CF?

    Jim Jackson wrote:
    > David Brown wrote:
    >
    >> I understand that CF does its own wear levelling, so flash-specific file
    >> systems like JFFS2 or YAFS are not appropriate. But why ext2 instead of
    >> ext3? All that ext3 adds (AFAIK) is a journal, which can help if there
    >> is an unexpected crash / power-out during a write.

    >


    (I don't know if anyone is still interested in this thread - I've been
    on holiday, hence the late reply.)

    > It's a trade off. A journalling file system has more device writes - 3
    > times as many, viz
    >
    > - write change to journal
    > - make change to file
    > - update journal to say file change complete
    >
    > Whether this translates to 3 times as many flash block erasures (one of
    > the key lifetime factors for flash disks) sort of depends. But the
    > odds are there will be more such erasures for a Journal based FS.
    > However, a Journal based system does help with systems that may be
    > inadvertantly power cycled or reset - they come back up a lot more quickly
    > most of the time.
    >


    Yes, that's where the journal helps most - restarting after an unclean
    umount.

    Details may vary between flash systems, but it is certainly possible to
    write stepwise to a flash block - you only need to erase it when it is
    to be reclaimed for re-use. As you say, it is the erase count that
    effectively determines the lifetime of a flash block - there should be
    no noticeable penalty for writing a metadata log. But that's the theory
    for a file system designed for directly using flash (such as YAFS or
    JFFS2) - I don't know if ext3 on a CF card is equally efficient.

    > As has been said, the biggest saving is to mount with noatime.
    >


    That's the case for almost all file systems, on flash or disk - atime is
    an expensive and little used luxury. AFAIK, relatime is a modern
    alternative for those that need the access time of files with less overhead.

    > Next, if your system does few file writes or there is possibility
    > of random resets/powerloss then may be ext3 is ok. For a system with heavy
    > write load, I'd use ext2 and battery backup the whole system, and hide the
    > reset button :-)
    >
    > However lots of us would like to hear about better options.


    I don't know about "better" options - it is, as you say, a trade-off,
    and the "best" solution will vary according to application.

+ Reply to Thread