Operating System - HP-UX
1747984 Members
4831 Online
108756 Solutions
New Discussion юеВ

Defect Hard Disk Removal from LVM

 
SOLVED
Go to solution
Jerome Salyers
Advisor

Defect Hard Disk Removal from LVM

hi,

we are working on a K370 machine with HPUX11.0... we have a disk that we are trying to create mirroring on... it is already in lvmtab... but now it is dead and we can't reach it...

how can i remove a dead disk from the lvmtab so that i can put in another disk and use it... mirror on this disk is not yet started... but the physical volume is already created and it is already assigned to vg01...

thanks in advance!

jerome
9 REPLIES 9
Stefan Farrelly
Honored Contributor

Re: Defect Hard Disk Removal from LVM

Have your tried a vgreduce -f vg01 ?

If not then;
1. backup /etc/lvmtab to another file
2. remove /etc/lvmtab
3. vgscan (which recreates /etc/lvmtab)
4. vgreduce -f vg01 (this should no forceably remove the device from vg01)

Then you can replace the disk, pvcreate it, then add it back in again.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Michael Tully
Honored Contributor
Solution

Re: Defect Hard Disk Removal from LVM

You could try and run 'vgreduce /dev/myvolgrp /dev/dsk/cxtydz and remove the disk from the volume group or simply replace the disk and run the 'vgcfgrestore -n /dev/myvolgrp /dev/dsk/cxtydz'.

As per the man page try to have the volume group de-activated.

# man vgcfgrestore

Anyone for a Mutiny ?
Jerome Salyers
Advisor

Re: Defect Hard Disk Removal from LVM

hi, steve...

won't vgreduce -f vg01 remove the entire volume group... i don't want to touch the original vg01... i would lose all my data, no?

what exactly happens when i do a vgreduce -f on a volume group? does it only touch mirrored vgs?

thanks
jerome
Clemens van Everdingen
Honored Contributor

Re: Defect Hard Disk Removal from LVM

Hi,

You have to do this:

# vgreduce /dev/vg01 /dev/dsk/cXtXdX

Replace the X's with the correct numbers which reflect you defect disk.
This will only touch this disk and remove that disk from the vg01.

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
Jerome Salyers
Advisor

Re: Defect Hard Disk Removal from LVM

hi, michael...

vgreduce doesn't work because it can't reach the physical volume...

we tried the vgcfgrestore on the /dev/dsk/cxtxd0, which gave us errors, but on /dev/rdsk/cxtxd0 it said it restored the logical volume info on the new hard disk... but i still can't extend or remove the physical volume from the vg...

the error from the vgcfgrestore -n /dev/vg01 /dev/dsk/cxtxdx command was:

Character-special file for PV not supplied on command line, OR PV did not belong to volume group /dev/vg01 when configuration file was created

we checked in lvmconf/vg01.conf and /dev/rdsk/cxtxdx is the entry...

still we can't seem to GET to the physical disk...

jerome
Chuck J
Valued Contributor

Re: Defect Hard Disk Removal from LVM

Maybe try:

/dev/rdsk/cxtxdx
Jean-Louis Phelix
Honored Contributor

Re: Defect Hard Disk Removal from LVM

Jerome,

If you have replaced the disk and vgcfgrestore'd the configuration to it, you can still have LVM not aware of this replacement.

You now have to use a 'vgchange -a y' command if LVM has deactivated the bad disk. From the vgchange man page you can read :

If the -a y or -a e option is executed
on a currently active volume group,
vgchange attempts to include any
physical volumes that were previously
listed as missing. This is useful if a
physical volume has come back online.

Regards,

Jean-Louis.
It works for me (┬й Bill McNAMARA ...)
Jerome Salyers
Advisor

Re: Defect Hard Disk Removal from LVM

thanks jean louis and michael tulley for your help, and the others for their advice... the vgcfgrestore and then then vgsync did it... thanks!

jerome
ilaiyaraja
New Member

Re: Defect Hard Disk Removal from LVM

thanks stefan