linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Malahal Naineni <malahal@us.ibm.com>
To: linux-lvm@redhat.com
Subject: Re: [linux-lvm] shrink VG and PV
Date: Mon, 17 May 2010 13:56:07 -0700	[thread overview]
Message-ID: <20100517205607.GA4589@us.ibm.com> (raw)
In-Reply-To: <AANLkTina1csDn1EAcwXOYM41r7G3TOZBSAo1lVk0tU5N@mail.gmail.com>

Dael Elcar [kanonmatswe@gmail.com] wrote:
>    My system is archlinux i386. lvm version 2.02.62(1) (2010-03-09)
>    I'd like to shrink a partition with lvm on it. Can this be done? In order
>    to shrink it I need to reduce the size of the PV, right? I have
>    successfully removed an LV (from the end on the VG) and there is no
>    mention of it with lvdisplay or in the file i get with vgcfgbackup. I
>    think the next step is to reduce the size of the VG and remove the now
>    unallocated 3884 PEs from it. I can't find a command for that. I have
>    tried pvresize. How do I solve the problem with "metadata areas"?
>    vgdisplay says VG Status is "resizable".

You will need to resize the PV and that would automatically reduce the
VG size. That is why you don't find a command to resize VG.

>    pvresize /dev/sda2 --test --setphysicalvolumesize 49256M
>    Test mode: Metadata will NOT be updated.
>    /dev/sda2: too many metadata areas for pvresize
>    0 physical volume(s) resized / 1 physical volume(s) not resized
> 
>    vgdisplay
>    --- Volume group ---
>    VG Name nonxpvg
>    System ID
>    Format lvm2
>    Metadata Areas 2

Looks like you have 2 copies of metadata (one at the front and another
one at the end of the PV). Resize on this PV is not supported. Here is
what I see from 'man pvresize':

	"pvresize  won't  currently  work  correctly on LVM1 volumes or
	PVs with extra metadata areas."

Unfortunately, there is no easy way to reduce the metadata copies,
resize and add another copy as you have now.

Thanks, Malahal.

  reply	other threads:[~2010-05-17 20:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-17 19:44 [linux-lvm] shrink VG and PV Dael Elcar
2010-05-17 20:56 ` Malahal Naineni [this message]
2010-05-17 21:14 ` Malahal Naineni
2010-05-17 21:30   ` Stuart D. Gathman
2010-05-18  5:29     ` kanonmatswe
2010-05-18  9:13       ` Bryn M. Reeves
2010-05-18  9:38         ` Bryn M. Reeves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100517205607.GA4589@us.ibm.com \
    --to=malahal@us.ibm.com \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).