From owner-freebsd-questions@FreeBSD.ORG Thu Jan 5 06:24:19 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 0486516A41F for ; Thu, 5 Jan 2006 06:24:19 +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 76BB943D55 for ; Thu, 5 Jan 2006 06:24:18 +0000 (GMT) (envelope-from user@dhp.com) Received: by shell.dhp.com (Postfix, from userid 896) id 065A1312F5; Thu, 5 Jan 2006 01:24:16 -0500 (EST) Date: Thu, 5 Jan 2006 01:24:16 -0500 (EST) From: user To: Malcolm Kay In-Reply-To: <200601051424.38041.malcolm.kay@internode.on.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-questions@freebsd.org Subject: Re: 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 06:24:19 -0000 On Thu, 5 Jan 2006, Malcolm Kay wrote: > On my system (5.4) mdconfig reports the created device to stdout: > So: > memdevice=`mdconfig -a -t malloc -s10M` > sets the device name in $memdevice. Thank you very much - I have just verified that this works the same way on FreeBSD 6.0. I appreciate your help. I am curious, I am doing two things at one here - setting the variable _and_ configging the md device. What is the best way, in a shell script, to also test to make sure that the device configured properly ? If the device does not configure properly, all I see is that I get a empty variable ... would it be appropriate to `text -z` that variable to see if it is zero ? Or is there a better way to approach that ? Basically I do not want to act unless I am sure that the mdconfig actually happened, and there really is a variable defined...