Operating System - HP-UX
1834601 Members
3712 Online
110069 Solutions
New Discussion

Moving a filesystem to a new PV

 
SOLVED
Go to solution
Nappy_1
Frequent Advisor

Moving a filesystem to a new PV

I have a large file system with a large number of files.
i want to move this file system to a new array without many hours of downtime.

i'm thinking to use the following:
1/ Add the new PV to the existing VG (vgextend)
2/ Mirror the LV (lvextend -m 1 /dev/vg/lv newPV)
3/ Waiting for the mirror to complete
4/ Shutdown the application
5/ Reduce the LV (lvreduce -m 0 /dev/vg/lv)
6/ Reduce the VG
7/ import the new PV in a new VG

is that possible? can you help with the commands for step 7
is there a better solution to do that?
10 REPLIES 10
Suraj K Sankari
Honored Contributor
Solution

Re: Moving a filesystem to a new PV

Hi,

This looks ok but you can move PE into other disk also
#pvmove /dev/dsk/c0t5d0 /dev/dsk/c0t2d0

For more informaton see the attached file.

Suraj
Rainer von Bongartz
Honored Contributor

Re: Moving a filesystem to a new PV

Hope you have MirrorDisk installed.
Procedure than is easy and online

1) pvcreate /dev/rdsk/

2) vgextend /dev/vgtest /dev/dsk/

3) lvextend -m 1 /dev/vgtest/lvol/dev/dsk/

4) lvreduce -m 0 /dev/vgtest/lvol1 /dev/dsk/

5) vgreduce /dev/vgtest dev/dsk/


He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...

Re: Moving a filesystem to a new PV

Hi Suraj,
can the pvmove done without a shutdown?
Nido
Trusted Contributor

Re: Moving a filesystem to a new PV

Yes, pvmove can be done ONLINE.
Check the details in the man page.

Note: Use nohup with pvmove to avoid any problems if terminal timout/disconnect.

Cheers!!
" Let Villagers Be Happy!! "
sujit kumar singh
Honored Contributor

Re: Moving a filesystem to a new PV

Hi

Answer to ques number 7.

#mkdir /dev/
#mknod /dev/>new_VG>/group c 63 0xXY0000

make sure that the minor number for the group file that you give is unique on the system.

#vgimport -v /dev/
#vgchange -a y
#vgcfgbackup /dev/

regards
sujit
Nappy_1
Frequent Advisor

Re: Moving a filesystem to a new PV

Hi Sujit,
i guess that vgchgid is required before vgimport. what do you think?
Suraj K Sankari
Honored Contributor

Re: Moving a filesystem to a new PV

Hi,

>>can the pvmove done without a shutdown?
Yes you can perfrom online
For more information see the man page of pvmove

Suraj
sujit kumar singh
Honored Contributor

Re: Moving a filesystem to a new PV

hi

as you do a vgreduce for that new_PV the VG information from that gets removed, so is the VGiD , that is then it belongs to no VG.
so vgchgid is not required if you wish after vgreduce to add this PV to another VG on the same Machine.

regards
sujit
Sharma Sanjeev
Respected Contributor

Re: Moving a filesystem to a new PV

Hi Nappy,

I think once you do lvreduce with old disk u also need to remove old pv key also

lvdisplay -k lvol
than
lvreduce -m 0 k lvol and key

And PVMOVE yes you can done online not down time is required, as NIDU says use nohup.

Regards
Sanjeev
Everything is Possible as " IMPOSSIBLE" word itself says I M POSSIBLE
Steven E. Protter
Exalted Contributor

Re: Moving a filesystem to a new PV

Shalom,

One of the first questions I ever asked HP support a long time ago was how to do this.

The answer was to back up the data with fbackup, create a new logical volume and file system and restore it.

Now this thread shows there are other answers.

But before I go dinking around with these hot methods, I take the backup first.

I've a few times used a plan similar to yours knowing a backup is in my pocket.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com