From owner-freebsd-questions@FreeBSD.ORG Thu May 18 14:35:44 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 314D416A542 for ; Thu, 18 May 2006 14:35:44 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from mail7.sea5.speakeasy.net (mail7.sea5.speakeasy.net [69.17.117.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BC6243D45 for ; Thu, 18 May 2006 14:35:43 +0000 (GMT) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: (qmail 7141 invoked from network); 18 May 2006 14:35:42 -0000 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail7.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 18 May 2006 14:35:42 -0000 Received: by be-well.ilk.org (Postfix, from userid 1147) id D126828423; Thu, 18 May 2006 10:35:40 -0400 (EDT) To: boink References: <73cb07950605171612x5f2ea0f9vd4f8b297d5c1a5c6@mail.gmail.com> From: Lowell Gilbert Date: Thu, 18 May 2006 10:35:40 -0400 In-Reply-To: <73cb07950605171612x5f2ea0f9vd4f8b297d5c1a5c6@mail.gmail.com> (boink's message of "Thu, 18 May 2006 01:12:10 +0200") Message-ID: <44k68js8n7.fsf@be-well.ilk.org> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-questions@freebsd.org Subject: Re: Ignorant user overfilled /usr; strange errors followed. Fixed with fsck -y, but what exactly happened? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 May 2006 14:35:59 -0000 boink writes: > Dear FreeBSD, > > While attempting to follow filesystem activity (and not realising the > effect it would have) I left a ktrace running (something like ktrace > -di -p0 -ti - seen on a forum while searching for a Filemon equivalent > for FreeBSD). I had launched it while in /usr/ports, and forgot about > it. Doh! > > Some time later strange things started happening, so I exited from > X/KDE, and found a whole sequence of 'filesystem is full' errors on > the console. df said that /usr was at 108%. > > I found the offending ktrace.out file in /usr/ports (~25GB), killed > ktrace, deleted the file, and restarted X/KDE. It took about 5 > minutes to show the desktop, following a number of console messages > like 'xauth: creating new authority file...' > > So, I Googled around and found a few hints relating to permissions in > ~, but that didn't seem to be the problem; anyway I moved my ~/.kde/ > to ~/.kde_20060515 in an attempt to 'reset' kde's startup behaviour, > but X/KDE still took ages to start the GUI, following similar > messages. > > Even once X/KDE had started, some applications took a *long* time to > start (eg Firefox - 3/4 minutes to show blank home page). However, I > could still r/w access all files within /usr. > > Following the advice found on various fora, I then ran fsck -y in > single-user mode, with the following output: > ** Last mounted on /usr > ** Phase 1 - Check Blocks and Sizes > ** Phase 2 - Check Pathnames > ** Phase 3 - Check Connectivity > ** Phase 4 - Check Reference Counts > ** Phase 5 - Check Cyl groups > FREE BLK COUNT(S) WRONG IN SUPERBLK > SALVAGE? yes > > 401256 files, 4135860 used, 13715938 free (126762 frags, 169-647 > blocks, 0,8% fragmentation) > > Afterwards, X/KDE started with its usual alacrity, so I restored my > ~/.kde folder, and now everything seems to be exactly as before. > > My questions are these: > - How could /usr have been at 108%, given that 100% is the logical maximum? Because that *isn't* a given. See the FAQ entry on "How is it possible for a partition to be more than 100% full?" > - Is there any risk that a physically adjacent filesystem be > damaged? No. Furthermore, it's unlikely that your /usr was actually damaged, either. Don't run fsck on a live filesystem; of *course* it will always find "errors." > - How can it be that, immediately following the deletion of > /usr/ports/ktrace.out, I still had errors *at all* (prior to the > fsck)? See the FAQ entry on "The du and df commands show different amounts of disk space available. What is going on?" That describes what you probably should have done instead of the fsck. > - Given its recent history, can I now trust the integrity of /usr? Probably. But you may have messed it up with the fsck, so just to be sure, go into single-user mode, umount /usr, and fsck it WHILE IT IS NOT MOUNTED. > My interpretation of the situation is that following the deletion of > /usr/ports/ktrace.out, KDE, on startup, tried to write a file to a > filesystem that apparently (although incorrectly) had no free blocks. > fsck fixed the problem of the reported free blocks. More or less. But since the kernel's idea of what was on the disk no longer matched reality (i.e., it knew that in reality there *were* no free blocks), you may have gotten into trouble. > However, if this interpretation is correct, it shouldn't have worked > *at all* until fsck had repaired the filesystem. That is, KDE should > not have started at all. That doesn't necessarily follow. > So, prior to the fsck -y in single-user mode, what was happening in > the five minutes it took KDE to start? I don't know KDE at all, but my guess would be some kind of timeout.