1834798 Members
2893 Online
110070 Solutions
New Discussion

Re: Removing unused VG

 
SOLVED
Go to solution
Madhu_17
Regular Advisor

Removing unused VG

Hi Friends,

I would like to remove the unused VG. this VG is having one lv defined. Can anybody give me step by step commands to remove this Lv, VG and PV.

Thanks,
Madhu
10 REPLIES 10
Ravi_8
Honored Contributor
Solution

Re: Removing unused VG

Hi,

#vgdisplay -v
will display lvol's existing in it, check the existing lvol's and take a backup of data if needed.

#lvremove /dev/vgxx/rlvolxx
#vgremove /dev/vgxx < to remove vg>
#vgscan -v

once you remove the vg, Physical disk (PV) is free ( check using vgdisplay -v )
which you can unplug
never give up
Madhu_17
Regular Advisor

Re: Removing unused VG

Hi,

I am able to remove LV and VG. I am able to add that disk to other VG also.

But only thing is that in /etc/lvmconf, still i'm able to see the configuration details of that old VG. even in /dev also, those old VG details are visible. how to remove all those entries. so that i can use the same VG number and minor numbers in the future.

i tried vgscna -v without any success.


Thanks,
Madhu
Bharat Katkar
Honored Contributor

Re: Removing unused VG

Madhu,

# vgexport

Be very sure of the VGname before executing the command.


Regards,
You need to know a lot to actually know how little you know
Ravi_8
Honored Contributor

Re: Removing unused VG

Hi

#mv /etc/lvmconf /etc/lvmconf.old
#vgscan -v

what's the content of /etc/lvmconf?
never give up
Madhu_17
Regular Advisor

Re: Removing unused VG

Ravi,

/etc/lvmconf is a directory.Do you want me to move the whole directory?

vgxx.conf file in /etc/lvmconf is showing the disk device file.

when i ran vgscan -v it's giving the warning message "The Volume Group /dev/vgxx/group was not matched with any Physical Volumes.
Scan of Physical Volumes Complete."

I think problem is with /dev/vgxx/group file. Can i remove this file directly?


Thanks,
Madhu
Ravi_8
Honored Contributor

Re: Removing unused VG

Hi Madhu

/etc/lvmconf is a directory.
when you run vgscan, corresponding vgxx under /etc/lvmconf files will be updated,

The vgremove will remove the specified vg's minor number (0x010000 etc.

check whether the disk is claimed or not (ioscan -fnC disk)
never give up
Nguyen Anh Tien
Honored Contributor

Re: Removing unused VG

Only take
#vgexport vgname
is enought.
HP is simple
Madhu_17
Regular Advisor

Re: Removing unused VG

Ravi,

disk is claimed only. I added this disk to other VG also.

i ran vgremove while removing the Vg. but the /dev/vgxx directory is still exists.

how can i remove this?
Ravi_8
Honored Contributor

Re: Removing unused VG

Hi Madhu

vgremove should be remove the entire instances (including directory) of the volume group. If still exist use rm -rf /dev/vgxx to remove it.

make sure you are removing the dir of that VG (vgxx) only, removing VG00 leads to system crash
never give up
Madhu_17
Regular Advisor

Re: Removing unused VG

found the solution