From owner-freebsd-stable@FreeBSD.ORG Wed Mar 5 10:32:38 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5169106566B for ; Wed, 5 Mar 2008 10:32:38 +0000 (UTC) (envelope-from rick@wirelessleiden.nl) Received: from lid-email-2.joost.net (lid-email-2.joost.net [89.251.0.185]) by mx1.freebsd.org (Postfix) with ESMTP id 66B378FC1C for ; Wed, 5 Mar 2008 10:32:38 +0000 (UTC) (envelope-from rick@wirelessleiden.nl) Received: from lid-email-1.joost.net (zimbra-3.back [10.0.0.247]) by lid-email-2.joost.net (Postfix) with ESMTP id D772B30000E50 for ; Wed, 5 Mar 2008 10:00:29 +0000 (GMT) Received: from freezone-mac.local (colbert-ext.lid.theveniceproject.com [89.251.0.64]) by lid-email-1.joost.net (Postfix) with ESMTP id 8FEC8C0F4BB3E for ; Wed, 5 Mar 2008 10:07:13 +0000 (UTC) Message-ID: <47CE70E0.4000607@wirelessleiden.nl> Date: Wed, 05 Mar 2008 11:07:28 +0100 From: Rick van der Zwet Organization: Stichting Wireless Leiden User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: freebsd-stable@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Mapping stat(1) device number/name to partition? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2008 10:32:38 -0000 Hi all, I am looking for a way to detect the file system a certain file lives and next whether this file system is mounted/accessible as writable. [1] As stat(1) is helping me out to found out the proper device name/number of a certain file with the command `stat -f "%d" /etc/motd`, but next will be the mapping from this device number (st_dev) to the proper partion/mount point. Which handy shell utility program will help me doing this? Or even better what are the proper search terms to find this answer, as mine attempts on the mailing archives, man pages and Google where not very successful Thanks a lot! /Rick [1] Part of getting rid of the annoying motd update failure message, when /etc is not writable. I know setting update_motd=NO in /etc/rc.conf will do the trick as well, but I would like to see him detecting it auto-magically ;-)