1752701 Members
5692 Online
108789 Solutions
New Discussion юеВ

Re: Volume Groups

 
SOLVED
Go to solution
Greg Purcell
New Member

Volume Groups

I have already created a volume group, but left the max pv too small. Can this be changed after the fact and how? HELP!!
7 REPLIES 7
Jennifer Chiarelli
Regular Advisor

Re: Volume Groups

Yes you can extend a volume group after creating it. Sam can normally handle this very well. Or from the command line it involves three or four steps as follows:

pvcreate (used to add an additional disk drive / space for the volume group)
vgextend (to expand the volume group)
lvextend (to expand the logical volume)
extendfs (to extend the file system)

With an HFS file system you must unmount the file system to expand it. With OnlineJFS you do not need to unmount the file system to change the size.

Lanny
It's a binary world!
Bill Hassell
Honored Contributor
Solution

Re: Volume Groups

Extending the volume group can be done as mentioned but the default value for max_pe is 1016 if you don't override it at creation time. If the size of any physical volume exceeds 1016 times the pe_size, the default value for max_pe is adjusted to match the physical volume size but only at vgcreate. The maximum number of physical extents can be a value in the range 1 to 65535.

However, large volume groups require pre-planning (ie, 10's to hundreds of Gbytes) such that the max_pe and perhaps pe_size will need to be increased. For very large volumes (100 Gb or larger), increase the pe_size to 16 or even 32 megs (-s option).

Once the volume group is created, it cannot be extended with more disks if the max_pe times pe_size is less than the total. The volume group must be removed and rebuilt.


Bill Hassell, sysadmin
surendhar prakash.J
Frequent Advisor

Re: Volume Groups

you can extend the exixting volume group by using following steps...

1) #pvcreate /dev/rdsk/cXtXd0 ( Initialize the HDD for LVM ,which you are going to add additional HDD device)

2)vgextend /dev/dsk/cXtXd0 /dev/vgXX ( give (vgXX) exiting volume name to extend to new HDD)

3) Now you create the logical volumes by using "lvcreate" command syntax as follows,

#lvcreate -L XXX /dev/vgXX

L is size in MB for the logical volume

l is for extents size (one extent size is equal to 4MB (default)

n is used to mention the name for logical volume


you can see "man lvcreate" for more help

4) now you need to make a file system on the logical volumes

syntax as follows

# mkfs -F hfs/vxfs /dev/vgXX/rlvolX ( you can specify hfs or vxfs )

This will create file system on your logical volume.

5) create a new mount point directory ( if you mount exting directory,you will not be able to access the old files)

By using "sam" you can configure volume group steps as follows...


type sam and go to "disk and file system" then slect" volume group"
after you slect your volume group name and then go to "action"-extend the volume group


best of luck

suren


G.E. van Beek
Occasional Advisor

Re: Volume Groups

Greg,
I think that you want to increase the parameter 'Max PV' (vgcreate -p option). In my opinion there is no command to increase this parameter (same problem as increasing 'Max PE per PV'). I think you have to backup your data and recreate the VG with the new parameters and do a restore.
Marcel Boon
Trusted Contributor

Re: Volume Groups

Hi Greg,

You can't change the value of max PV size after you created a Volume group.
The only thing to do is to backup your root Volume group, create a new volume group with the new parameters and restore your backup.

some extra information:
All physical volumes (PVs) in a VG must have the same VGDA (Volume Group
Descriptor Area). VGDA information is written into the each PV when you
create the VG. The 'vgextend(1M)' command only copies the information
onto the new PV. All VGDA information is static.

Marcel
See the man pages
Dave Wherry
Esteemed Contributor

Re: Volume Groups

You can tell who reads the questions before responding (Bill, G.E. & Marcel). You asked if Max_PV can be changed after the vg is created. They are correct, it can not. vgextend as described in the other posts will not help you with your problem.
Backing up your data and recreating the vg is the only solution I am aware of, if you want to keep all of your data in the one vg.
The only other option is to start with another vg and begin adding pv's there. I've inherited a couple of systems that had this problem. What I have done is set ranges of vg's for an application. vg10 is for the executables for my ERP application. vg11 is the first vg for the database space. vg12 is the next and so on. The rational being that the executables will not grow as much as the data.
On another system I started with vg20 so all environments are different. The only common vg on any system is vg00 for the root group. This way I can simply vgexport and vgimport if I need to move an application or environment from to another system. No conflicts.
Planning and erroring on the high side is the key. Often times the defaults are much too small. I've been told there may be a slight performance hit by making these defaults too big. I've never noticed this hit. I'll accept it to allow more flexibility down the road.
Another parameter to watch is the Max_PE. By default it is set to the largest disk you use when creating the vg. If you want to add a larger pv later on, the vg will only use the Max_PE of that disk. If you start with 4GB drives and accept the default, then add an 9GB drive later, you will only be able to use 4GB of that drive. Even more than Max_PV I think that Max_PE should be increased.
Rick Garland
Honored Contributor

Re: Volume Groups

max_pv can only be changed AFTER the fact.
Backup data within that VG, reduce/remove the VG, recreate the VG with the new max_pv value, restore the data.

I believe the default is 16.