Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Sep 2003 23:51:17 -0700 (PDT)
From:      Doug Barton <DougB@FreeBSD.org>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        freebsd-current@freebsd.org
Subject:   Re: swapon vs savecore dilemma 
Message-ID:  <20030901233731.U6074@znfgre.qbhto.arg>
In-Reply-To: <41076.1062480964@critter.freebsd.dk>
References:  <41076.1062480964@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2 Sep 2003, Poul-Henning Kamp wrote:

> Hmm, that was an unfortunate side effect.

Heh, well, stuff happens. I think your idea of opening swap exclusive is
probably a good one, but it will require some gymnastics to accomodate
it. One thing that'd really help is an option to savecore that tells us
if there is a dump to deal with or not. If I had that, we could do
something like this in /etc/rc.d/savecore

if there is no dump
	exit
else
	does fsck -p of the fs to write the dump to succeed?
		mount it rw
		write the dump
		clear the dump
		exit
	else
		does try fsck -y of the fs without swap succeed?
			mount, write, clear, exit
		else
			???

At the ??? point I'm not sure how best to proceed, since if we swapon to
the same partition with the dump, it's likely to corrupt the dump, yes?
On the other hand, we're doing swapon before savecore now, so I guess
I'm curious about how dangerous this really is.

Probably the right thing to do is to swapon, fsck -y, and if it succeeds
then swapoff, and try writing the dump anyway. I just want to be
sure before we start re-writing rc.d/savecore.

So, the first question is does the pseudocode above look reasonable, and
the second question is what's the likelihood of getting an option to
savecore to detect a dump to play with?

Doug

-- 

    This .signature sanitized for your protection



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030901233731.U6074>