LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-26-2016, 01:54 PM   #1
fanoflq
Member
 
Registered: Nov 2015
Posts: 397

Rep: Reputation: Disabled
Removing volume group before creating logical volume


Scenario:
Create physical volume, then create volume group.
Now I decide not to continue to create logical volume.
I want to delete the volume group.

Quote:

[root@localhost dev]# vgcreate vgdata /dev/vda3

root@localhost dev]# pvs
PV VG Fmt Attr PSize PFree
/dev/vda2 centos lvm2 a-- 7.52g 0
/dev/vda3 vgdata lvm2 a-- 96.00m 96.00m

[root@localhost dev]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 1 2 0 wz--n- 7.52g 0
vgdata 1 0 0 wz--n- 96.00m 96.00m

[root@localhost dev]# updatedb
[root@localhost dev]# locate vgdata
/etc/lvm/archive/vgdata_00000-338846304.vg
/etc/lvm/backup/vgdata
I would expect to see volume group folder in /dev.
But it is not there.

# E.g. no find result
find /dev -iname vgdata

To remove the physical volume from volume group:
vgreduce path/to/vg path/to/pv/in/vg
vgremove /path/to/vg


I have to remove physical volume (/dev/vda3) from the volume group before I can delete the volume group, vgdata.
But I am not able to find vgdata's path!

NOTE: At this point a logical volume has not been created yet!


Thank you.

Last edited by fanoflq; 07-26-2016 at 02:15 PM.
 
Old 07-26-2016, 06:32 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
You have to remove the VG first then the PV

vgremove vgdata # remove volume group
pvremove /dev/vda3 # remove physical volume
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LVM Mount Physical Volume/Logical Volume without a working Volume Group mpivintis Linux - Newbie 10 01-11-2014 07:02 AM
Extended LVM Volume group and Logical Volume. But space not usable linuxlover.chaitanya Linux - Server 1 11-19-2012 09:37 AM
I have spce in volume group but it can not increase the size of logical volume anis123 Linux - Newbie 14 04-16-2012 06:23 AM
[SOLVED] Redhat volume group,logical volume group dhairysheel Red Hat 3 08-02-2011 05:07 AM
Creating mirrored logical volumes from a Volume Group. balajmohan Linux - Server 0 11-19-2009 07:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration