"/dev/sdxx: read failed after 0 of 4096 at 0: Input/output error" - On running LVM commands like pvscan

The Problem

LVM commands show disk read failure and shows the below I/O errors:

[root@server]# pvscan
/dev/sdxx: read failed after 0 of 4096 at 0: Input/output error
/dev/sdxx: read failed after 0 of 4096 at 567869898752: Input/output error
/dev/sdxx: read failed after 0 of 4096 at 567869956096: Input/output error

The Solution

The LUN was physically removed from the server before deactivating the volume group and therefore LVM commands show I/O errors. The device nodes didn’t get removed when the physical LUN was removed. The command pvscan shows I/O errors and the devices are not present/visible in the server.

Manually remove the stale /dev/sdxx device node and clean up the stale device-mapper nodes.

# echo 1 > /sys/block/sdx/device/delete