Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.


  Search this Thread
Old 02-10-2011, 06:54 AM   #1
LQ Newbie
Registered: Jun 2010
Posts: 2

Rep: Reputation: 0
problem logging to a file on a jffs2

I'm using an embedded system on which a 200kB (uncompressed size) jffs2 file-system is used to rfid transactions.

This gives the following problems:
  1. Estimating the remaining free space does not work (that was expected). This is not very bad but it would be nice to know in advance whether logging a transaction will work.
  2. When the file-system is full, the write() does not give back an error code! This is bad! I 'solved' this by verifying the file contents by reading it completely. No need to say that costs performance.
  3. compression does not work properly: the file system is full after a limited (~100-400) amount of writes. This is very bad! Not only does this mean that the number of transactions that can be logged is much to low, but also that it can not be predicted when it will fail!
Does somebody know a way to solve or work around these problems?
E.g. using some configuration parameter for jffs2 or using another file system type?
Note that it should be able to handle flash memory, lots of small writes (~5000 per day) without waring out the flash, and it should be reliable so power outages won't corrupt the file-system.

(and I apologize for my English )
Old 02-11-2011, 03:01 AM   #2
Senior Member
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36

From my point of view and because I have already used it, JFFS2 is a really crappy filesystem. I think that you should have a look at UBIFS which is its successor:
The only drawback is that you will have to have a kernel version of 2.6.27 or higher else you may have a lot of integration problems.

Kind regards,

1 members found this post helpful.
Old 02-11-2011, 03:16 AM   #3
LQ Newbie
Registered: Jun 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks, I did not know UBIFS. I'll certainly have a look at it.

Meanwhile, is there anyone with another suggestion?
Old 02-11-2011, 04:20 AM   #4
Registered: Nov 2010
Location: Thailand
Distribution: Fedora 12, Ubuntu 10.10
Posts: 166

Rep: Reputation: 29
I've also used JFFs2. Once the partition is almost full a lot of problems occur, the partition becomes read-only, you can't delete files, etc... The only workaround we found is to increase the partition size so that there is enough space for jffs2 to do the things it needs (e.g. garbage collection).


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Read and Write a JFFS2 file system from WIndows PC xenorealm Linux - General 2 12-15-2010 06:39 PM
Create a jffs2 file system on a CF card with fc7? tigerhk89 Linux - General 0 03-27-2009 01:27 PM
Busybox And Jffs2 Problem ashthet Linux - General 0 09-02-2008 01:20 AM
Does fwrite() write entire file on jffs2? bjj2282 Linux - Software 0 10-26-2007 10:03 AM
Redboot - Loading Kernel Image & File Jffs2 MKSrivastava Debian 1 04-21-2007 07:03 PM > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 07:29 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration