[linux-lvm] Using VG with one disk missing --> Solved

Florian Hinzmann f.hinzmann at hamburg.de
Wed Sep 17 17:55:02 UTC 2003

Hello again!

In case someone is about to answer: Thanks to excessive help
from agk on IRC I got my VG with all LVs activated.

And for the archives - A very short HOWTO:

Disclaimer: I am tired and I am new to this. What I am
trying to say:  All errors are mine.

While using -P LVM uses /dev/ioerror to read from instead of the
missing PV (missing harddisk). See the manual page of lvm for details.
As far as I understand this any block device may be used as /dev/ioerror
and dmsetup may be used to create a virtual one.

dmsetup needs a file containing one line:
0 <bignumber> error

error is the target type for dmsetup. See "man dmsetup". Old manpages
list "io_err" instead of "error" as target type. This is wrong and has
been fixed in CVS already.

<bignumber> is the size of the virtual device in sectors
( 1 sector == 512 bytes). So fill in a number which is at least
as big as the number of sectors of the broken harddisk.

Then run:
dmsetup create ioerror <filename>

cd /dev ; ln -s mapper/ioerror ioerror

Now /dev/ioerror is ready to be used by LVM. "vgchange -P -ay"
should activate the VG with all LVs including the broken ones.
This worked for me.

So much for now.


More information about the linux-lvm mailing list