Re: Have ext3 on SanDisk CF but can't disable write-back caching as kernel instructs

From: Steve Watt (steve_at_nospam.Watt.COM)
Date: 07/18/03


Date: Thu, 17 Jul 2003 22:06:53 GMT

In article <4189894b.0307101425.23f52806@posting.google.com>,
Dan Harkless <usenet@harkless.org> wrote:
>My company is currently developing a Linux-based embedded device for
>installation on airliners. The OS is based on SuSE 8.2 Pro's Minimum
>System install.

Yikes, a certification nightmare from the start...

>Our device may lose power at any time, but it's very important we
>don't corrupt our data or our filesystem metadata, so our filesystems
>(except our initrd-based root filesystem) are ext3, mounted
>'data=journal'.

As has been said many times through the thread, this is probably not
a good way to do things, because of how the ext3 journal is laid
out.

You've said, later in the thread, that you have a power-off detector
and a cap to provide some amount of run time after power failure.

I'd solve this with two separate CF devices: One to boot & root from,
that gets mounted read-only. The other one holds volatile data. Create
a ramdisk the size of the volatile data CF, and use that exclusively
until you get the power-off signal. Then dump the whole thing to
the volatile data CF, while holding off writes as you had described
elsewhere. You might even unmount the ramdisk (if possible) before
dumping it to the flash so the image is clean.

You need to be sure you have enough time on the backup cap for that
write to complete, which shouldn't be all that much longer than
the worst case for a whole boatload of dirty cache blocks.

Depending on how large your budget is (we *are* talking aircraft
system prices, here), you could also go to some kind of battery-backed
RAM for the read/write filesystem, as well. It's not that much more
expensive than CF, and you get more flexibility.

-- 
Steve Watt KD6GGD  PP-ASEL-IA          ICBM: 121W 56' 57.8" / 37N 20' 14.9"
 Internet: steve @ Watt.COM                         Whois: SW32
   Free time?  There's no such thing.  It just comes in varying prices...


Relevant Pages