linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: David Teigland <teigland@redhat.com>
To: Zhiyong Ye <yezhiyong@bytedance.com>
Cc: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] How to convert a single path to a multipath after using dm-multipath
Date: Thu, 13 Apr 2023 15:28:59 -0500	[thread overview]
Message-ID: <20230413202859.GC15123@redhat.com> (raw)
In-Reply-To: <e318740a-bb17-8e38-ed3f-f1776292b47c@bytedance.com>

On Wed, Apr 12, 2023 at 05:16:41PM +0800, Zhiyong Ye wrote:
> configure mpath on sda alone on the current stock of machines. And I tested
> this in my environment using lvchange --refresh, but it doesn't switch the
> active LV to use mpatha.

It seems to work for me with the latest version of lvm, which may be due
to improved multipath component detection and/or improved handling of
duplicate PVs.  So the current upstream code might work for you also.

# pvs
  PV         VG           Fmt  Attr PSize    PFree   
  /dev/sdf   ff           lvm2 a--  <931.01g <930.76g

# lvs -o+devices 
  LV    VG           Attr       LSize    Origin Devices                      
  lvol1 ff           -wi-ao----  256.00m        /dev/sdf(1)                  

# mount | grep ff
/dev/mapper/ff-lvol1 on /mnt type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)

# multipath -a /dev/sdf
wwid '3690b11c0000438ad0000057150910423' added

# multipath -l
mpatha (3690b11c0000438ad0000057150910423) dm-4 DELL,MD32xxi
size=931G features='2 pg_init_retries 50' hwhandler='1 rdac' wp=rw
`-+- policy='service-time 0' prio=0 status=active
  `- 7:0:0:4 sdf 8:80 active undef running

# pvs
  WARNING: Device mismatch detected for ff/lvol1 which is accessing /dev/sdf instead of /dev/mapper/mpatha.
  PV                 VG           Fmt  Attr PSize    PFree   
  /dev/mapper/mpatha ff           lvm2 a--  <931.01g <930.76g

# lvs ff
  WARNING: Device mismatch detected for ff/lvol1 which is accessing /dev/sdf instead of /dev/mapper/mpatha.
  LV    VG Attr       LSize   
  lvol1 ff -wi-ao---- 256.00m

# dmsetup table ff-lvol1
0 524288 linear 8:80 10240

# lvchange --refresh ff/lvol1

# dmsetup table ff-lvol1
0 524288 linear 253:4 10240

# pvs
  PV                 VG           Fmt  Attr PSize    PFree   
  /dev/mapper/mpatha ff           lvm2 a--  <931.01g <930.76g

# lvs -o+devices ff
  LV    VG Attr       LSize   Devices              
  lvol1 ff -wi-ao---- 256.00m /dev/mapper/mpatha(1)

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


  parent reply	other threads:[~2023-04-13 20:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11  5:29 [linux-lvm] How to convert a single path to a multipath after using dm-multipath Zhiyong Ye
2023-04-11 13:31 ` David Teigland
2023-04-12  9:16   ` Zhiyong Ye
2023-04-13 10:54     ` Giorgio Bersano
2023-04-14  3:48       ` Zhiyong Ye
2023-04-13 20:28     ` David Teigland [this message]
2023-04-14  3:55       ` Zhiyong Ye

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=20230413202859.GC15123@redhat.com \
    --to=teigland@redhat.com \
    --cc=linux-lvm@redhat.com \
    --cc=yezhiyong@bytedance.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).