Operating System - HP-UX
1828925 Members
2237 Online
109986 Solutions
New Discussion

Move File system to new vg

 
Kwahae_1
Regular Advisor

Move File system to new vg

Hi,

I would like to move /u0 below to a new and bigger vg vg01. What is the best way of doing this using LVM commands?

/dev/vgora/oralv1 79872000 78678481 1127941 99% /u0
8 REPLIES 8
Patrick Wallek
Honored Contributor

Re: Move File system to new vg

You can't move a logical volume between VG's. You will have to

1) create a new LV in your new VG,
2) mount it as /u0new (or something),
3) copy/move the data from /u0 to /u0new,
4) umount /u0 and /u0new the
5) remount your new LV as /u0.
johnsonpk
Honored Contributor

Re: Move File system to new vg

Hi Kwahae,

Create a new lv on the new vg ,
mount it under different mount point
copy data using any backup tools
once copy is over unmount /uo1 and mount the newly created lvol on /u01

If you looking for any lvm method (like pvmove,mirror)to copy the data across vg ,there is none :-(

Rgds
Johnson
Kwahae_1
Regular Advisor

Re: Move File system to new vg

Hi Patrick,

No 4 is not completely finished?
Patrick Wallek
Honored Contributor

Re: Move File system to new vg

Oops....It should just say:

4) umount /u0 and /u0new
Pulse001
Regular Advisor

Re: Move File system to new vg

Sadly in hpux we donot have any such command to copy a LV from one vg to another. Such a command is there is aix.
Michal Kapalka (mikap)
Honored Contributor

Re: Move File system to new vg

Hi,

if its a offline copying of date you could use dd and if the new LVOL is bigger them extendfs and fsck and everithing should be ok.

if the file are smaller to 2 GB them you could use find + cpio combination.

mikap
Md. Minhaz Khan
Super Advisor

Re: Move File system to new vg

Dear Kwahae

>>I would like to move /u0 below to a new and bigger vg vg01. What is the best way of doing this using LVM commands?

Don't do it. Just Add a NEW LUN in vgora then extend oralv1. Procedure is as follows:

1.Assign a new LUN to HOST from SAN

2.insf

3.ioscan -fnC disk

3.pvcreate /dev/rdsk/cxtxdx

where cxtxdx is the new LUN

4.Shutdown your Database.

5.vgextend vgora /dev/rdsk/cxtxdx

6.lvextend -L /dev/vgora/oralv1

7.If you have OnLineJfs then

#fsadm -F vxfs -b M /u0

if you don't have OnLineJfs then

#umount /u0
#extendfs -F vxfs /dev/vgora/roralv1
#mount /dev/vgora/oralv1 /u0
#bdf


Thanks
Minhaz
melvyn burnard
Honored Contributor

Re: Move File system to new vg

Well if you like old style commands, I used to use cpio
1. create new lvol/filesystem
2. mkdir /newu01
3. mount to /newu01
4. cd /u01
5. find . -print -depth | cpio -pdumv /newu01
6. umount /newu01
7. umount /u01
8. modify /etc/fstab to reflect the correct new lovl
9. mount -a to check it works.

You could also use pax:
do steps 1 to 3, then:
pax -rvw /u01 /newu01
then do steps 6 to 9
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!