Operating System - HP-UX
1828584 Members
2258 Online
109982 Solutions
New Discussion

Script to create volume groups

 
SOLVED
Go to solution
Jollyjet
Valued Contributor

Script to create volume groups

Hi all,

I have a server with cluster setup as per the client requirement i need to create some 50 volume groups can any one provide me the script.
5 REPLIES 5
Steven E. Protter
Exalted Contributor
Solution

Re: Script to create volume groups

Shalom,

There are really only three steps to create a volume group.

mkdir /dev/
mkdir /dev/vg01
mknod /dev/vg01/group c 64 0x010000

I change the 01 after the x to match the volume group name.

vgcreate with parameters.

vgcreate /dev/vg01 /dev/dsk/c0t3d0
I recommend the -p physical volume limit to allow more space to be crammed into fewer disks.

-p 10

If the disks vary your script will need to take disks as an input parameter.

Simple example script

makemyg.sh
#!/bin/sh

vgname=$1
disk=$2
vgnum= (last two charcaters of vgname some work for you)

mkdir "/dev/${1}"
mknod "/dev/${1}/group c 64 0x${vgnum}0000"
vgcreate "/dev/${1} ${2}"


SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sandman!
Honored Contributor

Re: Script to create volume groups

A better requirements definition for your VG creation script would help and SEP has already provided the cardinal steps which would be repeated over for each of the 50 VGs.

~cheers
Patrick Wallek
Honored Contributor

Re: Script to create volume groups

It's going to be difficult to provide you with exact steps since we do not have the list of disk drives that belong to each VG.

One thing you will need to check is the MAXVGS kernel parameter. By default this is set to 10. You will need to increase it if you are going to set up 50 VGs.

Another thing -- Do you really need 50 VGs? Could you create fewer VGs and more LVs in each VG?

When scripting this you must remember that the minor number (0x??0000) is in HEX. So VG10 would have 0x0a0000 as the minor number. The system uses the minor number to keep track of the number of VGs as well. A decimal 50 is 32 in HEX.
Court Campbell
Honored Contributor

Re: Script to create volume groups

I have to agree with Patrick. You might want to see if you can have fewer vg's and more lv's per vg. I guess the other question is did you plan on having only one lvol per vg that used all the free extents in the vg? Dunno, just something to think about.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Jollyjet
Valued Contributor

Re: Script to create volume groups

HI Thank's for all.