Operating System - HP-UX
1832189 Members
2689 Online
110038 Solutions
New Discussion

Replacing faulty disks - HPUX 10

 
Declan Heerey
Frequent Advisor

Replacing faulty disks - HPUX 10

I have two 8Gb disks /dev/dsk/c2t8d0 & /dev/dsk/c2t9d0 making up a logical volumn group /dev/VG_DB1/lvol1! One of the disks has failed (/dev/dsk/c2t9d0). None of the space available on this disk has been allocated to the logical volumn group. Can i replace the disk and not lose the data on the filesystem (remaining disk)? I was going to do the following:-

# umount
# vgchange -a n /dev/VG_DB1
# vgreduce /VG_DB1 /dev/dsk/c2t9d0

swap the physical disk
After replacing the disk /dev/dsk/c2t9d0
# pvcreate -f /dev/rdsk/c2t9d0 ( New Disk )
# vgcfgrestore -s -m mapfile /dev/vg01 /dev/dsk/c1t2d0

# vgchange -a y /dev/vg01
# mount
I should mention that I have database files (1Gb) on this filesystem (good disk). These haven't been backed up in 2 weeks (because of the disk problem) so restoring them from tape media is a huge problem.

NB. The disks are not mirrored or stripped!

Any help appreciated!

Declan
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: Replacing faulty disks - HPUX 10

Declan,

I think your plan is sound, but you will probably need to add the -f option to your vgreduce. From man vgreduce:

-f vg_name force reduction of missing physical volume(s) in a
given volume group. This option does not require
a physical volume (PV) to be supplied on the
command line. vgreduce obtains the name of each
physical volume (PV) belonging to the volume group
from the file /etc/lvmtab. It then reads the LVM
structures from each PV and compares these with
that held by the kernel to work out which PVs are
missing. PVs which are missing will be candidates
for removal. If all the physical extents on the
missing PV are free then it will be removed from
the volume group.

Good luck,
Pete

Pete
Trond Haugen
Honored Contributor

Re: Replacing faulty disks - HPUX 10

If you vgreduce the faulty disk away you should add it back with vgextend.
On the other hand if it is a hotswap disk you should be able to replace the disk and run vgcfgrestore.
With ether option deactivating the vg is a good idea.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Pete Randall
Outstanding Contributor

Re: Replacing faulty disks - HPUX 10

Thanks, Trond, I completely missed that part.

Pete

Pete
Declan Heerey
Frequent Advisor

Re: Replacing faulty disks - HPUX 10

Thanks Pete / Trond, I have added the -f option to my vgreduce command and as the disk is hot swap i will use vgcfgrestore. I'll let you know how i get on!
Ravi_8
Honored Contributor

Re: Replacing faulty disks - HPUX 10

Hi, Declan

your procedure should work.

pls let's know the result
never give up
Jean-Louis Phelix
Honored Contributor

Re: Replacing faulty disks - HPUX 10

hi,

I am sorry but ... you have to choose between vgreduce and vgcfgrestore. It also depends wether your disk is still considered as available or not.

A - if it's still available (cur PV 2 act PV 2)
. vgchange -a n vgxx
. hot swap disks
. vgcfgrestore
. vgchange -a y
It could even work without deactivating the vg, but refreshing the activation is required

B - if it's not available (cur PV 2 act PV 1)
. vgreduce -f /dev/vgxx
. swap disks
. pvcreate
. vgextend
or
. hot swap disks
. vgcfgrestore
. vgchange -a y

Regards
It works for me (© Bill McNAMARA ...)
Declan Heerey
Frequent Advisor

Re: Replacing faulty disks - HPUX 10

Jean,

Option B was what worked in the end! I have replaced the disk and everything is working fine.

The procedure i followed was:-

# umount
# vgreduce -f /VG_DB1 /dev/dsk/c2t9d0

swap the physical disk
After replacing the disk /dev/dsk/c2t9d0

# pvcreate -f /dev/rdsk/c2t9d0 ( New Disk )
# vgextend /dev/VG_DB1 /dev/dsk/c2t9d0

# mount

Thanks for all the help!!!!!