LVM and VxVM

Duplicate an LVM OS Bootdisk to another disk of different size.

 
SOLVED
Go to solution
Alzhy
Honored Contributor

Duplicate an LVM OS Bootdisk to another disk of different size.

dd works but only to bigger sized target disks and immediately the disk is bootable...

What if I say do the following:

1. pvcreate -B/mboot the target disk

2. create a new VG using the new disk say named nvg00

3. dd or dump/restore the /dev/vg00/rlvols

4. mount the new root partition on the new nvg00 root vg, edit fstab.

5. New disk should now be bootable but the root VG will actually be named nvg00 instead of vg00.


What do the Gurus (Gurii?) think?
Hakuna Matata.
5 REPLIES 5
DCE
Honored Contributor

Re: Duplicate an LVM OS Bootdisk to another disk of different size.



Why not do an ignite restore to the new disk?

You can resize the lvol's on the new disk, and test it out, while leaving the original disk alone.

The original disk can become an alternate boot disk until you are satisfied with the install - just be sure to NOT include it in the new vg00

Once you are comfortable with the new disk, you can pvcreate the old boot disk and either use it as part of a mirror, or some other function.......
Victor Fridyev
Honored Contributor

Re: Duplicate an LVM OS Bootdisk to another disk of different size.

Hi,

The simplest way to copy between disks with different sizes is make_tape_recovery. This is the safest but relatively slow way. But in any case, the time which you have to waist in order to manage logical volumes is almost the same like the time needed for creation of make_recovery tape.

HTH
Entities are not to be multiplied beyond necessity - RTFM
TwoProc
Honored Contributor

Re: Duplicate an LVM OS Bootdisk to another disk of different size.

I don't believe it's going to work as your question is worded. The reason is that the kernel has the path to the boot location in the kernel itself... (wierd, I know). So, when you move this off to another vg by any other name, it's not going to come up.
We are the people our parents warned us about --Jimmy Buffett
Shahul
Esteemed Contributor
Solution

Re: Duplicate an LVM OS Bootdisk to another disk of different size.

You can create new boot disk by using this procedure. Connect the new hard disk,

#pvcreate -B -f "raw device file"
#mkdir /dev/vg01 (If vg01 does not exist)
#mknod /dev/vg01/group c 64 0x010000
#mkboot raw device file (Please find man page of mkboot)
#mkboot -a hpux raw device file
#vgcreate /dev/vg01 "Block device file"
#lvcreate -L xxx /dev/vg01
xxx is size of new boot volume in Meg
#lvcreate -L yyy /dev/vg01
yyy is size of new primary swap in Meg
#lvcreate -L zzz /de/vg01
zzz is size of new root volume in Meg
#newfs -F hfs /dev/vg01/rlvol1
#newfs -F vxfs /dev/vg01/rlvol3
#lvlnboot -b /dev/vg01/lvol1
#lvlnboot -r /dev/vg01/lvol3
#lvlnboot -s /dev/vg01/lvol2
#lvlnboot -d /dev/vg01/lvol2
#lvlnboot -v
Now it should show the listing of two HDDs lvs.
#mkdir /newboot
#mkdir /newroot
#mount /dev/vg01/lvol1 /newboot
#mount /dev/vg01/lvol3 /newroot
#cd /
#find . -xdev -depth -print | cpio -pxdm /newroot
#cd /stand
#find . -xdev -depth -print | cpio -pxdm /newboot
#cd /newroot/etc
change primary boot path to new 18GB hDD by using setboot command.

edit fstab as per ur requirment.
Shutdown the system. Remove the old boot disk and try to boot through new disk. You may find some errors while booting as the lvlnboot is pointing to old volumes as well, that can be ignored.

This should work


Best of luck
Shahul
Alzhy
Honored Contributor

Re: Duplicate an LVM OS Bootdisk to another disk of different size.

Shahul,

Thanks...

Exactly as I thought.. yours more is detailed and uses cpio whilst my approach uses dd or dump/restore.

One booted up, the new disk will have its root VG named nvg00 or in your example vg01.

In may case, since the purpose of the boot disk is not really as a standby disk but rather for DR - offsited to use in a DR - it can be imported at LVM Maint boot to be named once more as vg00 and /etc/fstab edited correspondingly...


Cheers!
Hakuna Matata.