1836596 Members
3199 Online
110102 Solutions
New Discussion

Re: lvgremove

 
subhashni
Regular Advisor

lvgremove

I wanted to remove a volume group named vg01.
In that i had 2 logical volumes(lvol1,lvol2).
I did lvremove for them.But after that i can see only one logical volume was removed.The other one is remaining.If i use lvremove on that "it is saying successfully removed:.But it remains there.If i do vgremove on vg01 it says you have logical volume in it.what should i do?I would like to remove the volume group.
suggesstions are appreciated.
unix4me
8 REPLIES 8
Helen French
Honored Contributor

Re: lvgremove

Hi Subh,

This is the normal procedure :

1) Unmount the file systems (umount)
2) check through 'bdf' to confirm the umount.
3) remove LVs (lvremove lvname)
4) Confirm removal through 'lvdisplay' or 'vgdisplay -v'
5) remove vg (vgremove)

For an easy trial you can do this throgh SAM.
Remember to check up nobody is using the particular file systems.

HTH,
Shiju
Life is a promise, fulfill it!
James R. Ferguson
Acclaimed Contributor

Re: lvgremove

Hi:

You say "I can see only one logical volume was removed.". How do you conclude this; the presence of device files (/dev/vg01/*) or doing 'lvdisplay /dev/vg01/lvolN'?

A simple way to eliminate almost all vestiges of a volume *group* (i.e. all of its logical volumes and device files) is to 'vgexport' the volume group. You will then only need to edit its logical volume mount points (if any) from /etc/fstab.

Regards!

...JRF...
subhashni
Regular Advisor

Re: lvgremove

After removing lvol1 and lvol2,i did vgremove.
It has given the error message as "can't remove the volume group ,there is existing logical volumes."
unix4me
Helen French
Honored Contributor

Re: lvgremove

Hi,

Seems like it failed removing the LV. What will be the output of 'lvdisplay' and 'vgdisplay ? Does it show any LV information ? Did you try removing through SAM ?

Shiju
Life is a promise, fulfill it!
Michael Tully
Honored Contributor

Re: lvgremove

Hi,

In this situation it sounds like there
are still logical volumes in the group.
To check run the vgdisplay command
# vgdisplay -v /dev/vg01
It should return some information on
existing volumes. If so run the 'lvremove'
command.
# lvremove /dev/vg01/lvol?
Once all have been removed and any
other except the last physical
volumes by running
the 'vgreduce' command
# vgreduce /dev/vg01 /dev/dsk/cxtydz
only then can you run the 'vgremove'
command
# vgremove /dev/vg01

As suggested earlier by James, running
the 'vgexport' command will do the lot.

HTH
-Michael
Anyone for a Mutiny ?
subhashni
Regular Advisor

Re: lvgremove

the vgdisplay displays it contains one logical volume.
unix4me
James R. Ferguson
Acclaimed Contributor

Re: lvgremove

Hi (again):

So the 'vgdisplay' shows one logical volume. Is the logical volume one of those you 'lvreduce'd? Would you please re-do the 'vgdisplay' adding the verbose (-v) option. Also, do a verbose 'lvdisplay' on the remaining logical volume and post that.

Once again, if you have *nothing* on the volume group that you want, a 'vgexport' of the whole volume group should do a rapid cleanup.

# vgchange -a n /dev/vg01
# vgexport /dev/vg01

Regards!

...JRF...
Sridhar Bhaskarla
Honored Contributor

Re: lvgremove

If your idea is to remove the volume group, you can simply do a vgexport. You don't need to worry about the logical volumes in it.

#vgchange -a n vg01
#vgexport vg01

This will get you rid of vg01 from the system. You can do a pvcreate on the disks and start using them.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try