Monday, July 28, 2008

LVM Confused from Unzoned LUN

I recently had a situation where I confused LVM on a test server.

I had zoned a SAN to serve a block device and added it to the LVM. When I was done with the device I umounted it unzoned it. My mistake: not removing it from the LVM. I should have done:

  • lvremove
  • vgremove
  • pvremove
LVM was confused. I kept seeing /dev/dm-2: read failed after 0 of 4096 at 37580898304: Input/output error or ioctl BLKGETSIZE64 failed: No such device or address errors from all of the commands above. Even though /proc/scsi/scsi didn't list the device. The following didn't help:
  • vgreduce --removemissing $name
  • rm /etc/lvm/.cache
  • vgchange -ay
I ended up rebooting the system so that it could rescan the SCSI bus and it worked fine. I might have gotten away with this trick to rescan the SCSI bus.

No comments: