LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 06-09-2009, 05:34 AM   #1
devkpict
Member
 
Registered: Oct 2007
Posts: 31

Rep: Reputation: 15
Free space shown for VG is wrong LVM2 bug


I have a vg with four PV's, I de-allocated all four PV's
still vgdisplay shows me complete vg size as Free

Is there any other way to exactly find out free VG size
which can be allocated after deallocating PV's
 
Old 06-09-2009, 08:34 AM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,974
Blog Entries: 5

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
How exactly did you "deallocate"? Did you vgreduce the disks so that LVM knows they should no longer be considered?

If you did vgreduce why didn't you vgremove when done given that the VG no longer has any PVs?
 
Old 06-09-2009, 08:41 AM   #3
devkpict
Member
 
Registered: Oct 2007
Posts: 31

Original Poster
Rep: Reputation: 15
Used pvchange -xn PVNAME
 
Old 06-09-2009, 08:56 AM   #4
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,974
Blog Entries: 5

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
That changes the status of the PV but doesn't tell the VG to which it was already added that it is no longer available. You need to use vgreduce for that.
 
Old 06-09-2009, 09:20 AM   #5
devkpict
Member
 
Registered: Oct 2007
Posts: 31

Original Poster
Rep: Reputation: 15
Ok,Is there any provision we can update the VG.
So that it will show updated information.
I want to keep those PV's disabled for some time
 
Old 06-09-2009, 09:35 AM   #6
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,974
Blog Entries: 5

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
vgreduce them from the VG - you can use vgextend later if you decide to add them back (of course you'll first have to undo the pvchange -xn to add them back).
 
Old 06-10-2009, 01:43 AM   #7
devkpict
Member
 
Registered: Oct 2007
Posts: 31

Original Poster
Rep: Reputation: 15
I am working on displaying VG information,It
will be great If I can display updated VG information

I have a query,when we create LV or add new PV,or delete lv
its information gets updated in vgdisplay's output, then why not
deallocation of a pv.

I think its LVM2 bug.

Please give your valuable comments
 
Old 06-10-2009, 08:40 AM   #8
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,974
Blog Entries: 5

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
You are misunderstanding the relationship of things in LVM.

Essentially you build by:
pvcreate ---> vgcreate --->lvcreate

You are trying to undo the top of that flow and wondering why the the middle doesn't realize you did it. The fact is it WILL "realize" it by giving you an error once you try to use the deallocated extents on the PV. Until then it has no reason to assume you've done something foolish.

You choose to do things the wrong way and then proclaim it a bug that it doesn't immediately make you pay for the mistake. It would be a bit like building your house on a beach that is being eroded by wave action. The house is still a house until that critical moment you need to rely on the part of the foundation that is now sitting on nothing solid. This is something that doesn't occur instantaneously just because some of the foundation is missing but rather at the point when something puts pressure on that missing foundation.
 
Old 06-10-2009, 10:20 AM   #9
devkpict
Member
 
Registered: Oct 2007
Posts: 31

Original Poster
Rep: Reputation: 15
But If I add PV later,extending already creted VG,
Then also VG information gets updated showing added new PV.
then why not in deallocating PV case.
 
Old 06-10-2009, 10:33 AM   #10
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,974
Blog Entries: 5

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
Because in the latter you are doing vgextend to tell the middle you added a new PV. Simply running pvcreate does NOT add it to the VG.

pvcreate--->vgextend (instead of vgcreate) --->lvcreate (or lvextend).

While each level is dependent on the level before it changes to the level before it might not have an immediate effect as it is not the expected way of doing things.

Last edited by MensaWater; 06-10-2009 at 10:54 AM.
 
Old 06-11-2009, 02:17 AM   #11
devkpict
Member
 
Registered: Oct 2007
Posts: 31

Original Poster
Rep: Reputation: 15
I agree with you thanks a lot.

But why LVM doesent allow me to disable
one of the PV's from vgcommand
like vgchange etc.
which will update vg information.

The problem is VG shows a free space and when I try
creating LV on this free space gives error physical
extents not available.As PV's are already disabled
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Wrong disk free space (VERY wrong) macrojd Linux - Server 12 05-17-2009 02:14 AM
What is wrong with reiserfs? wrong free space mesh2005 Linux - General 1 05-03-2007 07:21 AM
After lvextend wrong free space epiphiny Fedora 4 11-19-2006 03:09 PM
Wrong Size of free disk space ALInux Linux - General 1 04-03-2006 04:22 AM
'df -h' showing wrong free space on disk? Cdzin Slackware 4 03-16-2006 01:35 PM


All times are GMT -5. The time now is 05:15 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration