From: Zdenek Kabelac <zkabelac@redhat.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] Shrinking LVM partition at beginning
Date: Sat, 9 Apr 2016 19:52:07 +0200 [thread overview]
Message-ID: <57094147.202@redhat.com> (raw)
In-Reply-To: <20160409101245.GB31040@nicku.org>
Dne 9.4.2016 v 12:12 Nick Urbanik napsal(a):
> Dear Folks,
>
> I want to shrink an LVM partition and expand a preceding, non-LVM
> partition. The LVM partition contains three logical volumes. I
> shrank the larger, middle home volume at the volume's end successfully
> with a command something like this:
>
> sudo lvresize --verbose --resizefs -L -40G /dev/fedora/home
>
> and then used pvmove to move all the pysical extents towards the end
> of the disk, using some commands something like this:
>
> sudo pvmove --alloc anywhere /dev/sda6:24387-34626 /dev/sda6:34627-44866
>
> until all the extents are towards the end of the disk, and there are
> 10240 unused at the beginning of the volume.
>
> So: can anyone suggest how I can shrink the volume group by that 10240
> physical extents, so that I can shrink the partition, and expand the
> previous partition?
Hi
Unsupported - requires very good understanding about lvm2 metadata format
and very good precision in all calculations if you would do it by hand...
Basically you need to recreate PV header at different position,
and recompute all 'PV' extents in use.
IMHO easiest&safest for a normal user is to just 'copy' disk elsewhere,
reformat with new layout and copy data back (yeah - takes some time,
but with significantly less probability of data loose...)
lvm2 is not meant to be used with other volume manager (like partitions)
so do not expect it will support such sort of operations...
Regards
Zdenek
next prev parent reply other threads:[~2016-04-09 17:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-09 10:12 [linux-lvm] Shrinking LVM partition at beginning Nick Urbanik
2016-04-09 17:52 ` Zdenek Kabelac [this message]
2016-04-09 23:45 ` Alasdair G Kergon
2016-04-09 23:19 ` Alasdair G Kergon
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=57094147.202@redhat.com \
--to=zkabelac@redhat.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).