Operating System - HP-UX
1834331 Members
2388 Online
110066 Solutions
New Discussion

Re: Moving multiple vg's to a single disk

 

Moving multiple vg's to a single disk

I need to move vg02 and vg04 to the same disk where vg01 resides. I moved vg01 to this disk using vgextend and pvmove. Is there a way to move the lvols in vg02 and vg04 to the same disk as vg01 or will I have to do a backup/restore to move this data?

System is N4000 running HPUX 11.0
10 REPLIES 10
Steven Sim Kok Leong
Honored Contributor

Re: Moving multiple vg's to a single disk

Hi,

The concept of a VG is that it can comprise only of one or more physical disks. You cannot have more than one VG per disk. You can however, have multiple disks in one VG.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com

Re: Moving multiple vg's to a single disk

I understand that only one vg per disk. I need to move the "lvol's" in vg02 and vg04 to vg01. Can this be done with a command or must I do a backup/restore to get the data into vg01?
thanks
Steven Sim Kok Leong
Honored Contributor

Re: Moving multiple vg's to a single disk

Hi,

There is no way to move LVs from one VG to another. You have to migrate the data at the filesystem level by:
1) backup and restoration
2) copying tools such as cpio

You can however vgexport and vgimport disks from one VG to another.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Thierry Poels_1
Honored Contributor

Re: Moving multiple vg's to a single disk

hi,
you will have to move all your data manually from the old VG's to VG01, either through backup tapes or with a spare disk.
If you have enough free space in VG01,you can recreate the lvols one by one, and copy them from the old VG's, drop the old lvols, and mount the new lvols on the old mountpoints.
If you have freed some disks in the old VG's then you can add them to VG01.

have fun ;)
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Vincenzo Restuccia
Honored Contributor

Re: Moving multiple vg's to a single disk

Try lvmmigrate.
Andreas Voss
Honored Contributor

Re: Moving multiple vg's to a single disk

Hi,

just to repeat:
The command to move physical extends is pvmove and this can be only done within a volume group NOT to another volume group.
If you have enough space in your new vg you can create a new lvol in the new vg and use dd to copy the contents ie:
dd if=/dev/vg04/rlvol1 of=/dev/vg01/rlvolX bs=64k

Regards
Steven Sim Kok Leong
Honored Contributor

Re: Moving multiple vg's to a single disk

Hi,

lvmmigrate is used for migrating root filesystems from partitions to logical volumes. In HP-UX 9.X, partitions were still in use. LVM was not used.

Hope this helps. Regards.

Steven sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Pedro Sousa
Honored Contributor

Re: Moving multiple vg's to a single disk

Adding to Andreas's comments, I would say that the command "mv" it's enough as soon as you have the lvols created on vg01.
good luck.
Ajitkumar Rane
Trusted Contributor

Re: Moving multiple vg's to a single disk

There is no way to move the lvols from different VGs to a single VG in LVM.But I would sugggest instead of backup and restore why dont you try copying the data, I think this would be comparatively faster.
Good luck.
Amidsts difficulties lie opportunities
Charles McCary
Valued Contributor

Re: Moving multiple vg's to a single disk

hey - here's a handy cpio command for moving data:

From the old filesystem:

# find . | cpio -pvdm /new_filesystem

This will copy the data without doing any damage to the old data. You can then compare the two and delete the old copy whenever you want (I'd recommend holding on to it a day or two if possible).