LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-16-2011, 09:53 AM   #1
klompie
LQ Newbie
 
Registered: Jun 2011
Posts: 4

Rep: Reputation: Disabled
vgreduce LMV


I have installed Fedora 15 on my laptop a couple of days ago, but now i want to install windows next to it.
T do this i have to resize the lvm partition.

Using a live disk, I used this post as guide:
http://www.linuxquestions.org/questi...6/#post2784317

But at the final step (vgreduce) i get this message:
Physical volume "/dev/sda2" still in use

What now? Can someone help me reducing the size of my lvm partition?

Some info:
Code:
[root@Rene-Fedora rene]# vgs
  VG            #PV #LV #SN Attr   VSize   VFree  
  vg_renefedora   1   3   0 wz--n- 465,25g 334,38g
[root@Rene-Fedora rene]# lvs
  LV      VG            Attr   LSize  Origin Snap%  Move Log Copy%  Convert
  lv_home vg_renefedora -wi-ao 75,00g                                      
  lv_root vg_renefedora -wi-ao 50,00g                                      
  lv_swap vg_renefedora -wi-ao  5,88g                                      
[root@Rene-Fedora rene]# pvs
  PV         VG            Fmt  Attr PSize   PFree  
  /dev/sda2  vg_renefedora lvm2 a-   465,25g 334,38g
[root@Rene-Fedora rene]#
Code:
[root@localhost liveuser]# swapoff -a
[root@localhost liveuser]# vgreduce vg_renefedora -a
  Physical volume "/dev/sda2" still in use
 
Old 06-16-2011, 12:52 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
vgreduce does NOT resize a PV it - removes it. Since sda2 is the only PV in your VG you can not reduce it. At this point you can "vgremove" to remove the entire volume group if that is your intent.

If your intent is to resize the VG rather than remove it you can use the pvresize command which will allow you to shrink the size of the PV on sda2 then you can use fdisk or parted to resize the partition on /dev/sda.

If you type "man pvresize" it gives you some good information.
 
Old 06-16-2011, 03:21 PM   #3
klompie
LQ Newbie
 
Registered: Jun 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
When using pvresize i get this message:
Code:
[root@Rene-Fedora rene]# pvresize --setphysicalvolumesize 131G /dev/sda2
  /dev/sda2: cannot resize to 4191 extents as later ones are allocated.
  0 physical volume(s) resized / 1 physical volume(s) not resized

Last edited by klompie; 06-16-2011 at 03:27 PM.
 
Old 06-17-2011, 12:54 AM   #4
klompie
LQ Newbie
 
Registered: Jun 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
So i found out that lv_home and lv_swap are at the beginning of the pv and lv_root at the end. SO how do i move the lv_root on the pv so i get the free space at the and?
 
Old 06-17-2011, 08:59 AM   #5
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Haven't done this. From research it appears moving extents with the same PV can be done on the same disk using "pvmove --alloc" with additional flags. (Do a web search for that in quotes as shown and you'll get lots of hits.) I can't give any guidance as I haven't done that but it appears others have. I've seen it suggested that "pvmove --alloc anywhere" would do it but the "anywhere" makes me think you couldn't be sure where the extents would end up.

You could for this purpose get rid of the swap completely then add it back after the resize is all done by using swapoff to remove your swap usage on the system. (man swapoff). You'd then do an lvremove to remove the swap LV. That will free up the space at the front of the PV which might make your pvmove --alloc move other extents to the front.

***WARNING***
As noted I haven't done the above - try it at your own risk. You should definitely have a full backup before attempting this.
***WARNING***
 
Old 06-17-2011, 09:07 AM   #6
klompie
LQ Newbie
 
Registered: Jun 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
I found this when searching for it:
http://www.linuxquestions.org/questi...-in-it-765047/

Looks promising. Will try this when i get home.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] question about LMV griffinwebnet Linux - General 3 03-09-2011 03:12 PM
LMV on 200 student computers that has run out of room in VMWare? cafetono Fedora 4 02-24-2009 08:13 AM
LMV on 200 student computers that has run out of room in VMWare? cafetono Fedora 2 02-24-2009 08:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:54 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