Re: (resend) may bug: lvconvert reports "Insufficient free space" when doing "--replace"

Heinz Mauelshagen <[email protected]>
Newsgroups gmane.linux.lvm.general
Message-ID <CAM23VxpwpJ+dkYtWgufVrv1ryx802Dygd1b5qYp-QDrwL-xiRQ@mail.gmail.com>
Hemng,

'lvconvert --replace ..." reports the new PV does  not have enough space
(89 needed/49 available) to suit full replacement and rejects as
replacement requires complete SubLVs to move off respective PVs.

Check lsblk (or lvs -ao+devices) after the pvmove to confirm a partial move
across resulting remaining allocations for leg 0 on /dev/sdh, i.e no
replacement

Use a larger PV to be able to replace.

Best,
Heinz

On Mon, Nov 8, 2021 at 7:46 AM [email protected] <[email protected]>
wrote:

> (I sent this mail some days before, it looks this mail was blocked by
> anti-spam system. resend it)
>
> Hello list,
>
> I may found a bug, when lv is raid1, and each leg includes more than one
> PV.
>
> When doing "lvconvert --replace" to replace one of the oldpv with a newpv,
> It looks lvconvert requires full raid array size for a single newpv.
>
> lvm version: 2.03.12, Reproducible steps:
>
> ```
> # vgcreate vg1 /dev/sdg /dev/sdh
>    Volume group "vg1" successfully created
>
> # lvcreate -n lv1 -l 90%FREE vg1
>    Logical volume "lv1" created.
>
> # vgextend vg1 /dev/sdj /dev/sdk
>    Physical volume "/dev/sdj" successfully created.
>    Physical volume "/dev/sdk" successfully created.
>    Volume group "vg1" successfully extended
>
> # lvconvert --type raid1 vg1/lv1 /dev/sdg /dev/sdh /dev/sdj /dev/sdk
> Are you sure you want to convert linear LV vg1/lv1 to raid1 type? [y/n]: y
>    Logical volume vg1/lv1 successfully converted.
>
> # lsblk
> NAME               MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
> sdg                  8:96   0  200M  0 disk
> └─vg1-lv1_rimage_0 254:4    0  352M  0 lvm
>    └─vg1-lv1        254:2    0  352M  0 lvm
> sdh                  8:112  0  200M  0 disk
> ├─vg1-lv1_rmeta_0  254:3    0    4M  0 lvm
> │ └─vg1-lv1        254:2    0  352M  0 lvm
> └─vg1-lv1_rimage_0 254:4    0  352M  0 lvm
>    └─vg1-lv1        254:2    0  352M  0 lvm
> sdi                  8:128  0  200M  0 disk
> sdj                  8:144  0  200M  0 disk
> ├─vg1-lv1_rmeta_1  254:5    0    4M  0 lvm
> │ └─vg1-lv1        254:2    0  352M  0 lvm
> └─vg1-lv1_rimage_1 254:6    0  352M  0 lvm
>    └─vg1-lv1        254:2    0  352M  0 lvm
> sdk                  8:160  0  200M  0 disk
> └─vg1-lv1_rimage_1 254:6    0  352M  0 lvm
>    └─vg1-lv1        254:2    0  352M  0 lvm
> sdl                  8:176  0  200M  0 disk
>
> # vgextend vg1 /dev/sdi
>    Volume group "vg1" successfully extended
>
> # lvconvert --replace /dev/sdh vg1/lv1 /dev/sdi  (<=== failed, should
> succeed)
>    Insufficient free space: 89 extents needed, but only 49 available
>    LV vg1/lv1 in not partial.
>
> # lvconvert --replace /dev/sdg vg1/lv1 /dev/sdi   (<=== failed, should
> succeed)
>    Insufficient free space: 89 extents needed, but only 49 available
>    LV vg1/lv1 in not partial.
>
> # pvmove /dev/sdh /dev/sdi
>    /dev/sdh: Moved: 2.50%
>    /dev/sdh: Moved: 100.00%
> ```
>
> pvmove is workable, but I think it's a work around.
> lvconvert should run successfully with above cmds.
>
> Thanks,
> Heming
>
>
> _______________________________________________
> linux-lvm mailing list
> [email protected]
> https://listman.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

_______________________________________________
linux-lvm mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.