Attaching two gbde partitions with the same password

Allan Fields bsd at afields.ca
Tue Sep 7 01:09:42 PDT 2004


On Sun, Sep 05, 2004 at 02:34:13AM +0100, R. W. wrote:
> I've created two gbde partitions, both have the same password, and I'd 
> like to be able to attach them without typing it twice. Looking at man 
> gbde it doesn't seem to be possible to mount them simultaneously.
> 
> Is there a good workaround?

Yes, it's possible to read in the passphrase once and then feed it on
the command line using -p,  it's also possible to feed it on stdin
w/ a patch I've posted previously.

The only issue with reading in passwords from a shell script is to
not echo to the tty.  There are ways around this problem such as:

In bash you can use:
	read -esp "Enter passphrase: " pass
	gbde attach $dev -l $lck -p $pass

otherwise:
	tmp=`stty -g`; stty -echo
	read -p "Enter passphrase: " pass
        echo; stty $tmp
	gbde attach $dev -l $lck -p $pass

You could put this into your rc.early or something similarly early
in the boot sequence if it suits your needs.  (For security reasons
passing the passphrase on the command line should be done before
going multiuser.)

Hope this helps,
-- 
 Allan Fields, AFRSL - http://afields.ca
 2D4F 6806 D307 0889 6125  C31D F745 0D72 39B4 5541
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20040907/12f48f8b/attachment.bin


More information about the freebsd-geom mailing list