On Wed, Dec 07, 2011 at 01:22:51AM +0100, Thomas Klausner wrote:
> On Tue, Dec 06, 2011 at 10:37:57PM +0700, Robert Elz wrote:
> > So, here's an improved version, that actually correctly finds the
> > first available free device (rather than returning the one after the
> > biggest one in use), and which also checks to determine that the
> > device selected actually exists in /dev to be available to use.
> > (It does assume that there are no missing /dev entries, that is,
> > if vnd3 is in use, then /dev/vnd[0-2]* all will exist).
>
> Why not parse the output of vnconfig -l instead? That should be doable in
> less shell code.
The next_avail() function is more general than just vnd devices,
and covers vnds, and cgds as well as raid devices.
Regards,
Alistair