Re: Linux should better cope with power failure

Charles Cazabon (linux-kernel@discworld.dyndns.org)
Mon, 19 Mar 2001 13:59:10 -0600


Otto Wyss <otto.wyss@bluewin.ch> wrote:
> Lately I had an USB failure, leaving me without any access to my system
> since I only use an USB-keyboard/-mouse. All I could do in that
> situation was switching power off and on after a few minutes of
> inactivity. From the impression I got during the following startup, I
> assume Linux (2.4.2, EXT2-filesystem) is not very suited to any power
> failiure or manually switching it off. Not even if there wasn't any
> activity going on.

You're not using the filesystem the way you should, if you expect to be
able to kill the power and not lose data.

> How could this be accomplished:
> 1. Flush any dirty cache pages as soon as possible. There may not be any
> dirty cache after a certain amount of idle time.

Mount the filesystem sychronously if you want this.

> 2. Keep open files in a state where it doesn't matter if they where
> improperly closed (if possible).

Mount the filesystem read-only if you want this.

> 3. Swap may not contain anything which can't be discarded. Otherwise
> swap has to be treated as ordinary disk space.

The kernel doesn't care about what's in swap. Fix your applications if they
do.

Charles

-- 
-----------------------------------------------------------------------
Charles Cazabon                            <linux@discworld.dyndns.org>
GPL'ed software available at:  http://www.qcc.sk.ca/~charlesc/software/
Any opinions expressed are just that -- my opinions.
-----------------------------------------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/