Re: Migration of disks within a clustered LVM2 volume group

David Teigland <[email protected]> Tue, 25 Feb 2025 10:48:05 -0600
Newsgroups gmane.linux.lvm.devel
Message-ID <[email protected]>
On Tue, Feb 25, 2025 at 12:01:30PM +0000, SCOTT FIELDS wrote:
> It has been stated that mirroring is deprecated in clustered LVM2 configurations and currently unsupported.
> 
> To migrate a physical volume to a new physical volume requires the volume group to be brought into a non-clustered state to perform the migration. Afterwards, it can be brought back into a clustered state, post migration.
> 
> Is there any alternative, since doing so is disruptive twice, and counter to it being a clustered system.

Hi, you can move each LV that is using the given PV, e.g.

$ pvs
  PV           VG Fmt  Attr PSize    PFree   
  /dev/nvme0n1 vg lvm2 a--  1020.00m  732.00m
  /dev/nvme1n1 vg lvm2 a--  1020.00m 1020.00m
  /dev/nvme2n1 vg lvm2 a--  1020.00m  988.00m
  /dev/nvme3n1 vg lvm2 a--  1020.00m 1020.00m

$ pvmove /dev/nvme2n1 /dev/nvme3n1
  pvmove in a shared VG requires a named LV.

$ lvs -o+devices vg
  LV VG Attr       LSize  Devices                         
  lv vg -wi-a----- 64.00m /dev/nvme0n1(64),/dev/nvme2n1(0)

$ pvmove -n lv /dev/nvme2n1 /dev/nvme3n1
  /dev/nvme2n1: Moved: 100.00%

$ lvs -o+devices vg
  LV       VG Attr       LSize  Devices                         
  lv vg -wi-a----- 64.00m /dev/nvme0n1(64),/dev/nvme3n1(0)