I am trying to write a kornshell script that will automatically create veritas disk groups. However, the only utility that I can find that will create the diskgroup is vxdiskadd, which prompts with interactive questions. I've tried to pass the answers through to vxdiskadd, but I receive the following errors. Does any know of a different way to create the diskgroups? Another Veritas program that would allow command line parameters? Another way to pass the answers to vxdiskadd?
**********************************
EXAMPLE OF MANUAL INPUT TO vxdiskadd
**********************************
11:34:42 # vxdiskadd sda
Add or initialize disks
Menu:: VolumeManager/Disk/AddDisks
Here is the disk selected. Output format: [Device_Name]
sda
Continue operation? [y,n,q,?] (default: y) y
You can choose to add this disk to an existing disk group, a
new disk group, or leave the disk available for use by future
add or replacement operations. To create a new disk group,
select a disk group name that does not yet exist. To leave
the disk available for future use, specify a disk group name
of "none".
Which disk group [<group>,none,list,q,?] dgGate
Create a new group named dgGate? [y,n,q,?] (default: y) y
Create the disk group as a CDS disk group? [y,n,q,?] (default: y) y
Use a default disk name for the disk? [y,n,q,?] (default: y) y
Add disk as a spare disk for dgGate? [y,n,q,?] (default: n) n
Exclude disk from hot-relocation use? [y,n,q,?] (default: n) n
Add site tag to disk? [y,n,q,?] (default: n) n
A new disk group will be created named dgGate and the selected disks
will be added to the disk group with default disk names.
sda
Continue with operation? [y,n,q,?] (default: y) y
Initializing device sda.
Enter desired private region length
[<privlen>,q,?] (default: 65536) 65536
VxVM NOTICE V-5-2-120
Creating a new disk group named dgGate containing the disk
device sda with the name dgGate01.
Goodbye.
**********************************
EXAMPLE OF PASSING INPUT TO vxdiskadd
**********************************
11:35:48 # echo "y
dgGate
y
y
y
n
n
n
y
default 65536" | vxdiskadd sda
Add or initialize disks
Menu:: VolumeManager/Disk/AddDisks
cat: write error: Bad file descriptor
cat: write error: Bad file descriptor
expr: syntax error
/usr/lib/vxvm/voladm.d/lib/vxadm_lib.sh: line 1956: [: 7: unary operator expected
/usr/lib/vxvm/voladm.d/lib/vxadm_lib.sh: line 1957: [: too many arguments
/usr/lib/vxvm/voladm.d/lib/vxadm_lib.sh: line 1958: [: too many arguments
/usr/lib/vxvm/voladm.d/lib/vxadm_syslib.sh: line 1525: 65536: command not found
Goodbye.