Operating System - HP-UX
1827283 Members
3544 Online
109717 Solutions
New Discussion

LVM moving primary & secondary mirrors to new address

 
Dan Ryan
Advisor

LVM moving primary & secondary mirrors to new address

Hello,

I'll be moving 6 disks to new SCSI channels. Five of the disks are mirrors of disks that won't be moving. I've done this before by taking backups
lvreduce -m 0 /dev/vg??/lvol1? /dev/dsk/c?t?d?,
vgreduce /dev/vg?? /dev/dsk/c?t?d?,
move the disk, vgextend /dev/vg?? /dev/dsk/newaddr
lvextend -m /dev/vg??/lvol? /dev/dsk/newaddr

This has worked when moving mirrors.

However in this move I'll be moving both the primary and secondary mirrors. The volume group has four disks with a single File system spanning both primary disks:

c4t2d0 mirrored on c15t2d0
c10t2d0 mirrored on c11t2d0

Both c10t2d0 and c11t2d0 will move to c13t2d0 and c16t2d0. Is the above procedure good for this scenario also?

Thanks to all who respond




Don't have time to do it right the first time, but always time to do it twice
4 REPLIES 4
Denver Osborn
Honored Contributor

Re: LVM moving primary & secondary mirrors to new address

One method you could use is to export then import the volume group after making the needed changes.

Before brining down system, unmount filesystems for the vg and deactivate the volume group to export it.

# vgchange -a n /dev/vg_name
# vgexport -v -s -m /tmp/vg_name.map

-now shutdown box and make your changes

After box is backup and online, use vgimport

# mkdir /dev/vg_name
# mknod /dev/vg_name/group c 64 0x0?0000
(group minor number will be unique)
# vgimport -v -s -m /tmp/vg_name.map /dev/vg_name
# vgchange -a y /dev/vg_name
# mount -a
Denver Osborn
Honored Contributor

Re: LVM moving primary & secondary mirrors to new address

One method you could use is to export then import the volume group after making the needed changes.

Before brining down system, unmount filesystems for the vg and deactivate the volume group to export it.

# vgchange -a n /dev/vg_name
# vgexport -v -s -m /tmp/vg_name.map

-now shutdown box and make your changes

After box is backup and online, use vgimport

# mkdir /dev/vg_name
# mknod /dev/vg_name/group c 64 0x0?0000
(group minor number will be unique)
# vgimport -v -s -m /tmp/vg_name.map /dev/vg_name
# vgchange -a y /dev/vg_name
# mount -a
Rainer_1
Honored Contributor

Re: LVM moving primary & secondary mirrors to new address

Here a hot procedure:
pvcreate /dev/rdsk/c13t2d0
pvcreate /dev/rdsk/c16t2d0
vgextend vgXX /dev/dsk/c13t2d0 /dev/dsk/c16t2d0
pvmove /dev/dsk/c10t2d0 /dev/dsk/c13t2d0
pvmove /dev/dsk/c11t2d0 /dev/dsk/c16t2d0
vgreduce vgXX /dev/dsk/c10t2d0 /dev/dsk/c11t2d0
John Palmer
Honored Contributor

Re: LVM moving primary & secondary mirrors to new address

Hi,

I agree with Denver, exporting then importing the volume groups is the easy way to go as no disk data will actually be changed, only the disk addresses in /etc/lvmtab.

Regards,
John