On Sat, Sep 27, 2025 at 10:27:04PM -0700, Jonathan Thornburg wrote:
> Suppose I have a shell or perl script which is running /bioctl/ to
> create a new softraid device, e.g., which is executing something like
> 
>   bioctl -c C -r 123456 -l /dev/sd0a softraid0
> 
> If everything works correctly, this will create a new softraid crypto
> disk /sdN/.  My question is, what's the best way for my script to find
> out the newly-created /sdN/ device (so that it can do error-checking,
> and if all is well, do an appropriate /mount/ command on that device)?

Are you actually creating a _new_ softraid device, (I.E. a partition that was
blank before and will prompt the user for a new passphrase), or are you
attaching an exiting softraid volume, and just creating a 'new' softraid sd
device?

If it's the former, and you want to check for a specific volume or one of
several volumes being attached, you can use duids instead of device names.

If it's the latter, the newly created device will be treated as having duid
0000000000000000, and if you're sure that there is no other device with an
all-zero duid, you can access it with fdisk and disklabel in a script to
assign a real duid and create partitions.

Reply via email to