From owner-freebsd-stable Sat Aug 4 16:25:54 2001 Delivered-To: freebsd-stable@freebsd.org Received: from ldc.ro (ldc-gw.pub.ro [192.129.3.227]) by hub.freebsd.org (Postfix) with SMTP id 956F637B401 for ; Sat, 4 Aug 2001 16:25:49 -0700 (PDT) (envelope-from razor@ldc.ro) Received: (qmail 1130 invoked by uid 666); 4 Aug 2001 23:25:44 -0000 Date: Sun, 5 Aug 2001 02:25:44 +0300 From: Alex Popa To: Randy Bush Cc: dannyman , "Koster, K.J." , FreeBSD Stable Subject: Re: so where did the space go? Message-ID: <20010805022544.B93455@ldc.ro> References: <59063B5B4D98D311BC0D0001FA7E452205FD9D3A@l04.research.kpn.com> <20010802222556.C28622@toldme.com> <20010804123839.P28602@toldme.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from randy@psg.com on Sat, Aug 04, 2001 at 03:19:10PM +0100 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Aug 04, 2001 at 03:19:10PM +0100, Randy Bush wrote: > >>>> it was vmware under linux emul. > >>> lsof | grep /var > >> # lsof | grep vmware | grep /var > >> vmware 489 randy txt VREG 116,262148 140673024 16 /var (/dev/ad0s3e) > >> vmware 489 randy 11u VREG 116,262148 140673024 16 /var (/dev/ad0s3e) > >> vmware 492 randy txt VREG 116,262148 140673024 16 /var (/dev/ad0s3e) > >> vmware 492 randy 11u VREG 116,262148 140673024 16 /var (/dev/ad0s3e) > >> vmware 493 randy txt VREG 116,262148 140673024 16 /var (/dev/ad0s3e) > >> vmware 493 randy 11u VREG 116,262148 140673024 16 /var (/dev/ad0s3e) > > This says that a process named vmware has /var open. If you want to > > free the inodes attached to the files that you have removed, kill > > whatever processes may have been writing them. > > aiiii! do you folk READ the message before responding? look at the first > line above. > > the question is WHY and WHAT vmware is hanging on to. that is a physical > disk. > > randy > Try this: fstat | awk '/var/ {print $2, $3, $6}' The output of this command gives you three columns, the command name, the pid and the inode number. You can search for each of the files by doing something like "find /var -inum $inodenumberhere". If there is no file found, then most probably that file is still on the disk, but not in one of the directories (meaning the kernel will deallocate its inode and disk space when the file gets closed). So by looking at the first column you can find out who is using your disk space, and from the second column the pid you should kill. I would probably do something like (this written without testing, beware!): hostname# bash bash-2.05# fstat | awk ' /var/ { print $2 $3 $6}'| while read name pid \ inum; do echo Program: $name Pid: $pid Inode: $inum;find /var \ -xdev -inum $inum -print;done bash-2.05# exit hostname# exit In the output of the above (now tested :) ) You should see a line with a filename after each Program-Pid-Inum line. If you do not, then you probably found the guilty file. Please note that errors are normal, because sometimes the inum field is in fact that of a pipe or a dash, so find should complain about those. Good luck and have fun! Alex ------------+------------------------------------------ Alex Popa, | "Artificial Intelligence is razor@ldc.ro| no match for Natural Stupidity" ------------+------------------------------------------ "It took the computing power of three C-64s to fly to the Moon. It takes a 486 to run Windows 95. Something is wrong here." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message