1834308 Members
3424 Online
110066 Solutions
New Discussion

remove drive from lvm

 
SOLVED
Go to solution
Gerald Taylor
Frequent Advisor

remove drive from lvm

We have a dead disk on an old system. We are not planning to replace the dead disk. Try to do an lvreduce to break the mirror:
lvreduce -m 0 /dev/vg05/uvol5 /dev/dsk/c1t4d0

it says that cannot communicate with physical volume we get the same thing for vgreduce. Is there a way to reduce the volume group without being able to communicate to the drive?
4 REPLIES 4
Steven Gillard_2
Honored Contributor

Re: remove drive from lvm

Try using vgscan to re-create you /etc/lvmtab file. I strongly suggest running it in preview mode first (-p) and make sure you keep a backup of the lvmtab file. A full system backup would not go astray either.

# mv /etc/lvmtab /etc/lvmtab.orig
# vgscan -a -v

Regards,
Steve
Sridhar Bhaskarla
Honored Contributor

Re: remove drive from lvm

Hi Gerald,

There is a painful process for this. You need to find the PV Key for each logical volume and then reduce it using the key.

For each lvol in your vg05 do the following,

#lvdisplay -v -k /dev/vg05/lvol?

This will display

LE PV1-key PE1 Status PV2-Key status

Find out the PV-key of the corresponding disk. The status would show as ???. Say 1.

Then do an lvreduce using -k option.

#lvreduce -m 0 -k /dev/vg05/lvol? 1

Once you are done with all the logical volumes, you can be able to reduce the PV.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Marcin Wicinski
Trusted Contributor
Solution

Re: remove drive from lvm

Hi,
I think you have a "ghost disk".
# lvdisplay -v -h /dev/vgXX/lvolX - get disk-key

# lvreduce -m 0 -k /dev/vgXX/lvolX [disk-key]

repeat this procedure for all mirrored lvols and then:

# mv /etc/lvmtab /etc/lvmtab.old
# vgscan
# vgreduce vgXX /dev/dsk/YY
# vgchange -a n vgXX
# vgreduce -f vgXX [disk]
Marcin Wicinski
Sanjay_6
Honored Contributor

Re: remove drive from lvm

Hi Gerald,

Use "lvreduce -k" to reduce mirror on a non-existant disk or a failed disk.

Hope this helps.

Regds