Kill the power faster than poweroff?
Robert G. Brown
rgb at phy.duke.edu
Thu Sep 11 17:13:10 EDT 2003
On Thu, 11 Sep 2003, Donald Becker wrote:
> Somewhat over ten years ago most filesystems added an "I was unmounted
> cleanly" bit. What you really need to do unmount the file systems,
> which will have the effect of really doing what "sync" is supposed to do.
But I >>think<< that unless you kill all processes that own open files
on the filesystem (or otherwise force a close) umount will complain
about open files and not proceed even with e.g. the -f flag. If you do
kill all processes to be sure you can run umount, then you're basically
doing a full shutdown and back where you started.
Or you can run lsof, filter out the files that are open for writing (and
maybe reading -- don't know how umount manages files open for reading)
and kill their controlling process. Quickly umount to avoid the a race
on new processes opening files (which you could still lose, especially
if the file owning processes are children of a process waiting to open
another file owning process when its children terminate), cross your
fingers, power down. Not horribly safe or elegant, but ought to get a
good fraction of all open files especially on a node with a very
controlled task list that owns open writeable files in the first place.
I personally agree with other earlier remarks: use a journalling
filesystem, do a sync to minimize at least some problems, and then just
power off. You may well lose data in the write queues of open processes
(as you would likely do anyway if you killed the processes) but you
shouldn't end up with the system in a state that needs an fsck any more
than you would if you just powered off without even the sync.
Robert G. Brown http://www.phy.duke.edu/~rgb/
Duke University Dept. of Physics, Box 90305
Durham, N.C. 27708-0305
Phone: 1-919-660-2567 Fax: 919-660-2525 email:rgb at phy.duke.edu
Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf
More information about the Beowulf