Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
LVM and VxVM
Showing results for 
Search instead for 
Did you mean: 

Defect Hard Disk Removal from LVM

Go to solution

Defect Hard Disk Removal from LVM


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!

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

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 ?

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?

Clemens van Everdingen
Honored Contributor

Re: Defect Hard Disk Removal from LVM


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.

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

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...

Chuck J
Valued Contributor

Re: Defect Hard Disk Removal from LVM

Maybe try:

Jean-Louis Phelix
Honored Contributor

Re: Defect Hard Disk Removal from LVM


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.


It works for me (© Bill McNAMARA ...)

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!

Occasional Visitor

Re: Defect Hard Disk Removal from LVM

thanks stefan