Which root filesystem for embedded system using SD card and that can restart ?
Linux - Embedded & Single-board computerThis 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.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Which root filesystem for embedded system using SD card and that can restart ?
Hi,
I use an embedded system such as :
- customized from Atmel SAMA5D3_Xplained
- using only an SD card high capacity (SDHC 8 Go, class 10)
- boot from SD card (no flash drive)
- use 2 partitions :
-- FAT : for bootloader and kernel
-- ext3 : for root file system, with option noatime,nodiratime,barrier=1 (in fstab)
My question :
I want to change my partition system such as :
- FAT : for bootloader and kernel (like previously)
- ext4 : for root file system and a few write (only during update binaries)
- ??? : for additional files (environ 10 files) but with a lot of write
But I don't know which file system is the better choice for this 3rd partition.
I read other discussion and I read often that Ext4 and JFS would be a good choice, but I fear that appeals to sync is slow.
I like XFS and use that. I also use ext2 for my boot partition.
I've never used ext3 for anything.
(Stepping up on my soap box)
When making embedded systems and having things like Compact Flash, SD card, or other forms of "flash" drives. My rules of thumb are that I minimize all writes to disk as much as possible, if not near entirely. Why? Because constant writes and re-writes eventually degrade the flash drive. The individual storage points get a bias or small charge where eventually they'll be so biased that they can no longer be logically switched, thereby leaving them stuck at either 1 or 0 permanently. That's what causes flash drives to eventually wear out.
There is wear leveling which is performed by the file management system, and likely nothing special needs to be applied to use that, I don't know but I'm betting the default file system for most modern kernels just does that as a common practice no matter what the storage media is.
However if you have greater than 50% of the disk used and then have a remaining 50% say, and you use close to half of that, or let's just say for whatever space you have, you commonly use/re-use 50% or more of that as you run and end up writing, erasing, re-writing stuff; wear leveling IMHO isn't going to help you, because the space for performing this leveling is limited due to the fact that you're using half or more of your disk already, and anything which is stored but left alone such as RFS binary files and so forth, those aren't going to be moved as part of the leveling.
Use of a RAM drive is good to do. Many hobby and embedded boards have little RAM to start with though, so just a heads up.
(Tripping backwards off that soap box, sorry for "going on")
My 3rd partition contains files used such as :
- some log files (2 text files) where new log is appended at end of file, but they are a lot of writing
-- so theses writing don't use the same secteur of SD card and theses files can use 1Go dedicated
- the other files is modified anywhere, but they are some writing
-- so theses writing can use the same secteur of SD card
My problem is that I don't RAM disk because my application (security and access control system) should not lose information if I turn off the power of board.
In the worst case, I accept to lose data but never journal because it's an embedded autonomous system.
The file system that write first data then write journal seems a good choice for log file on append. Because if the system loses the last log (less 10 events since 5 seconds) after the turn off.
Today on a another embedded system board (with AM3517 and kernel 2.6.36), I use ext4 with commit 10 minutes and I call sync() after each writing for the more important file. But this sync() call can slow down system during a some seconds (< 5sec)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.