Operating System - HP-UX
1832978 Members
3050 Online
110048 Solutions
New Discussion

Moving an existing LV to a different PV

 
SOLVED
Go to solution
BOB BARBA
Contributor

Moving an existing LV to a different PV


I wish to relocate one on my logical volumes to a different physical device within the same volume group. I do not have Mirror-UX. What is the simplest way to move it ensuring that it ultimately has the same name and attributes as the original?

Many thanks in advance ....... Bob
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor
Solution

Re: Moving an existing LV to a different PV

Hi Bob:

'pvmove' moves physical extents from one physical volume to another in the same volume group -- exactly what you want. You do not need MirrorDisk/UX, although 'pvmove' can be used in a mirrored environment. Take a look at the man pages (1M) for 'pvmove'. There are some good examples. You can limit the choice of the destination disk or allow the move to choose available destinations.

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: Moving an existing LV to a different PV

pvmove is the easiest and most reliable. What it does is to copy one LVM extent at a time in what is called an atomic operation, that is, all activity pertaining to that extent is locked out, a copy made to the target and once successful, the tables are updated to point to the new location.

LVM is quite flexible. The lvol maps will enumerate each extent and the disk to which it is attached. Thus, moving an extent (using pvmove) is pretty basic and no knowledge of the filesystem (or lack thereof) is necessary.

Technically, this can be done while the lvol is mounted and being used although I would probably backup the data, unmount the disk, use pvmove and then remount the lvol to check it. (I'm not paranoid--it's just that everything breaks at the most critical time)


Bill Hassell, sysadmin
Sridhar Venkataramu
Occasional Advisor

Re: Moving an existing LV to a different PV

hi bob

this is what is needed

1. identify the pv you want the lv on
2. do a vgdisplay -v
3. note the allocated PEs for the LV in question and the free PEs on the destination pv, from the vgdisplay output.
4. If there are enough free PEs on the destination pv, do a :
pvmove -n lvpath "source pv path" "dest pv path"

ensure you have enough space on destination disk before pvmove.

best luck