ehowton (ehowton) wrote,
ehowton
ehowton

Create Veritas Volumes

scripts]$ cat vxcreate1
x=0
while [ $x = 0 ]
do

clear
echo "Initialize all Veritas disks press 1"
echo "Create a vg and extend disks into it press 2"
echo "Create specific sized LV on specific disks and format press 3"
echo "Press 6 to exit"
read input1

case "$input1" in

1)
> vxcreate.out
vxdisk list
vxdisk list | grep -i emc-vplex1_ |awk '{print $1}' > vxcreate.out
for i in `cat vxcreate.out`
do
/etc/vx/bin/vxdisksetup -i $i
done
;;

2)
./stuff.pl
echo "Enter VG name"
read VGname
echo "Enter disk"
read disk0
echo "Enter Disk Name"
read disk1
vxdg init $VGname $disk1=$disk0

w=0
while [ $w = 0 ]
do
echo "Would you like to add another disk to the VG?"
read stuff1
case "$stuff1" in
y)
#echo "Enter VG name"
#read VGname
echo "The VG name is $VGname"
echo "Enter disk"
read disk0
echo "Enter Disk Name"
read disk1
vxdg -g $VGname adddisk $disk1=$disk0
;;
n)
w=1
;;
*)
echo "Invalid Choice"
sleep 1
;;
esac
done
;;

3)
vxdisk list
echo "Enter VG name"
read VGname
echo "Enter LV name"
read LVname
vxdg -g $VGname free
echo "Enter LV size as 10G or in blocks"
read LVsize
echo "Enter the disk"
read Disk
vxassist -g $VGname make $LVname $LVsize $Disk
/usr/lib/fs/vxfs/mkfs -t vxfs -o largefiles,bsize=8192 /dev/vx/rdsk/$VGname/$LVname
echo "Enter the Mount Point"
read mountp
echo "/dev/vx/dsk/$VGname/$LVname $mountp vxfs defaults,_netdev 0 0" >> /etc/fstab
mkdir $mountp
mount $mountp
;;

6)
echo exit
x=1
;;
*)
clear
echo "not a valid option"
sleep 2
;;
esac
done
Tags: #echo, #read, linux, unix, veritas
Subscribe

  • Coming Up Short

    When one looks for someone/something to blame, growth cannot take place. By owning it, however - taking personal responsibility - we are empowered…

  • Liquorice Altoids

    I bought a tin of licorice Altoids before I left Texas, but they got lost in the shuffle. Last night, they were found. Today, I popped two - and…

  • Spectacular Spectacular

    A surprising evening of absinthe and champagne awaited me when I got home from working late again. And when I cracked my humidor open for the…

  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments