Operating System - HP-UX
1830908 Members
1752 Online
110017 Solutions
New Discussion

Re: Move data from pv to another one inside the same volume group

 
SOLVED
Go to solution
RiclyLeRoy
Frequent Advisor

Move data from pv to another one inside the same volume group

I have cluster HP-UX of 4 hosts with Service Guard and I need to move data of application to another physical disk. Application data is in /myapp/datafile (mount point) and this one is mounted to /dev/vg_myapp/lv_myapp_datafile.

mount point = /myapp/datafile
logical volume = /dev/vg_myapp/lv_myapp_datafile
volume group = /dev/vg_myapp
PV Name = /dev/disk/disk432

My target is :

1. to add new physical volume (e.g. /dev/disk/disk555) to volume group */dev/vg_myapp*

2. to move the existing data from /dev/disk/disk432 to /dev/disk/disk555

3. to remove old /dev/disk/disk432

In this way my app should have to see no changes because changes are applied to lower level that is volume group and physical device.
What do you think ? It's necessary to stop application to make this job ?

Can you suggest me what commands I need for these 3 points please?

3 REPLIES 3
feigenL
Respected Contributor

Re: Move data from pv to another one inside the same volume group

Hello there, please take a look at this thread, as it is quite complete on the steps of what seems you need to accomplish.

https://community.hpe.com/t5/operating-system-hp-ux/pvmove-is-online/td-p/6940919

regards.

Luis Feigenblatt
RiclyLeRoy
Frequent Advisor

Re: Move data from pv to another one inside the same volume group

@feigenL 

It's very interesting ! Thanks.

  • # pvcreate /dev/rdisk/disknew ==> new disk
  • # vgextend vgname /dev/disk/disknew
  • # lvextend -L 74120 /dev/vgname/lvname ==> double the disk space of lvm
  • # lvextend -m 1 /dev/vgname/lvname ==> mirror
  • # lvreduce -m 0 /dev/vgname/lvname /dev/disk/diskold

I have some doubts...

  1. About new disk which I'll have to create, It can be greater then source one ?
  2. Mirror task is at logical volume level ?
  3. Mirror task means every time it's necessary to write to disk, write operation is made on both volumes? Or It exist a primary disk and afterwards data copy is applied to second disk ?
  4. if mirror is specified on logical volume according to this command " lvextend -m 1 <logical volume>",  It's natural to think disk to disk replication ?
  5. It's necessary specific HP-UX license for mirror ?
georgek_1
HPE Pro
Solution

Re: Move data from pv to another one inside the same volume group

RiclyLeRoy

 

I assume you have new disk already assigned to the server, and in CLAIMED state . 
The new disk needs to be same or larger size than disk432 to accommodate all data .
Add the new disk to /dev/vg_myapp, using vgextend command , # vgextend /dev/vg_myapp /dev/disk/disk555
At this stage , you may mirror the data, if you have MirrorDisk/UX software installed in server;
Using the command # lvextend -m 1 /dev/vg_myapp/lv_myapp_datafile /dev/disk/disk555 .
Please note that MirrorDisk/UX is a paid software , available with higher OE or purchased separately.
This can be checked with  # swlist -l bundle | grep -i mirror .

Once  the data is mirrored , you may reduce the lvol from OLD disk (disk432) using lvreduce .
# lvreduce -m 0 /dev/vg_myapp/lv_myapp_datafile /dev/disk/disk432

Remove the OLD disk - disk432 from /dev/vg_myapp, using # vgreduce /dev/vg_myapp /dev/disk/disk432 
You may check vg configuration (vgdisplay -v <vg_name> and data consistency, then un-presnt the OLD disk at this time .

Please make sure that you have data backup available before making any changes .
You could refer # man vgextend , # man lvextend , # man lvreduce and # man vgreduce for more information .

 

About new disk which I'll have to create, It can be greater than source one ?
Target disk has to be same or bigger than the source one.

 

Mirror task is at logical volume level ?
Yes We do mirror at the logical volume level.

 

Mirror task means every time it's necessary to write to disk, write operation is made on both volumes? Or It exist a primary disk and afterwards data copy is applied to second disk ?
Yes, writes to both volumes .


if mirror is specified on logical volume according to this command " lvextend -m 1 <logical volume>",  It's natural to think disk to disk replication ?
Usually , the policy of the lvol is set to "strict" by default ,  so that mirror copy would always go to next disk, will not be on same disk which is of no use . Else you may mention the target disk with lvextend command as shown above .


It's necessary specific HP-UX license for mirror ?
Yes , MirrorDisk/UX software is a licensed product .

 

I work for HPE/ I am an HPE Employee (HPE Community)



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo