All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Problems resizing physical volume
@ 2010-04-14  9:42 Avi Kivity
  2010-04-14 14:47 ` Phillip Susi
  0 siblings, 1 reply; 11+ messages in thread
From: Avi Kivity @ 2010-04-14  9:42 UTC (permalink / raw)
  To: linux-lvm

(resending, first try didn't seem to make it to the archives)

Due to dracut creating huge initrds, I now need a larger /boot.  So I'd 
like to reduce my lvm physical volume on the same disk in order to make 
room.

However, lvm doesn't want me to:

> lvm> pvs
>   PV         VG   Fmt  Attr PSize   PFree
>   /dev/sda2  vg0  lvm2 a-   148.94G 10.00G

Seems I have enough room.

> lvm> pvresize --setphysicalvolumesize 148.54G /dev/sda2
>   /dev/sda2: cannot resize to 4753 extents as later ones are allocated.
>   0 physical volume(s) resized / 1 physical volume(s) not resized

So it seems lvm wants me to move the data around instead of doing it by 
itself.  What did I do (besides not reading the manual)?

Let's find a new home for the data:

> [root@violet-regb ~]# pvs --segments
>   PV         VG   Fmt  Attr PSize   PFree  Start SSize
>   /dev/sda2  vg0  lvm2 a-   148.94G 10.00G     0   480
>   /dev/sda2  vg0  lvm2 a-   148.94G 10.00G   480   192
>   /dev/sda2  vg0  lvm2 a-   148.94G 10.00G   672   320
>   /dev/sda2  vg0  lvm2 a-   148.94G 10.00G   992   320
>   /dev/sda2  vg0  lvm2 a-   148.94G 10.00G  1312   320
>   /dev/sda2  vg0  lvm2 a-   148.94G 10.00G  1632  2560
>   /dev/sda2  vg0  lvm2 a-   148.94G 10.00G  4192   128
>   /dev/sda2  vg0  lvm2 a-   148.94G 10.00G  4320    64
>   /dev/sda2  vg0  lvm2 a-   148.94G 10.00G  4384   320
>   /dev/sda2  vg0  lvm2 a-   148.94G 10.00G  4704    62

Looks like all extents are already allocated (that's the 'a', right?). 
But it claims that 10G are free!  And sure, if I create a new volume, 
space is found at extent 4384:

> [root@violet-regb ~]# lvcreate -L 1G -n new vg0
>   Logical volume "new" created
> [root@violet-regb ~]# pvs --segments
>   PV         VG   Fmt  Attr PSize   PFree Start SSize
>   /dev/sda2  vg0  lvm2 a-   148.94G 9.00G     0   480
>   /dev/sda2  vg0  lvm2 a-   148.94G 9.00G   480   192
>   /dev/sda2  vg0  lvm2 a-   148.94G 9.00G   672   320
>   /dev/sda2  vg0  lvm2 a-   148.94G 9.00G   992   320
>   /dev/sda2  vg0  lvm2 a-   148.94G 9.00G  1312   320
>   /dev/sda2  vg0  lvm2 a-   148.94G 9.00G  1632  2560
>   /dev/sda2  vg0  lvm2 a-   148.94G 9.00G  4192   128
>   /dev/sda2  vg0  lvm2 a-   148.94G 9.00G  4320    64
>   /dev/sda2  vg0  lvm2 a-   148.94G 9.00G  4384    32
>   /dev/sda2  vg0  lvm2 a-   148.94G 9.00G  4416   288
>   /dev/sda2  vg0  lvm2 a-   148.94G 9.00G  4704    62

32 extents, 32MB each = 1GB.  Let's move the 62 extents at the end manually:

> [root@violet-regb ~]# lvremove vg0/new
> Do you really want to remove active logical volume new? [y/n]: y
>   Logical volume "new" successfully removed
> [root@violet-regb ~]# pvmove /dev/sda2:4704-4765 /dev/sda2:4384-4445
>   No extents available for allocation

At this point I gave up.  Is there any way to accomplish this?

-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-04-24  1:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-14  9:42 [linux-lvm] Problems resizing physical volume Avi Kivity
2010-04-14 14:47 ` Phillip Susi
2010-04-14 14:59   ` Avi Kivity
2010-04-14 15:04     ` Avi Kivity
2010-04-14 15:14     ` Phillip Susi
2010-04-14 20:05   ` Stuart D. Gathman
2010-04-14 21:12     ` Phillip Susi
2010-04-14 21:28       ` Alasdair G Kergon
2010-04-14 21:57         ` Stuart D. Gathman
2010-04-14 22:27           ` Alasdair G Kergon
2010-04-24  1:39   ` Ron Johnson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.