Operating System - HP-UX
1833779 Members
2297 Online
110063 Solutions
New Discussion

Re: How to transfer logical volume to other volume group

 
Carmela Agustin
Occasional Advisor

How to transfer logical volume to other volume group

I have 2 volume groups: vg01 and vg02
VG02 has /oracle.
I want to transfer /oracle to vg01.
How do I do it?
Pls help, thanks.
6 REPLIES 6
MarkSyder
Honored Contributor

Re: How to transfer logical volume to other volume group

I don't use Oracle, but I think I can safely say you will have to schedule some downtime.

1. Set up a new filesystem, e.g. new_oracle, on vg01

2. cd /oracle and run the following command:

find . â xdev â depth â print|cpio â pmd /new_oracle

3. cd /etc and run

vi fstab

Swap oracle and new_oracle.

4. Reboot the system.

I hope it goes without saying that you should take a full data backup and a full ignite backup before you start this.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
CAS_2
Valued Contributor

Re: How to transfer logical volume to other volume group

I think your question is ambiguous.

Do you want

A. transfer all logical volumes in VG02 to VG01 ?

B. Just one logical volume in VG02 to VG01 ?

C. just rename VG02 to VG01 ?


Other logical volumes in VG01 must be kept or may be removed ?
Jayasuntar
Valued Contributor

Re: How to transfer logical volume to other volume group

Dear Agustin,

U can not move LV from one VG or another VG.

Create new LV in VG02, and copy or transfer ( Use find,tar or cpio) /oracle files to the new LV.

And then mount the new FS to /oracle mount point.

Regards

Jay
Cem Tugrul
Esteemed Contributor

Re: How to transfer logical volume to other volume group

Hello,

i think below the steps would be a solution for you;

1 -Be sure you have enough PE in VG01
2 -Create new lvol in VG01
3 -Create FS for this new lvol
4 -Mount this Fs something like /new_oracle
5 - cd /oracle
6 -Be sure Oracle DB closed.
7 -in /oracle dir write;
find . |cpio -dumplv /new_oracle
8 -umount /oracle
9 -umount /new_oracle
10-mount /dev/vg01/lvol1 /oracle
11- startup ORACLE DB
12-Check appl-data-connections etc
13-IF OK
14-modify your /fstab

Good Luck,

PS:i did it a month ago!!!
:-)
Our greatest duty in this life is to help others. And please, if you can't
Geoff Wild
Honored Contributor

Re: How to transfer logical volume to other volume group

I would use vxdump...

Shut down apps/oracle...

create new lvol on vg01 same size as oracle on vg02

umount /oracle
mkdir /zoracle

mount /dev/vg02/lvoloracle /zorcal

mount /dev/vg01/lvoracle /oracle

vxdump -0 -f - -s 1000000 -b 16 /zoracle | (cd /oracle ; vxrestore rf -)

When done, ummount /zoracle, remove that lvol, update /etc/fstab

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Howard Marshall
Regular Advisor

Re: How to transfer logical volume to other volume group

First, I know I am probably being knit picking about this but if your not sure how to accomplish this understanding the terminology will help you understand it better and may help prevent mistakes.

/oracle is not a logical volume. Itâ s a mount point for a file system. That file system resides on a logical volume and the logical volume resides in the volume group.

As was stated earlier, you can't "move" a lv from one vg to another, much like you can't move sectors from one hard dirve to another. You can move the data, just not the physical sectors.

So, you can move the data, just not the lv. Do move the data you will have to create a new logical volume in vg01. you can name it what ever you wish, lvoracle works and lets you know whats on the lv too. Create a new file system on the new lv and mount it on an alternated mount point. Cpio the files over (details in previous posts), unmount both file systems and mount your new logical volume on the old mount point /oracle

Double check everything before you erase or delete the old logical volume, something may not have been picked up correctly by cpio or there may be some other issue that may require you to revert back to the old lv for the system to work but that should take care of it for you.

H