Skip site navigation (1)Skip section navigation (2)
Date:      14 Oct 1998 17:06:45 +0200
From:      dag-erli@ifi.uio.no (Dag-Erling C. =?iso-8859-1?Q?Sm=F8rgrav?= )
To:        current@FreeBSD.ORG
Subject:   SoftUpdates anomaly: what happens when you 'mount -u -o ro /usr'?
Message-ID:  <xzpvhlnfaii.fsf@bombur.ifi.uio.no>

next in thread | raw e-mail | index | archive | help
I woke up to find my nightly doc build had failed due to a full /usr
partition. It's a 256MB partition with 160MB of data on it, so there
had to be a catch somewhere. I ran 'fsck -n' which revealed 13,500
unreferenced files.

I got a little scared and fsck'ed all my other file systems. Only one
had errors: /mp3 (where I keep my MP3 archive).

Both /usr and /mp3 were supposedly clean. I had a power outage a
couple of days ago and fsck -p at bootup revealed nothing, which isn't
surprising since they're usually mounted ro so they were marked as
clean.

/mp3 *may* have been hit by the fsck bug since it's "old enough", but
/usr was newfs'ed after it had gone totally bananas (remember the
problems I had with my streamer timing out during 'mt fsf'? That was
when I restored /usr after newfs'ing it). At the time I thought it had
been hit by the fsck bug which had just been fixed.

I thought a little more about it and found that /usr and /mp3 had one
thing in common: they're both usually mounted ro, but I occasionally
mount them rw for specific thing (make installworld, building the
docs, dumping a CD). To take installworld as an example, what I do is:

# cd /usr/src
# mount -u -o rw /usr
# make installworld
# mount -u -o ro /usr

(I have a script which does this of course)

Now looking through the fsck output (I scripted it) it seems that the
unreferenced files were mostly binaries, and I bet if I looked closer
I'd find out the mtimes are consistent with days I've run make world.
What's more, I'm not missing any files; my bet is that the
unreferenced files are files which have been deleted (replaced) by
installworld. They're unreferenced because they were unlinked, but for
some reason they were never freed. I think somebody with more fs
experience than I have should take a look at what happens to a
softupdates fs when it is switched from rw to ro. It seems obvious to
me that pending writes should be flushed; it also appears that this
doesn't actually happen.

OBTW, I didn't lose anything; I just newfsed both /usr and /mp3,
restored /mp3 from tape and /usr from disk, and kicked off a make
world. I have /usr/local on a separate filesystem.

DES
-- 
Dag-Erling Smørgrav - dag-erli@ifi.uio.no

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



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