1832590 Members
3187 Online
110043 Solutions
New Discussion

Re: moving the data

 
SOLVED
Go to solution
Raji Murthy
Occasional Advisor

moving the data

Hi!

I have to move data from one of the volume group to freeup the disks. This volume group has one logical volume of 12GB.The volume group has three disks 4GB each. Thease are HP SEAGATE drives. Now I need to transfer data to EMC disks. these disks are also 4GB.

Last time I used LVM mirroring and then I reduce the mirroring on the original drive.

But this time my logical volume is 12GB which cannot fit to mirror in the 4GB drives.

What is the best solution?

By the way this is HP 11.00 and K420 model.

Thanks
be good and do good
4 REPLIES 4
Jeff Schussele
Honored Contributor

Re: moving the data

Hi Raji,

No difference this time.
Just add to your existing VG 3 of the EMC luns - effectively extending your VG to 24 GB. Then mirror the existing LV using the new extents. Then of course just reduce out of the LV the old disks you wish to reuse elsewhere.
Remember you mirror LVs not PVs.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Sanjay_6
Honored Contributor
Solution

Re: moving the data

Hi,

you can still do the mirroring. Just define three disks in the lvextend command line.

Say the lv name is /dev/vg_name/lv_name

You want to mirror this to three disks, c1t0d0, c1t0d1 and c1t0d2, use this command,

pvcreate -f /dev/rdsk/c1t0d0
pvcreate -f /dev/rdsk/c1t0d1
pvcreate -f /dev/rdsk/c1t0d2
vgextend /dev/vg_name /dev/dsk/c1t0d0
vgextend /dev/vg_name /dev/dsk/c1t0d1
vgextend /dev/vg_name /dev/dsk/c1d0t2
lvextend -m 1 /dev/vg_name/lv_name /dev/dsk/c1t0d0 /dev/dsk/c1t0d1 /dev/dsk/c1t0d2

Hope this helps.

Regds
Jeff Schussele
Honored Contributor

Re: moving the data

Raji,

Sanjay's example is a good one.
I believe you could also just
lvextend -m 1 /dev/vgname/lvname after the pvcreates & vgextends. The system will use the PVs as it sees fit.
Also a caveat - check the exact sizes on the Seagates & the EMC luns. If the EMC luns are slightly larger - no problem. If slightly smaller - you'll have to use 4 of them & "waste" some space out of the 4th lun.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Martin Burnett_2
Trusted Contributor

Re: moving the data

Hey Raji,

You can still do the mirroring as Jeff and Sanjay stated. The other option is to pvmove the data from the original physical volume (HP Seagates) to the new physical volumes (EMC drives). To do this:

Add the EMC (by the way EMC drives are presented as LUNs which may be a single or multiple drives. I don't see why you can't reconfigured the EMC to present the 3 EMC 4gb drives as a single 12GB LUN to HP-UX) but anyway:

# pvcreate -f /dev/rdsk/c1t0d0
# pvcreate -f /dev/rdsk/c1t0d1
# pvcreate -f /dev/rdsk/c1t0d2
#vgextend /dev/vgname /dev/dsk/c1t0d0 /dev/dsk/c1t0d1 /dev/dsk/c1d0t2
# pvmove -n /dev/vgname/lvname /dev/dsk/c6t0d0 /dev/dsk/c1t0d0
# pvmove -n /dev/vgname/lvname /dev/dsk/c6t0d1 /dev/dsk/c1t0d1
# pvmove -n /dev/vgname/lvname /dev/dsk/c6t0d2 /dev/dsk/c1t0d2

Once thepvmoves are completed you can reduce out the old physical volumes:

vgreduce /dev/vgname /dev/dsk/c6t0d0 /dev/dsk/c6t0d1 /dev/dsk/c6t0d2

Thanks for using the forums.

Martin