HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

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
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.

Sharma Sanjeev
Respected Contributor

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

Hi Sanwin

You can use dd or you can ask your storage team to do this for you by SAN Level

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

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

Hi Sanwin,

I understand that pvmove is little risky one if you don't have mirror data.

Why don't you mirror the data from old disk to new disk and remove the old disk from the mirror. It is very safter method.

I also prefer to take a backup of the data on tape or some other system if the data is too critical.

Best wishes,

Ganesh.
Emil Velez
Honored Contributor

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


if the disk is setup with LVM use pvmove

if the disk is part of a VXVM disk group use vxevac

You really need to be trained in your volume manager before you attempt something like this.