I have a logical volume spanning several drives. One of those drives (3TB, the largest of the bunch) is dying, and I am currently making an image of it (via ddrescue). I'm not yet sure on how to use this image as a replacement PV though.
The steps I'm currently thinking of are:
- Mount image as a loop device, with losetup
- pvscan
- vgchange -a y
Would, after this procedure, LVM detect the loop device as a PV that's part of my volume group (among the working physical drives), and allow me to access the logical volume as normal?
Everything I've found on LVM images so far seems to be about imaging logical volumes, not physical ones, as I am doing now.
If this didn't work, I would just create an image of the entire logical volume (using the failing drive as a PV), however that would mean leaving the failing drive idle but powered on for hours while ddrescue copies the data on the perfectly working drives, risking more data loss.