When Good Disks Go Bad: Dealing with Disk Failures Under LVM (5900-3153, June 2013)

18
5. Removing the Disk
If you have a copy of the data on the failing disk, or you can move the data to another disk, you can
choose to remove the disk from the system instead of replacing it.
Removing a Mirror Copy from a Disk
If you have a mirror copy of the data already, you can stop LVM from using the copy on the failing
disk by reducing the number of mirrors. To remove the mirror copy from a specific disk, use
lvreduce, and specify the disk from which to remove the mirror copy. For example:
# lvreduce -m 0 -A n /dev/vgname/lvname pvname (if you have a single mirror copy)
or:
# lvreduce -m 1 -A n /dev/vgname/lvname pvname (if you have two mirror copies)
The A n option is used to prevent the lvreduce command from performing an automatic
vgcfgbackup operation, which might hang while accessing a defective disk.
If you have only a single mirror copy and want to maintain redundancy, create a second mirror of the
data on a different, functional disk, subject to the mirroring guidelines, described in Preparing for Disk
Recovery, before you run lvreduce.
You might encounter a situation where you have to remove from the volume group a failed physical
volume or a physical volume that is not actually connected to the system but is still recorded in the
LVM configuration file. Such a physical volume is sometimes called a ghost disk or phantom disk. You
can get a ghost disk if the disk has failed before volume group activation, possibly because the
system was rebooted after the failure.
A ghost disk is usually indicated by vgdisplay reporting more current physical volumes than active
ones. Additionally, LVM commands might complain about the missing physical volumes as follows:
# vgdisplay vg01
vgdisplay: Warning: couldn't query physical volume "/dev/dsk/c5t5d5":
The specified path does not correspond to physical volume attached to
this volume group
vgdisplay: Couldn't query the list of physical volumes.
--- Volume groups ---
VG Name /dev/vg01
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 3
Open LV 3
Max PV 16
Cur PV 2 (#No. of PVs belonging to vg01)
Act PV 1 (#No. of PVs recorded in the kernel)
Max PE per PV 4350
VGDA 2
PE Size (Mbytes) 8
Total PE 4341
Alloc PE 4340
Free PE 1
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0