From owner-freebsd-questions@FreeBSD.ORG Thu Jul 28 21:49:54 2005 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 4204E16A41F for ; Thu, 28 Jul 2005 21:49:54 +0000 (GMT) (envelope-from freebsd@philip.pjkh.com) Received: from zhonka1.zhonka.net (zhonka1.zhonka.net [66.228.195.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id DBC9243D49 for ; Thu, 28 Jul 2005 21:49:53 +0000 (GMT) (envelope-from freebsd@philip.pjkh.com) Received: from wolf.pjkh.com ([66.228.196.74]) by zhonka1.zhonka.net (Post.Office MTA v3.5.3 release 223 ID# 0-58414U4500L450S0V35) with ESMTP id net; Thu, 28 Jul 2005 14:49:53 -0700 Received: from localhost (localhost [127.0.0.1]) by wolf.pjkh.com (Postfix) with ESMTP id 879B758C7; Thu, 28 Jul 2005 14:49:46 -0700 (PDT) Received: from wolf.pjkh.com ([127.0.0.1]) by localhost (wolf.pjkh.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 67831-02; Thu, 28 Jul 2005 14:49:46 -0700 (PDT) Received: by wolf.pjkh.com (Postfix, from userid 1000) id 5588958C6; Thu, 28 Jul 2005 14:49:46 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by wolf.pjkh.com (Postfix) with ESMTP id 4F6C954BF; Thu, 28 Jul 2005 14:49:46 -0700 (PDT) Date: Thu, 28 Jul 2005 14:49:46 -0700 (PDT) From: Philip Hallstrom To: "Marc G. Fournier" In-Reply-To: <20050728183517.O43872@ganymede.hub.org> Message-ID: <20050728144620.A67924@wolf.pjkh.com> References: <20050728183517.O43872@ganymede.hub.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at pjkh.com Cc: freebsd-questions@freebsd.org Subject: Re: Determine processing holding open a 52+Gig file ... 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: Thu, 28 Jul 2005 21:49:54 -0000 > 'k, this is the second time its happened ... on a file system that is > currently 35% full (52G free), all the disk space disappeared ... > > Is there a way of finding out what process is holding open this "immense" > file? I'm pretty sure lsof can tell you... either just plain "lsof" or maybe with the directory name... # lsof +D /tmp COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME postgres 66218 postgres 5u unix 0xd9c93680 0t0 /tmp/.s.PGSQL.5432 sshd 66325 greg 7u unix 0xd9d02800 0t0 /tmp/ssh-xIDIHoLn/agent.66325 +D D This option causes lsof to search for all open instances of directory D and all the files and directories it contains to its complete depth. Processing of the +D option does not follow symbolic links within D unless the -x or -x l option is also specified. Nor does it search for open files on file system mount points on subdirectories of D unless the -x or -x f option is also specified. Note: the authority of the user of this option limits it to searching for files that the user has permission to examine with the system stat(2) function. Further note: lsof may process this option slowly and require a large amount of dynamic memory to do it. This is because it must descend the entire directory tree, rooted at D, calling stat(2) for each file and directory, building a list of all the files it finds, and searching that list for a match with every open file. When directory D is large, these steps can take a long time, so use this option prudently.