#! /bin/sh
#
if [ "$1" = "" ]; then
	echo "Please provide the cXtXdXsX id of the rootdg slice as a parameter"
	exit
fi
# They gave us a slice, go on
#
echo Creating rootdg on $1
reply=`ckyorn -Q -d "no" -p " Do you want to continue with $1"`
case $reply in
                [Nn]|[Nn][Oo])
                        echo "exiting..." >& 2 ; exit 0 ;;
esac
#
# They said to do it
#
vxconfigd -m disable
wait
vxdctl init
wait
vxdg init rootdg
wait
vxdctl add disk $1 type=simple
wait
vxdisk -f init $1 type=simple
wait
vxdg adddisk $1
wait
vxdctl enable
wait
rm /etc/vx/reconfig.d/state.d/install-db
echo "rootdg successfully initialized; remember to reboot"
