From: Nick Urbanik <nicku@nicku.org>
To: linux-lvm@redhat.com
Subject: [linux-lvm] Shrinking LVM partition at beginning
Date: Sat, 9 Apr 2016 20:12:46 +1000 [thread overview]
Message-ID: <20160409101245.GB31040@nicku.org> (raw)
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?
Here are some details:
Fedora 23, i686, MBR partitioning.
[liveuser@samsung ~]$ sudo lvdisplay -m
--- Logical volume ---
LV Path /dev/fedora/root
LV Name root
VG Name fedora
LV UUID C3JJJ0-L7dR-6kLJ-xj4U-zUn2-i9tY-bexbV1
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2013-10-20 18:39:46 -0400
LV Status available
# open 0
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:3
--- Segments ---
Logical extents 0 to 12799:
Type linear
Physical volume /dev/sda6
Physical extents 10240 to 23039
--- Logical volume ---
LV Path /dev/fedora/home
LV Name home
VG Name fedora
LV UUID lHnoBw-pzJn-jCkZ-JaZ3-evAb-RisG-N22ErF
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2013-10-20 18:39:51 -0400
LV Status available
# open 0
LV Size 85.26 GiB
Current LE 21827
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:4
--- Segments ---
Logical extents 0 to 21826:
Type linear
Physical volume /dev/sda6
Physical extents 23040 to 44866
--- Logical volume ---
LV Path /dev/fedora/swap
LV Name swap
VG Name fedora
LV UUID HL6UPR-Z5AK-Oa6a-X9kZ-1wn0-j3Mn-w3avH9
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2013-10-20 18:39:56 -0400
LV Status available
# open 2
LV Size 2.03 GiB
Current LE 520
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:5
--- Segments ---
Logical extents 0 to 519:
Type linear
Physical volume /dev/sda6
Physical extents 44867 to 45386
[liveuser@samsung ~]$ sudo vgdisplay
--- Volume group ---
VG Name fedora
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 28
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 177.29 GiB
PE Size 4.00 MiB
Total PE 45387
Alloc PE / Size 35147 / 137.29 GiB
Free PE / Size 10240 / 40.00 GiB
VG UUID gAbhli-WPRu-ZOkx-nAbl-lPCD-An7E-uEmhO6
Any suggestions gratefully received.
--
Nick Urbanik http://nicku.org nicku@nicku.org
GPG: 7FFA CDC7 5A77 0558 DC7A 790A 16DF EC5B BB9D 2C24 ID: BB9D2C24
next reply other threads:[~2016-04-09 10:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-09 10:12 Nick Urbanik [this message]
2016-04-09 17:52 ` [linux-lvm] Shrinking LVM partition at beginning Zdenek Kabelac
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=20160409101245.GB31040@nicku.org \
--to=nicku@nicku.org \
--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).