From owner-freebsd-current Wed Oct 14 08:07:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA03762 for freebsd-current-outgoing; Wed, 14 Oct 1998 08:07:20 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA03729 for ; Wed, 14 Oct 1998 08:07:09 -0700 (PDT) (envelope-from dag-erli@ifi.uio.no) Received: from bombur.ifi.uio.no (2602@bombur.ifi.uio.no [129.240.64.200]) by ifi.uio.no (8.8.8/8.8.7/ifi0.2) with SMTP id RAA07949 for ; Wed, 14 Oct 1998 17:06:48 +0200 (MET DST) Received: from localhost (dag-erli@localhost) by bombur.ifi.uio.no ; Wed, 14 Oct 1998 15:06:47 GMT Mime-Version: 1.0 To: current@FreeBSD.ORG Subject: SoftUpdates anomaly: what happens when you 'mount -u -o ro /usr'? Organization: University of Oslo, Department of Informatics X-url: http://www.stud.ifi.uio.no/~dag-erli/ X-other-addresses: 'finger dag-erli@ifi.uio.no' for a list X-disclaimer-1: The views expressed in this article are mine alone, and do X-disclaimer-2: not necessarily coincide with those of any organisation or X-disclaimer-3: company with which I am or have been affiliated. X-Stop-Spam: http://www.cauce.org/ From: dag-erli@ifi.uio.no (Dag-Erling C. =?iso-8859-1?Q?Sm=F8rgrav?= ) Date: 14 Oct 1998 17:06:45 +0200 Message-ID: Lines: 50 X-Mailer: Gnus v5.5/Emacs 19.34 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.freebsd.org id IAA03743 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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