Published July 31st, 2014
How to fix error /dev/dm-0: read failed after 0 of 4096 at 0: Input/output error
OK, so you have a RAID array available over iSCSI upon which clients mount LVM volumes.
One day something bad happens (crash / disk failure in the RAID array) which leaves the iSCSI clients in a bad state (unable to access the LVM volumes).
You fix the array but when the clients try to reconnect using lv and pv tools they get errors like:
/dev/dm-0: read failed after 0 of 4096 at 0: Input/output error
Here's how I fixed it:
On the array server, make a backup copy of the block-image(s) that have problems mounting (just in case)
cp block-image-disk1.disk block-image-disk1.disk.bak
All further commands are on the iSCSI clients.
Use dmsetup to remove the mapping in device-mapper
dmsetup remove --force /dev/mapper/iscsi_volume1-iscsi_logical1
Shut down LVM and iSCSI services
Start up LVM and iSCSI services
If you use lvdisplay to check your logical volume and you see it is not active:
LV Status NOT available
Activate the volume groups using
vgchange -a y
You should now be able to mount the LVM volumes over iSCSI again using mount.
mount /dev/iscsi_volume1/iscsi_logical1 /mymount -t ext3