Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Aug 2001 02:25:44 +0300
From:      Alex Popa <razor@ldc.ro>
To:        Randy Bush <randy@psg.com>
Cc:        dannyman <dannyman@toldme.com>, "Koster, K.J." <K.J.Koster@kpn.com>, FreeBSD Stable <freebsd-stable@FreeBSD.ORG>
Subject:   Re: so where did the space go?
Message-ID:  <20010805022544.B93455@ldc.ro>
In-Reply-To: <E15T2Gk-0000Bl-00@roam.psg.com>; from randy@psg.com on Sat, Aug 04, 2001 at 03:19:10PM %2B0100
References:  <59063B5B4D98D311BC0D0001FA7E452205FD9D3A@l04.research.kpn.com> <E15IUj2-0006Hf-00@rip.psg.com> <20010802222556.C28622@toldme.com> <E15Sygd-0002AD-00@roam.psg.com> <20010804123839.P28602@toldme.com> <E15T2Gk-0000Bl-00@roam.psg.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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