linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: "heming.zhao@suse.com" <heming.zhao@suse.com>
To: LVM general discussion and development <linux-lvm@redhat.com>,
	Heinz Mauelshagen <heinzm@redhat.com>
Cc: David Teigland <teigland@redhat.com>,
	Zdenek Kabelac <zkabelac@redhat.com>
Subject: Re: [linux-lvm] (resend) may bug: lvconvert reports "Insufficient free space" when doing "--replace"
Date: Mon, 22 Nov 2021 15:52:12 +0800	[thread overview]
Message-ID: <52537da1-3533-7ae0-ce1a-315e64bc1b11@suse.com> (raw)
In-Reply-To: <CAM23VxpwpJ+dkYtWgufVrv1ryx802Dygd1b5qYp-QDrwL-xiRQ@mail.gmail.com>

Hi Heinz,

On 11/19/21 02:18, Heinz Mauelshagen wrote:
> Hemng,

heming, not 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
> 

pvmove can do the replace job, output from the same env.
(you could set up a env to reproduce this issue)

```
# pvmove /dev/sdh /dev/sdi

   /dev/sdh: Moved: 2.50%

   /dev/sdh: Moved: 100.00%

# 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

sdi                  8:128  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

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



# lvs -ao+devices

   LV             VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices

   root           system -wi-ao----  35.00g                                                     /dev/vda2(512)

   swap           system -wi-ao----   2.00g                                                     /dev/vda2(0)

   lv1            vg1    rwi-a-r--- 352.00m                                    100.00           lv1_rimage_0(0),lv1_rimage_1(0)

   [lv1_rimage_0] vg1    iwi-aor--- 352.00m                                                     /dev/sdg(0)

   [lv1_rimage_0] vg1    iwi-aor--- 352.00m                                                     /dev/sdi(1)

   [lv1_rimage_1] vg1    iwi-aor--- 352.00m                                                     /dev/sdj(1)

   [lv1_rimage_1] vg1    iwi-aor--- 352.00m                                                     /dev/sdk(0)

   [lv1_rmeta_0]  vg1    ewi-aor---   4.00m                                                     /dev/sdi(0)

   [lv1_rmeta_1]  vg1    ewi-aor---   4.00m                                                     /dev/sdj(0)
```

> Use a larger PV to be able to replace.

In my view, this is a bug.
Or man page should point out lvconvert doesn't have ability to move partial PV dev(s).

> 
> Best,
> Heinz
> 
> On Mon, Nov 8, 2021 at 7:46 AM heming.zhao@suse.com <mailto:heming.zhao@suse.com> <heming.zhao@suse.com <mailto:heming.zhao@suse.com>> 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
>     linux-lvm@redhat.com <mailto:linux-lvm@redhat.com>
>     https://listman.redhat.com/mailman/listinfo/linux-lvm <https://listman.redhat.com/mailman/listinfo/linux-lvm>
>     read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/ <http://tldp.org/HOWTO/LVM-HOWTO/>
> 
> 
> _______________________________________________
> 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/
> 


_______________________________________________
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/

      reply	other threads:[~2021-11-23  7:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04 12:44 [linux-lvm] " heming.zhao
2021-11-07  8:08 ` [linux-lvm] (resend) " heming.zhao
2021-11-18 18:18   ` Heinz Mauelshagen
2021-11-22  7:52     ` heming.zhao [this message]

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=52537da1-3533-7ae0-ce1a-315e64bc1b11@suse.com \
    --to=heming.zhao@suse.com \
    --cc=heinzm@redhat.com \
    --cc=linux-lvm@redhat.com \
    --cc=teigland@redhat.com \
    --cc=zkabelac@redhat.com \
    --subject='Re: [linux-lvm] (resend) may bug: lvconvert reports "Insufficient free space" when doing "--replace"' \
    /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

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).