From owner-freebsd-questions@FreeBSD.ORG Tue Oct 2 15:04:27 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8158216A421 for ; Tue, 2 Oct 2007 15:04:27 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from gaia.nimnet.asn.au (nimbin.lnk.telstra.net [139.130.45.143]) by mx1.freebsd.org (Postfix) with ESMTP id B29D613C46E for ; Tue, 2 Oct 2007 15:04:24 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from localhost (smithi@localhost) by gaia.nimnet.asn.au (8.8.8/8.8.8R1.5) with SMTP id BAA03183; Wed, 3 Oct 2007 01:04:06 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Wed, 3 Oct 2007 01:04:05 +1000 (EST) From: Ian Smith To: Zbigniew Szalbot In-Reply-To: <20071002060315.9EEC516A4DF@hub.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-questions@freebsd.org, Duane Hill Subject: Re: determining the space used in / partition X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Oct 2007 15:04:27 -0000 On Tue, 2 Oct 2007 08:03:00 +0200 Zbigniew Szalbot wrote: > 2007/10/2, Duane Hill : > > On Tue, 2 Oct 2007 at 07:36 +0200, zszalbot@gmail.com confabulated: [..] > > > For the record. During the backup, the file system is dumped to a dir > > > on a USB drive called backup. Now, since the drive was unavailable, > > > the dump utility created /backup dir and populated it with > > > lists-var-l0-2007-09-30.dump.bz2 (dumping var) but of course it died > > > as there was not enough space on the / to do it. I mean this is what I > > > make of this. > > > > > > So after deleting /backup I get: > > > df > > > Filesystem 1K-blocks Used Avail Capacity Mounted on > > > /dev/ad0s1a 198126 74084 108192 41% / > > > devfs 1 1 0 100% /dev > > > /dev/ad0s1e 44511308 4217760 36732644 10% /usr > > > /dev/ad0s1d 30462636 3210650 24814976 11% /var > > > devfs 1 1 0 100% /var/named/dev > > > /dev/da0s1c 75685352 34308200 35322324 49% /mnt/usbck > > > > I'm still learning about all the little details about the workings of > > dump myself. It would seem to me, you are dumping to /backup which is the > > mount point for the USB device. Would that hold true? > > I dump to /mnt/usbck/backup. Since backup dir was not present, the > script created it under / Naughty script. It should check against doing something like that, eg [ ! -d $backupdir ] && echo "no $backupdir - not mounted?" && exit 1 You do have a very small root filesystem for the size of your disk, so similar disasters may need some preventing. Something will want to use more than 100M in /tmp sometime, so you may want to symlink /tmp to say /usr/tmp if you haven't already. Re hunting for 'missing' diskspace on / (or any other mounted fs), the -x switch prevents du from crossing mountpoints, so something like .. # du -x -d1 / | sort -rn 146341 / 72306 /boot 49252 /root 7262 /rescue 4062 /sbin 3278 /lib 2356 /stand 2266 /etc 2114 /etc.old 2112 /etc.old.0 984 /bin 282 /libexec 8 /flash 2 /var 2 /usr 2 /usbdsk [..] .. takes next to no time on a small /. Cheers, Ian