From owner-freebsd-questions@FreeBSD.ORG Thu Jan 5 03:20:37 2006 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 A728516A41F for ; Thu, 5 Jan 2006 03:20:37 +0000 (GMT) (envelope-from user@dhp.com) Received: from shell.dhp.com (shell.dhp.com [199.245.105.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 62BCF43D45 for ; Thu, 5 Jan 2006 03:20:37 +0000 (GMT) (envelope-from user@dhp.com) Received: by shell.dhp.com (Postfix, from userid 896) id BA8DD312F5; Wed, 4 Jan 2006 22:20:36 -0500 (EST) Date: Wed, 4 Jan 2006 22:20:36 -0500 (EST) From: user To: freebsd-questions@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: how can I find out which md device I just used ? (mdconfig) 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, 05 Jan 2006 03:20:37 -0000 mdconfig will use the next available md device, as long as you do not specify a particular device on the command line with the -u switch. Which is great. However, in a script, the very next thing I want to do is mount that mdconfig'd vnode filesystem. But I do not know which md device mdconfig just used. I do not see any way in the mdconfig man page to get mdconfig to output what device it is using when it is invoked ... So ... assuming I am running mdconfig, followed by mount, in a shell script ... and I do not specify a device becuase i do not know what devices are available (beacuse I am running it automated) ... how can I find out (any suggestions appreciated) what md device just got used so I can mount it ? I consiudered running `mdconfig -l` before and after the mdconfig, and choosing the one that shows up as new, but that is not elegant and is vulnerable to a race condition. THanks.