Operating System - HP-UX
1834025 Members
2720 Online
110063 Solutions
New Discussion

Re: moving a volume group to new disks

 
SOLVED
Go to solution
mmartini
Occasional Advisor

moving a volume group to new disks

hello

i have to move and entire vg to new disks (anothe storage)using lvm. which is the safest way? No downtime is permitted...
Mirroring?
thank you!
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: moving a volume group to new disks

Hi:

Yes, without downtime, leveraging LVM mirroring is going to be about your only choice. Mirroring is certainly very safe although the operation of synchronization can be time-consuming and resource-consumptive.

Of course, mirroring occurs at the logical volume level, so you will have to perform the replication a logical-volume at a time.

Depending upon your configuration, you might want to setup physical volume groups or you might want to explicitly specify the pv_path involved in each mirror operation ('lvextend'). An '/etc/lvmpvg' file defining physical volume groups can be built at any time. That is, you can create it now, even if it didn't exist before.

Examine the manpages for 'lvextend(1M)' and 'lvmpvg(4)' for more information.

Regards!

...JRF...
mmartini
Occasional Advisor

Re: moving a volume group to new disks

thank you James

just to verify the procedure...after i have a mirror of all the volumes on the new disks, i just have to lvreduce the old volumes and vgreduce the old disk? nothing else to do?
thank you
James R. Ferguson
Acclaimed Contributor
Solution

Re: moving a volume group to new disks

Hi (again) mmartini:

You wrote:

> after i have a mirror of all the volumes on the new disks, i just have to lvreduce the old volumes and vgreduce the old disk?

No, after mirroring all of the logical volumes from the old to the new disks, to remove the *old* mirror copies, you do:

# lvextend -m 0 /dev/vgNN/lvolX /dev/dsk/cXtYdZ

...where cXtYdZ represents the *old* physical volume that you will be eliminating.

Then, when cXtYdZ is totally devoid of any inuse extents, you can 'vgreduce' it from the volume group.

Overall, the elimination of the *old* structures is the reverse of creating the *new* ones. That is, you add the new physical volumes with 'vgextend', and follow that with 'lvextend -m 1 ...' to build a mirror of each logical volume. When done, you do 'lvextend -m 0 ...' to eliminate the old mirror and then 'vgreduce' to eliminate the old physical volume.

Regards!

...JRF...
mmartini
Occasional Advisor

Re: moving a volume group to new disks

thank you James. I's clear now.
Doug O'Leary
Honored Contributor

Re: moving a volume group to new disks

Hey;

Also be aware that when you add the new disks to the system, they must be of similar size to the older disks. For instance, if your old disks are 8 gigs and your new disks are 72 gigs; you'll only see about 10-12 gigs of the new disks. The rest of the space will be wasted.

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html