Operating System - HP-UX
1834058 Members
2530 Online
110063 Solutions
New Discussion

Re: lvm: replacing a disk

 
SOLVED
Go to solution
Geeta Singh
Occasional Contributor

lvm: replacing a disk

We are using HPUX 10.20. I want to replace a disk. This is the first time, kindly give me steps to be followed.
We have only 1 disk
/dev/dsk/c0t4d0
in volume group vg02,which
is giving problem. This disk is having only 2 logical volume lvol1 and rawlog data area.
I want to replace this disk and the content to be
copied from old disk to new disk and then new disk should be placed as same as old disk , i.e., /dev/dsk/c0t4d0 and vg02.
Thanks in advance.
1 REPLY 1
monasingh_1
Trusted Contributor
Solution

Re: lvm: replacing a disk

connect the new disk at some other target (c0t5d0)

ioscan

pvcreate /dev/rdsk/c0t5d0

vgextend /dev/vg02 /dev/dsk/c0t5d0

pvmove -n /dev/vg02/lvol1 /dev/dsk/c0t4d0 /dev/dsk/c0t5d0

pvmove -n /dev/vg02/lvol2 /dev/dsk/c0t4d0 /dev/dsk/c0t5d0

vgreduce /dev/vg02 /dev/dsk/c0t4d0

umount /dev/vg02/lvol1 (not required if used in raw mode but you will need to stop the application using this lvol)

umount /dev/vg02/lvol2

note down the minor number for /dev/vg02/group

vgexport -s -m vg02.map /dev/vg02

stop the server, change the ID from 5 to 4

ioscan

mkdir /dev/vg02

mknod /dev/vg02/grup c 64 0xXX0000
XX is the minor number noted above.

vgimport -s -m vg02.map /dev/vg02

everything whould be back as normal...

Do not forget to do a man on each command befor you try for more details.

hope this helps...