Operating System - HP-UX
1751691 Members
4742 Online
108781 Solutions
New Discussion юеВ

How to migrate a physical volume to another physical volume with data

 
SOLVED
Go to solution
sanwin
Frequent Advisor

How to migrate a physical volume to another physical volume with data

Hi,
How to migrate the physical volume to another physical volume without loss of data.

Please guide me.

Thanks!!

Regards,
Sanwin
12 REPLIES 12
Richard Hepworth
Esteemed Contributor

Re: How to migrate a physical volume to another physical volume with data

Sanwin,

Assuming you're using LVM....
Make sure the new physical volume is in the same volume group and use

pvmove /dev/disk/olddisk /dev/disk/newdisk

regards,

Richard
Steven E. Protter
Exalted Contributor
Solution

Re: How to migrate a physical volume to another physical volume with data

Shalom,

First you vgexport the volume group containing the physical volume.

Then you vgimport into the new system.

http://docs.hp.com/en/B2355-60127/vgexport.1M.html

http://docs.hp.com/en/B9106-90008/vgimport.1M.html

http://www.docs.hp.com/en/B7660-90010/ch04s04.html

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Suraj K Sankari
Honored Contributor

Re: How to migrate a physical volume to another physical volume with data

Hi,
its is risky to do....

pvmove -n /dev/dsk/cxtxdx to /dev/dsk/cxtxdx

for more detail see the attached file
When_Good_Disks_Go_Bad.pdf

Suraj
Johnson Punniyalingam
Honored Contributor

Re: How to migrate a physical volume to another physical volume with data

Hi ,

>>>Hi,
How to migrate the physical volume to another physical volume without loss of data.
<<

Do you have mirror ..?

if Yes, You can Just vgextend to existing volume Group

lvextend -m 1 /dev/vg01/lvol1

"pvmove"


DESCRIPTION
pvmove moves allocated physical extents and the data they contain from
source physical volume source_physical_vol_path to one or more other
physical volumes. To limit the transfer to specific physical volumes,
specify the names of one or more physical volumes with the
dest_physical_vol_path or indirectly via the dest-physical-vol-group-
name parameter if physical volume groups have been defined under the
volume group that contains the source physical volume.

Options
pvmove recognizes the following options and accompanying parameters:

-n lv_path
Moves only physical extents allocated to the logical volume
(specified by lv_path) that are located on the source
physical volume (specified by source_physical_vol_path) to
the specified destination physical volume.


EXAMPLES
Move physical extents from /dev/dsk/c1d0s2 to /dev/dsk/c2d0s2 and
/dev/dsk/c3d0s2:

pvmove /dev/dsk/c1d0s2 /dev/dsk/c2d0s2 /dev/dsk/c3d0s2

If /dev/dsk/c2d0s2 and /dev/dsk/c3d0s2 belong to PVG0, the same result
can be achieved using the following command:

pvmove /dev/dsk/c1d0s2 PVG0

Move only the physical extents in logical volume /dev/vg01/lvol2 that
are on /dev/dsk/c1d0s2 to /dev/dsk/c2d0s2:

pvmove -n /dev/vg01/lvol2 /dev/dsk/c1d0s2 /dev/dsk/c2d0s2

Thanks,
Johson
Problems are common to all, but attitude makes the difference
Johnson Punniyalingam
Honored Contributor

Re: How to migrate a physical volume to another physical volume with data

Hi sanwin,

>>How to migrate the physical volume to another physical volume without loss of data.<<

how about "dd" command ..?

#> dd if=/dev/rdsk/XXXX of=/dev/rdsk/YYYY bs=32768k

XXXX is the existing system disk, YYYY is it's your migrated the physical volume .


Thanks,
Johnson
Problems are common to all, but attitude makes the difference
sanwin
Frequent Advisor

Re: How to migrate a physical volume to another physical volume with data

Hi All.
Thanks for the replies and your valuable inputs.

Our scenario is something like -- within the VG , the old disk has to be released as it is part of that SAN space where configuration data is stored. And it is assigned to the server by mistake.

so i am trying to move the data from that disk to another disk.

I will check the details presented here. thanks!!

If any more inputs also, please do let me know.

Thanks

Regards,
sanwin
Sharma Sanjeev
Respected Contributor

Re: How to migrate a physical volume to another physical volume with data

Hi Sanwin

dd, pvmove, mirror disk & vdexport/vgimport will be your options

Regards
Sanjeev
Everything is Possible as " IMPOSSIBLE" word itself says I M POSSIBLE
Johnson Punniyalingam
Honored Contributor

Re: How to migrate a physical volume to another physical volume with data

Our scenario is something like -- within the VG , the old disk has to be released as it is part of that SAN space where configuration data is stored. And it is assigned to the server by mistake.

>>>the old disk has to be released as it is part of that SAN space where configuration data is stored. And it is assigned to the server by mistake<<<<

Can please elabrate more "How the above was happened" ..?

Can see the pshyical disk "under" vgdisplay -v |more ..?

And it is assigned to the server by mistake ..?
what do you mean by this ..? are assigning does any one done "pvcreate" ..?

so i am trying to move the data from that disk to another disk.

Pls take note if "pvceate" have been done "Chances are very less".. if not " you can reasing the disk to same VG"

Example :-

# vgcfgrestore -n vg03 /dev/rdsk/c11t5d0

# vgchange -a y vg03

if you have mirror copy

# lvextend -1 m /dev/vg03/lvolx /dev/rdsk/c11t5d0


Thanks,
Johnson
Problems are common to all, but attitude makes the difference
sanwin
Frequent Advisor

Re: How to migrate a physical volume to another physical volume with data

Hi Johnson,
The disk has been assigned like any other lun that will be presented to the server.

There is no issue in using the san disk now.
But in the process of standardizing our storage resources, we are planning to change the above mentioned san disk with a new one as the old san disk needs to be released for some other purpose.


The current san disk is part of the san which should not be allocated to servers for use and that is meant for configuration data storage. so that disk needs to be released and normal usage san disk needs to be added to the server.

I heard pvmove is very risky.

Also the pv which i am trying to migrate is having many lvs widespread across many PVs.
There is no mirror copy too.

It is a production environment.

so i am looking for a safer procedure to migrate the data to the new san disk.

Please guide me.