1833757 Members
3026 Online
110063 Solutions
New Discussion

How to recreate a vg?

 
SOLVED
Go to solution
Sandreliz
Occasional Advisor

How to recreate a vg?

Hello everybody!

I´m facing the following situation...
I need to increase the max pv size, but I found out that the only way that I can do that is by recreating the vg, so my question is... How I do it? What are the spets should I follow?
10 REPLIES 10
Rick Garland
Honored Contributor
Solution

Re: How to recreate a vg?

Go into SAM and this will guide you in doing the correct steps and in the order they need to be performed.

Disks and File Systems --> Volume Groups

Robert-Jan Goossens_1
Honored Contributor

Re: How to recreate a vg?

Hi,

Backup your DATA in your volume group on tape or disk.
# ll /dev/vgxx/group
create a list of the current sizes of your logical volumes.

unmount your filesystems in this vg
# vgchange -a n /dev/vgxx
# vgexport /dev/vgxx
# mkdir /dev/vgxx
# mknod /dev/vg01/group c 64 0xyy0000
replace the yy with your current number (above ll)
create the VG with the appropriate MAX PE
use -e option with vgcreate
lvcreate your logical volumes
mount your lvol's.

Robert-Jan
Ajitkumar Rane
Trusted Contributor

Re: How to recreate a vg?

Just a addition to the above reply,
before you export the VG just do a vgdisplay and note the PV device names cXtYdZ etc. so that you need not search for the unused disks again while reacreating the VG with vgcreate.

Rgds,

Ajit


Amidsts difficulties lie opportunities
Piergiacomo Perini
Trusted Contributor

Re: How to recreate a vg?

hi to all,
beg your pardon but
pay attention on Robert-Jan
steps

it's not
# mknod /dev/vg01/group c 64 0xyy0000

but
# mknod /dev/vgxx/group c 64 0xyy0000

right?

regards
Robert-Jan Goossens_1
Honored Contributor

Re: How to recreate a vg?

Right and if we are removing typos :-)

after creating the logical volumes, restore the data from tape or disk :-)

Thanks Piergiacomo!
Sandreliz
Occasional Advisor

Re: How to recreate a vg?

Thanks for all responses! ;-)
I will follow these steps.
Devender Khatana
Honored Contributor

Re: How to recreate a vg?

Hi,

If your system is under support then you can ask your local HP office to do this without recreation using vgmodify utility. Allthough still before execution you should have a tested backup handy.

HTH,
Devender
Impossible itself mentions "I m possible"
Devender Khatana
Honored Contributor

Re: How to recreate a vg?

Hi,

If the vgmodify option does not work than apparently I assume that you have some spare large capacity disk which you wish to add to this vg. In that case you can create a new VG with requires parameters on the space disk and mount new file system on some other path. After this stop your applications and copy data from existing vg to the new VG LVOL using cpio or cp commands. The advantage of this is that you will have less downtime of application (only during copy and remount)

Suppose current mount points from the VG you wish to recreate are

/data
/data1
/data2

But the total of space used in these file systems should not be more than the capacity of the new disk.

Create new VG on the new disk and mount them on /dataa , /data1a , /data2a respectively.

Now stop applications and copy all data to respective new file systems.

#find /data -name "*" -print|cpio -pdmv /dataa

#find /data1 -name "*" -print|cpio -pdmv /data1a

#find /data2 -name "*" -print|cpio -pdmv /data2a

Now unmount current /data , /data1 & /data2 and mount new LVOLs on the same mount points.

Start applications and check that everything is fine. After some running remove the OLD vg and add the disks to this or any other VG.

HTH,
Devender
Impossible itself mentions "I m possible"
Nguyen Anh Tien
Honored Contributor

Re: How to recreate a vg?

Backup data is a must!
then create new vg with propriate size
# vgchange -a n /dev/vgxx
# vgexport /dev/vgxx
# mkdir /dev/vgxx
# mknod /dev/vg01/group c 64 0x??0000
#pvcreate /dev/rdsk/cxtxdx
#vgcreate -e number_of_pe -s pe_size_in_MB vgname /dev/dsk/cxtxdx
then restore data to new vg
HTH
tienna
HP is simple
Sandreliz
Occasional Advisor

Re: How to recreate a vg?

I followed the steps and it was ok. But before I do vgcreate I had to do pvcreate as tienna said.

Thanks again!