Operating System - HP-UX
1834481 Members
3504 Online
110067 Solutions
New Discussion

move data from a physical volume to another physical volume

 
SOLVED
Go to solution
MAD_2
Super Advisor

move data from a physical volume to another physical volume

I have the following scenario.

1. 2 disks in the same array, one is a new disk, the other has data in it, both the same size.

Output from ioscan -fnC disk:

# ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
=====================================================================
disk 0 8/4.5.0 sdisk CLAIMED DEVICE SEAGATE ST34573WC
/dev/dsk/c0t5d0 /dev/rdsk/c0t5d0
disk 1 8/4.8.0 sdisk CLAIMED DEVICE SEAGATE ST34573WC
/dev/dsk/c0t8d0 /dev/rdsk/c0t8d0
disk 2 8/4.9.0 sdisk CLAIMED DEVICE SEAGATE ST34573WC
/dev/dsk/c0t9d0 /dev/rdsk/c0t9d0
disk 3 8/4.10.0 sdisk CLAIMED DEVICE SEAGATE ST34573WC
/dev/dsk/c0t10d0 /dev/rdsk/c0t10d0
disk 4 8/4.11.0 sdisk CLAIMED DEVICE SEAGATE ST39173WC
/dev/dsk/c0t11d0 /dev/rdsk/c0t11d0
disk 5 8/16/5.2.0 sdisk CLAIMED DEVICE HP DVD-ROM 305
/dev/dsk/c1t2d0 /dev/rdsk/c1t2d0
disk 6 10/12.0.0 sdisk CLAIMED DEVICE SEAGATE ST34573WC
/dev/dsk/c3t0d0 /dev/rdsk/c3t0d0
disk 7 10/12.1.0 sdisk CLAIMED DEVICE SEAGATE ST34573WC
/dev/dsk/c3t1d0 /dev/rdsk/c3t1d0
disk 8 10/12.2.0 sdisk CLAIMED DEVICE SEAGATE ST34573WC
/dev/dsk/c3t2d0 /dev/rdsk/c3t2d0
disk 9 10/12.3.0 sdisk CLAIMED DEVICE SEAGATE ST34573WC
/dev/dsk/c3t3d0 /dev/rdsk/c3t3d0
disk 10 10/12.4.0 sdisk CLAIMED DEVICE IBM DGHS09Y
/dev/dsk/c3t4d0 /dev/rdsk/c3t4d0
disk 11 10/12.5.0 sdisk CLAIMED DEVICE SEAGATE ST39173WC
/dev/dsk/c3t5d0 /dev/rdsk/c3t5d0
disk 12 10/12.6.0 sdisk CLAIMED DEVICE SEAGATE ST318436LC
/dev/dsk/c3t6d0 /dev/rdsk/c3t6d0
disk 13 10/12.8.0 sdisk CLAIMED DEVICE SEAGATE ST318275LC

The disk with the data is /dev/dsk/c3t6d0

The new disk is located at address 10/12.8.0.

Both disks are in the same location of the array (the disk with the data concerned in slot B3/SCSI ID 6, the new disk in slot B4/SCSI ID 8). the one with data uses SCSI ID 6, the new one with SCSI 8.

What I want to do is map the new disk on the same volume group as the other one, which will be removed. This is the output from strings of /etc/lvmtab:


# strings /etc/lvmtab
/dev/vg00
Z->Q
/dev/dsk/c0t5d0
/dev/dsk/c3t3d0
/dev/vg01
Z-6?-
/dev/dsk/c0t8d0
/dev/dsk/c0t9d0
/dev/dsk/c3t1d0
/dev/dsk/c3t2d0
/dev/vg02
Z-6?.
/dev/dsk/c0t10d0
/dev/dsk/c3t0d0
/dev/vg03
/dev/dsk/c0t11d0
/dev/dsk/c3t4d0
/dev/vg04
/dev/dsk/c3t5d0
/dev/vg05
/dev/dsk/c3t6d0

Need to create the PV of the new HD, then move the filesystem mounted in /dev/dsk/c3t6d0 into the new disk, and then move the new disk from slot slot B4 to slot B3 where the other disk is currently located. The other disk will be removed.

How can I do this?

Can anyone give me advise... More information required?
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
18 REPLIES 18
Pete Randall
Outstanding Contributor

Re: move data from a physical volume to another physical volume

Do a man on pvmove - sounds like just the ticket.

Pete

Pete
Jeff Schussele
Honored Contributor

Re: move data from a physical volume to another physical volume

Hi Adam,

IF you have Mirror-UX, this is easy.
Just add the new disk to the VG
pvcreate /dev/rdsk/c3t8d0 (assuming that's the proper device)
vgextend vg05 /dev/dsk/c3t8d0

Then mirror the LV
lvextend -m 1 /dev/vg05/lv_name /dev/dsk/c3t8d0

When the mirroring is complete, you can reduce the old disk from the mirror

lvreduce -m 0 /dev/vg05/lv_name /dev/dsk/c3t6d0

Then remove the disk from the VG

vgreduce vg05 /dev/dsk/c3t6d0

You're done.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Marco Santerre
Honored Contributor
Solution

Re: move data from a physical volume to another physical volume

THe first part of your problem is fairly easy to fix and won't require any downtime since your disk are the same physical size.

just do a :

#insf -e (to create your disk filename)
#pvcreate /dev/rdsk/newdisk
#vgextend vg05 /dev/dsk/newdisk
#pvmove /dev/dsk/c3t6d0 /dev/dsk/newdisk

that can all be done online.

Now as far as moving your new disk from one slot to another, you'll have to :

#umount /mountpoint (of all the file systems in vg05
#vgchange -a n vg05
#vgexport -m /root/vg05.map vg05
{move your disk from one slot to another}
#ioscan -fnC disk (to find your disk)
#insf -e {if needed}
#mkdir /dev/vg05
#mknod /dev/vg05/group c 64 0xNN0000 {where NN is a different major number than any other Volume Group}
#vgimport -m /root/vg05.map vg05 /dev/dsk/diskfilename

and that should be it.

Cooperation is doing with a smile what you have to do anyhow.
Marco Santerre
Honored Contributor

Re: move data from a physical volume to another physical volume

Oops , I did forget after your pvmove, you'll need to remove the old disk therefore

#vgreduce vg05 /dev/dsk/c3t6d0
Cooperation is doing with a smile what you have to do anyhow.
Sridhar Bhaskarla
Honored Contributor

Re: move data from a physical volume to another physical volume

Hi Adam,

If I recall correctly, you are replacing the failing disk c3t6d0 with the new disk. Did you run insf yet?. Because I am not seeing the device files for your new disk. After running insf, you should be seeing c3t8d0. Once you find it out, do the following.

#pvcreate /dev/rdsk/c3t8d0
(use -f if it complains)
#vgextend vg05 /dev/dsk/c3t8d0
#lvextend -m 1 /dev/vg05/lvol1 /dev/dsk/c3t8d0
#lvreduce -m 0 /dev/vg05/lvol1 /dev/dsk/c3t6d0
#vgchange -a n vg05
#vgexport -v -m /tmp/vg05.map vg05

Shutdown the system. Move the disk from B4 to B3 so that the new disk will become c3t6d0. Bring up the server and import the vg back.
#mkdir /dev/vg05
#mknod /dev/vg05/group c 64 0x0?000 (replace ? with the unique number)
#vgimport -v -m /tmp/vg05.map vg05 /dev/dsk/c3t6d0
#vgchange -a y
#mount -a

Note: The single command "pvmove" does a lvextend and lvreduce. But extending the mirror and reducing the mirror gives more comfort to the management :-)

This should take care of your business.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: move data from a physical volume to another physical volume

Hmmm...forgot - after lvreduce use

vgreduce vg05 /dev/dsk/c3t6d0 to get rid of this volume.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Martin Johnson
Honored Contributor

Re: move data from a physical volume to another physical volume

If you have mirroring, use mirroring instead of pvmove. pvmove takes about one third longer to make the copy.

Of course, if you don't have mirroring, use pvmove.

HTH
Marty
MAD_2
Super Advisor

Re: move data from a physical volume to another physical volume

Marco, I am a little confused here, let me see if I got this:

#insf -e (what is it here? "insf -e /dev/dks/c3t8d0")
#pvcreate /dev/rdsk/c3t8d0
#vgextend vg05 /dev/dsk/c3t8d0
#pvmove /dev/dsk/c3t6d0 /dev/dsk/c3t8d0
#vgreduce vg05 /dev/dsk/c3t6d0

#umount /mountpoint (of all the file systems in vg05
#vgchange -a n vg05
#vgexport -m /root/vg05.map vg05
{move your disk from one slot to another}
#ioscan -fnC disk (to find your disk) -- it should at that point be found at 10/12.6.0, where the other one was
#insf -e {would it?}
#mkdir /dev/vg05
#mknod /dev/vg05/group c 64 0xNN0000 {where NN is a different major number than any other Volume Group}
#vgimport -m /root/vg05.map vg05 /dev/dsk/c3t6d0

or would the last step be

#vgimport -m /root/vg05.map vg05 /dev/dsk/c3t8d0

I am confused on the last portion... I mean, the slot SCSI ID will not be changed, it will remain SCSI ID 6, I want this new drive to take over that SCSI ID as the one being removed.
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
Marco Santerre
Honored Contributor

Re: move data from a physical volume to another physical volume

Adam,

I wasn't sure exacvtly what you meant by changing slot. Unfortunately, I know there are a few more gurus here that can help you better with changing the SCSI ID of a disk. I thought you were actually physically switching the disk from slots, which is why I was having you export and import the VG.
Cooperation is doing with a smile what you have to do anyhow.
Sridhar Bhaskarla
Honored Contributor

Re: move data from a physical volume to another physical volume

Adam,

When you move the disk, it will get the id of 6. So, you will be importing with the disk /dev/dsk/c3t6d0 as I indicated before. Also I use this opportunity to correct one more I skipped. I left vgchange -a y without any argument. It would be vgchange -a y vg05.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Marco Santerre
Honored Contributor

Re: move data from a physical volume to another physical volume

but if you actually physically move the disk into the old one's slot, it will retain SCSI ID 6, and therefore you should

#vgimport -m /root/vg05.map vg05 /dev/dsk/c3t6d0
Cooperation is doing with a smile what you have to do anyhow.
MAD_2
Super Advisor

Re: move data from a physical volume to another physical volume

Excellent Sridhar and Marco... I am using the step by step given by Sridhar, he has a very good idea of my previous scenario and knew exactly what I am attempting, but also looking at your posting which exposes the same basic solution with the pvmove (I am actually using the lvextend and lvreduce). I will be giving both of you 10 pts and I wish I could give you both more for your very prompt responses!!!

Doing the lvextend right now.
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
MAD_2
Super Advisor

Re: move data from a physical volume to another physical volume

Oh, thanks everyone for your participation, I think this is on its way to being resolved at this moment. Jeff, thanks for your, response, it provided clear insight on the first part, except the part of physically moving the other HD.

Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
MAD_2
Super Advisor

Re: move data from a physical volume to another physical volume

OK, here is exactly what I've done:

#insf -e (to create the disk filename as mentioned by Marco first)
#pvcreate /dev/rdsk/c3t8d0
(use -f if it complains; I did not have to use the option)
#vgextend vg05 /dev/dsk/c3t8d0
#lvextend -m 1 /dev/vg05/lvol1 /dev/dsk/c3t8d0 (this was the only lvol I had to reproduce)
#lvreduce -m 0 /dev/vg05/lvol1 /dev/dsk/c3t6d0
# vgreduce vg05 /dev/dsk/c3t6d0 (to get rid of this volume)
#umount /filesystem
#vgchange -a n vg05
#vgexport -v -m /tmp/vg05.map vg05

- I shutdown the system and then moved the disk from slot B4 in the array (set to SCSI 8) to B3 (set to SCSI 6) so that the new disk would become c3t6d0 as recommended by Sridhar.
- Bring up the server and import the vg back.

#mkdir /dev/vg05
#mknod /dev/vg05/group c 64 0x0?0000 (replace ? with the unique number)
#mv /etc/lvmtab /etc/lvmtab.old (lvmtab still reflected c3t8d0 for vg05)
#vgscan -a -v
#vgimport -v -m /tmp/vg05.map vg05 /dev/dsk/c3t6d0
#vgchange -a y /dev/vg05
#mount -a

That did the job. Thanks everyone!
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
Sridhar Bhaskarla
Honored Contributor

Re: move data from a physical volume to another physical volume

Adam,

I did not see anyone mentioning about vgscan. You didn't need to run it.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
MAD_2
Super Advisor

Re: move data from a physical volume to another physical volume

Sridhar, at this point I was unable to do the vgimport...

#vgimport -v -m /tmp/vg05.map vg05 /dev/dsk/c3t6d0

So I did a
#strings /etc/lvmtab (it showed for vg05 c3t8d0, then I did.

#mv /etc/lvmtab /etc/lvmtab.old (lvmtab still reflected c3t8d0 for vg05)
#vgscan -a -v

After that I was able to the the vgimport...
#vgimport -v -m /tmp/vg05.map vg05 /dev/dsk/c3t6d0
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
Sridhar Bhaskarla
Honored Contributor

Re: move data from a physical volume to another physical volume

vgexport -v -m /tmp/vg05.map vg05


Unless you forgot that step, vg05 would not be listed under /etc/lvmtab. Even if you forgot, after reboot, what you would do is simply vgexport vg05 as it won't get activated due to c3t8d0 missing.

I do not run vgscan very often unless my lvmtab is literally corrupted or deleted.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Jeff Schussele
Honored Contributor

Re: move data from a physical volume to another physical volume

Appreciate the feedback Adam.
Yep, cruised right by those last sentences. Got a little scroll-happy ======~))
Glad you're square now....... knew you were in good hands. {~)

Well Done,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!