[linux-lvm] How to convert a single path to a multipath after using dm-multipath
yezhiyong at bytedance.com
Tue Apr 11 05:29:42 UTC 2023
Dm-multipath (multipath-tools in the user-space) provides powerful
multipathing capabilities to aggregate multiple paths from the same
storage backend into a single disk device. However, it is difficult to
extend single paths into multipaths when LVM is already in use.
I used two physical machines to set up the POC environment for testing,
with one physical machine acting as the storage iscsi multipath server,
setting up the same LUN to have two paths to access. Another physical
machine acts as the iscsi client, first using a single path (/dev/sda)
and creating vg and lv on it. I then turn on the multipath function and
merge the two paths into a new device (/dev/mapper/matha), and I get the
following error when I execute the lvm command.
WARNING: Not using device /dev/mapper/matha for PV
WARNING: PV HgL3xR-qTio-m75Q-nGAO-Un0U-8uHk-wHbH25 prefers device
/dev/sda because device is used by LV.
PV VG Fmt Attr PSize PFree
/dev/sda is-he57e6mr4wemb19kgf8i lvm2 a-- 10.00t 9.98t
To be able to use the multipathing capability, I tried to convert the
device from pv to matha using vgimportclone, but it failed since both
sda and matha were pointing to the same iscsi storage backend.
May you please advise how one can convert the pv used by vg from sda to
matha without affecting the current lv usage.
More information about the linux-lvm