1822231 Members
3611 Online
109642 Solutions
New Discussion юеВ

Remove logical volume

 
Tomek_1
Advisor

Remove logical volume

Hi
How can i remove logical volume if the disk has been removed.

Tom
8 REPLIES 8
Brian K. Arnholt
Frequent Advisor

Re: Remove logical volume

Tom,

I am assuming you mean you want to remove any/all system information for a LV that resided on a disk that has been removed. I had a similar issue when I created vg01 with lvol1 on a non-root disk. After removing/replacing the disk, the system complained that it couldn't find any information about vg01/lvol1, and if I attempted to remove it via SAM, it failed too. I was successful in manually editing the lvmconf files, and the device files, such that SAM was able to recreate a new volume group/logical volume.

Under /etc/lvmconf there are configuration files for volume groups and logical volumes on the system. You can remove all information pertaining to your removed LV, also, check the /device files for that particular LV (/dev/vg01/lvol1, for example).

Be sure to check /etc/fstab and update accordingly.

Good luck,

Brian
Some see things as they are and ask why, I dream of things that never were and ask why not?
Martin Johnson
Honored Contributor

Re: Remove logical volume

You can vgexport and vgimport the volume group. If it is vg00, you will need to reboot into maintenance mode.

HTH
MArty
Jon Mattatall
Esteemed Contributor

Re: Remove logical volume

There's a "special" case for this...
Have you replaced a mirrored disk?

What is the output of

lvdisplay -kv /dev/vg##/lvol# (pick an lvol you want to remove)?
A little knowledge is dangerous - none is absolutely terrifying!!!
Jon Mattatall
Esteemed Contributor

Re: Remove logical volume

Well, I've gotta split, so....

if you do

lvdisplay -kv /dev/vg00/lvol1

for each lvol you want to remove (substitute your values, of course), you'll see something like

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c1t2d0 25 25
/dev/dsk/c2t2d0 25 25

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
0000 0 0000 current 1 0000 current
0001 0 0001 current 1 0001 current

and so on. (This assumes mirroring - otherwise you should just have 1 PV)
Check the PV# -- NOT the PE#
Repeat the lvdisplay for all lvols in question, and be sure they're all on the same PV# (they should be).
This example is from a good box - you should see stale, or some other error.
If status is stale (or you're sure of the one to remove), you can

lvreduce -k PV# -m 0 /dev/vg##/lvol# for each lvol.

You may also need to
vgreduce -f /dev/vg## (if vgdisplay still "sees" the removed disk)

and if you swapped (not just removed a disk), you can

# mv /etc/lvmtab /etc/lvmtab.old
# vgscan -v ----- recreate lvmtab.
# vgchange -a y
# ll /etc/lvmtab ------ make sure the date is current.


Jon
A little knowledge is dangerous - none is absolutely terrifying!!!
Tomek_1
Advisor

Re: Remove logical volume

Hello
I don't have a mirror. I had a disk with one volume group vg02, na logical volume lvol1. I've remove disk from machine, and now i can't remove vg02 and lvol1.
Can You help me?

Rgds.
Tom
Pete Randall
Outstanding Contributor

Re: Remove logical volume

Did you try vgexport?

Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: Remove logical volume

Hi Tom:

Isn't this really the same question/problem you started in this thread?

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x86993a1c04ffd61190050090279cd0f9,00.html

If so, see my suggestion there.

Regards!

...JRF...
Tomek_1
Advisor

Re: Remove logical volume

Yes i did.
vgexport vg02
Volume group "vg02" is still active.
vgexport: Couldn't export volume group "vg02".
But when i tried:
vgchange -s n vg02
and then
vgexport vg02
and it launched
Thanks for help.
Best regards.