Operating System - HP-UX
1833325 Members
3066 Online
110051 Solutions
New Discussion

Move logical volume to new volume group

 
SOLVED
Go to solution
Jochen Speer
Occasional Contributor

Move logical volume to new volume group

Hi,
I have added a 18GB Disk to an L1000 (11.0, 9GB), and now would like to move the complete contents of volume group /dev/vg00/data to /dev/vg01/lvol9.
Which is the best way to go about it?
Thank you for your help

Jochen
8 REPLIES 8
Michael Tully
Honored Contributor

Re: Move logical volume to new volume group

Are either of these logical volumes
mounted?

If so I will assume /dev/vg00/data is
mounted on /data and /dev/vg01/lvol9
is mounted on /data1

Make sure you have a good backup, then
# cd /data
# cp -R * /data1

This is a very easy way. If your lv's
are not mounted then you could do a 'dd'
Anyone for a Mutiny ?
Helen French
Honored Contributor

Re: Move logical volume to new volume group

Hi,

I assume that /dev/vg00/data is your source LV and /dev/vg01/lvol9 is the destination LV. Then:

1) Mount both file systems
# mount /dev/vg00/data /source
# mount /dev/vg01/lvol9 /dest

If the vg00/lvol9 is a new LV, then you need to run newfs on that before mounting it.

2)Copy the files:
# cd /source
# find . -depth | cpio -pdlmuva /dest

3) Check out all files are copied. Then if needed you can erase the content of vg00/data.

HTH,
Shiju
Life is a promise, fulfill it!
Kenny Chau
Trusted Contributor
Solution

Re: Move logical volume to new volume group

Hi,

If you want to retain your mount point, you can make a temp mount point and copy all the files from the source to temp mount point. Then unmount the source and temp mount and mount the original source mount point to the new LV. Eg.

# mkdir tempmnt
# mount tempmnt /dev/vg01/lvol9
# cp -p -r /data /tempmnt
# umount /tempmnt
# umount /data
# mount /data /dev/vg01/lvol9
# ll /data <- to check the results

Hope this helps.
Kenny.
Kenny
Bill McNAMARA_1
Honored Contributor

Re: Move logical volume to new volume group

Use pvmove

pvmove -n src_lvol dest_dsk

pvdisplay -v dsk
to verify

Later,
Bill
It works for me (tm)
Thierry Poels_1
Honored Contributor

Re: Move logical volume to new volume group

Hi,

Bill, pvmove only moves LVOL (or part of it) from one disk to another in the same VG.

As already mentionned the trick is to make a new LVOL in the other VG, mount it on a temporary mount point, cpio the data to the new location, unmount old LVOL, mount new LVOL to correct mount point
AND edit /etc/fstab !!! for future mounts.
Afterwards you can drop the old LVOL.

good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Olivier LEGRAND
Frequent Advisor

Re: Move logical volume to new volume group

Hi all,

For this question, can we use the mirroring tools?

Thanks for your help

Regards
Thierry Poels_1
Honored Contributor

Re: Move logical volume to new volume group

Sorry Olivier, that would only be possible if you are moving LVOLs to another disk within the SAME Volume Group. But on the other hand, this would do the same as pvmove, which would do the trick with one command.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Thierry Poels_1
Honored Contributor

Re: Move logical volume to new volume group

Sorry Olivier, that would only be possible if you are moving LVOLs to another disk within the SAME Volume Group. But on the other hand, this would do the same as pvmove, which would do the trick with one command.

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.