From: Roland <devzero@web.de>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: [linux-lvm] bug? shrink lv by specifying pv extent to be removed does not behave as expected
Date: Sun, 9 Apr 2023 17:05:18 +0200 [thread overview]
Message-ID: <4649980a-7af2-5b2e-47de-ce88ccb8ac6f@web.de> (raw)
hi,
we can extend a logical volume by arbitrary pv extends like this :
root@s740:~# lvresize mytestVG/blocks_allocated -l +1 /dev/sdb:5
Size of logical volume mytestVG/blocks_allocated changed from 1.00
MiB (1 extents) to 2.00 MiB (2 extents).
Logical volume mytestVG/blocks_allocated successfully resized.
root@s740:~# lvresize mytestVG/blocks_allocated -l +1 /dev/sdb:10
Size of logical volume mytestVG/blocks_allocated changed from 2.00
MiB (2 extents) to 3.00 MiB (3 extents).
Logical volume mytestVG/blocks_allocated successfully resized.
root@s740:~# lvresize mytestVG/blocks_allocated -l +1 /dev/sdb:15
Size of logical volume mytestVG/blocks_allocated changed from 3.00
MiB (3 extents) to 4.00 MiB (4 extents).
Logical volume mytestVG/blocks_allocated successfully resized.
root@s740:~# lvresize mytestVG/blocks_allocated -l +1 /dev/sdb:20
Size of logical volume mytestVG/blocks_allocated changed from 4.00
MiB (4 extents) to 5.00 MiB (5 extents).
Logical volume mytestVG/blocks_allocated successfully resized.
root@s740:~# pvs --segments
-olv_name,seg_start_pe,seg_size_pe,pvseg_start -O pvseg_start
LV Start SSize Start
blocks_allocated 0 1 0
0 4 1
blocks_allocated 1 1 5
0 4 6
blocks_allocated 2 1 10
0 4 11
blocks_allocated 3 1 15
0 4 16
blocks_allocated 4 1 20
0 476917 21
how can i do this in reverse ?
when i specify the physical extend to be added, it works - but when is
specifcy the physical extent to be removed,
the last one is being removed but not the specified one.
see here for example - i wanted to remove extent number 10 like i did
add it, but instead extent number 20
is being removed
root@s740:~# lvresize mytestVG/blocks_allocated -l -1 /dev/sdb:10
Ignoring PVs on command line when reducing.
WARNING: Reducing active logical volume to 4.00 MiB.
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce mytestVG/blocks_allocated? [y/n]: y
Size of logical volume mytestVG/blocks_allocated changed from 5.00
MiB (5 extents) to 4.00 MiB (4 extents).
Logical volume mytestVG/blocks_allocated successfully resized.
root@s740:~# pvs --segments
-olv_name,seg_start_pe,seg_size_pe,pvseg_start -O pvseg_start
LV Start SSize Start
blocks_allocated 0 1 0
0 4 1
blocks_allocated 1 1 5
0 4 6
blocks_allocated 2 1 10
0 4 11
blocks_allocated 3 1 15
0 476922 16
how can i remove extent number 10 ?
is this a bug ?
regards
roland
_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
next reply other threads:[~2023-04-09 15:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-09 15:05 Roland [this message]
2023-04-09 17:32 ` [linux-lvm] bug? shrink lv by specifying pv extent to be removed does not behave as expected Roger Heflin
2023-04-09 18:21 ` Roland
2023-04-09 18:53 ` Roger Heflin
2023-04-09 22:04 ` Roland
2023-04-09 23:50 ` Stuart D Gathman
2023-04-12 10:20 ` Zdenek Kabelac
2023-04-12 11:51 ` Roberto Fastec
2023-04-12 12:37 ` Roland
2023-04-12 13:16 ` Zdenek Kabelac
2023-04-12 13:53 ` Roberto Fastec
[not found] <1043528017.520337.1681071486811.ref@mail.yahoo.com>
2023-04-09 20:18 ` matthew patton
2023-04-11 7:14 ` Roland
2023-04-12 9:24 ` Roberto Fastec
2023-04-12 9:28 ` Roberto Fastec
2023-04-11 17:05 ` Roger Heflin
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=4649980a-7af2-5b2e-47de-ce88ccb8ac6f@web.de \
--to=devzero@web.de \
--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 read-only IMAP folder(s) and NNTP newsgroup(s).