Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jan 2006 19:59:46 -0500 (EST)
From:      user <user@dhp.com>
To:        freebsd-questions@freebsd.org
Subject:   how can I determine the lowest not-in-use md device (for use with mdconfig) ?
Message-ID:  <Pine.LNX.4.21.0601041952510.8684-100000@shell.dhp.com>

next in thread | raw e-mail | index | archive | help

The command:

mdconfig -l

will tell me what md devices are in use currently on the system.  I have a
situation where I want to automatically mount a vnode filesystem with an
md device ... and I won't know ahead of time which devices are in use ...

So ... can anyone think of an elegant way to find the lowest available md
device ?

Basically, I want to know how to take thie output:

# mdconfig -l
md4 md0
#

and find which md?, that is not in that list, is the lowest ...

I don't even have a very good guess as to how to do this ...

I am working this into a /bin/sh shell script.

thanks.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.21.0601041952510.8684-100000>