However great LVM is in Linux, allowing one to span single „partition” over several hard drives, if the underlying „drives” are real hard drives and not RAID volumes, You can get pretty fucked when one of those disks fails.
It took me several hours of googling around and trials to find out how to recover as much data as is possible (meaning: all the data that is on remaining disks, the data on failed drive is obviously lost). So let’s try to add a short and working recipe to Google.
- You do NOT have to pvcreate any bogus empty PVs with fake UUIDs to replace the failed drive. LVM2 can be used in „partial” mode without all the drives.
- To use partial mode, You need to create /dev/ioerror device like this (I use Ubuntu, in other distros it might be different):
nano filenameto create a text file where a single line „0 9999999999 error” sans quotes should be placed
dmsetup create ioerror filenameto create a device LVM will read instead of missing PV
ln -s /dev/mapper/ioerror /dev/ioerrorso it’s just where LVM will look for it
- After ioerror is created, just activate your volume group in partial mode using
vgchange -P -ay VOLNAME
- Mount it (it will mount in read only mode) and copy your precious data
Cheers to these guys who finally written something I could use instead of pvcreate and bogus hard drives discussions.