I'm working on a data logger project. My system is running over an ARM9 (mini2440), with a custom kernel (version 22.214.171.124) and the file system is yaffs.
The main program was written in c++ and uses a database (sqlite 3.7.8) to store all collected data.
I need to save everything on the database wich is placed on a sd card. The sdcard was formatted with FAT.
Sometimes the files inside it gets corrupted. So I need to run the "chkdsk" windows command to try to recover those files (sometimes I can't, and this is really boring).
Sometimes the equipment is suddenly powered down (I can't avoid it), and I think that's a possible (or the main) reason of the problem.
I decided to change from FAT to EXT3, because EXT3 have the journaling system (I read that journal keeps the information about file operations). I think that journal could help me, but I'm not sure. I'm very noob on linux.
So, I have 2 questions.
1 - Using the EXT3 filesystem, will really help to prevent those corruptions?
2 - Is there another way to prevent that?
Tutorials, books and any links are welcome
Anyway, I was trying to test the EXT3 file system, but i'm stuck on a problem: EXT3-fs: mounted filesystem with writeback data mode.
I used "gparted" to format my sdcard, and then I created an ext3 partition. On my PC (ubuntu 8.04) I can read and write files inside it. But when I try to mount it on ARM, i got the above error.
I'm using the following command line:
# mount -o async -o noatime -o rw -t ext3 /dev/mmcblk0p5 /sdcard
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with writeback data mode.
The device is 'correctly' mounted. I can cd to /sdcard and ls the files normally, but I can't write anything. It's mounted with read only mode.
# touch test.txt
touch: test.txt: Read-only file system
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 256640 28132 228508 11% /
tmpfs 29496 0 29496 0% /dev/shm
/dev/mmcblk0p5 1904536 35664 1772888 2% /sdcard
Can someone help me with this too?
Thanks in advance