From owner-freebsd-questions@FreeBSD.ORG Tue Feb 3 17:03:09 2009 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33CCD106566C for ; Tue, 3 Feb 2009 17:03:09 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email1.allantgroup.com (email1.emsphone.com [199.67.51.115]) by mx1.freebsd.org (Postfix) with ESMTP id D51AA8FC0C for ; Tue, 3 Feb 2009 17:03:08 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan-a.emsphone.com [199.67.51.107]) by email1.allantgroup.com (8.14.0/8.14.0) with ESMTP id n13H2ZD7073156 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 3 Feb 2009 11:03:06 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.3/8.14.3) with ESMTP id n13H2ZV2007573 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 3 Feb 2009 11:02:35 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.3/8.14.3/Submit) id n13H2XoL007539; Tue, 3 Feb 2009 11:02:33 -0600 (CST) (envelope-from dan) Date: Tue, 3 Feb 2009 11:02:33 -0600 From: Dan Nelson To: Sandra Kachelmann Message-ID: <20090203170233.GM75802@dan.emsphone.com> References: <91b92520902030746j2256dc58y2b1447c6e4471e4@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <91b92520902030746j2256dc58y2b1447c6e4471e4@mail.gmail.com> X-OS: FreeBSD 7.1-STABLE User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: ClamAV version 0.94.1, clamav-milter version 0.94.1 on email1.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (email1.allantgroup.com [199.67.51.78]); Tue, 03 Feb 2009 11:03:07 -0600 (CST) X-Scanned-By: MIMEDefang 2.45 Cc: questions@freebsd.org Subject: Re: NFS, how to find out which files are used 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, 03 Feb 2009 17:03:09 -0000 In the last episode (Feb 03), Sandra Kachelmann said: > I have an NFS fileserver and would like to figure out which files are > being read/written to. Is there something to find that out? Something > similar to samba's 'smbstatus' command. The best you can do currently is run tcpdump/wireshark and watch the remote file operations as they happen... NFS doesn't access files by filename, but by NFS filehandle (basically device+inode number), so a remote client first looks up the filename to get the filehandle, and all accesses are done via the filehandle at that point. Theoretically, one could write a dtrace script that watches calls to nfs_namei, nfsrv_read, and nfsrv_write, and then matches read/write ops with the filenames that were looked up beforehand. -- Dan Nelson dnelson@allantgroup.com