Saturday, September 3, 2016

How to remove LVM Input/output error

How to remove LVM Input/output error

Many time after changing the femware of LVM or removing the disk/LUN’s without clean shutdown/unmount you may get fallowing error:
/dev/sdf: read failed after 0 of 4096 at 0: Input/output error
/dev/sdf: read failed after 0 of 4096 at 3298534817792: Input/output error
/dev/sdf: read failed after 0 of 4096 at 3298534875136: Input/output error
/dev/sdf: read failed after 0 of 4096 at 4096: Input/output error
/dev/sdk: read failed after 0 of 4096 at 0: Input/output error
/dev/sdk: read failed after 0 of 4096 at 6442385408: Input/output error
/dev/sdk: read failed after 0 of 4096 at 6442442752: Input/output error
/dev/sdk: read failed after 0 of 4096 at 4096: Input/output error
# Check which Volume Group have the issue , run “vgscan” command .
# Find out the Logical Volumes attached with that Volume Group.
# Inactive the logical volumes as :
1.lvchange -an lv-name
# Inactive Volume group as :
1.vgchange -an vg-name
# Again Scan Volume group using “vgscan” .
# Now activate the Volume Group :
1.vgchange -ay volume-group-name
# Run command “lvscan” , the error should be gone now .
# Now activate the Logical Volume Name :
1.lvchange -ay lv-name

Rename eth1 as eth0



Step #2: Rename eth0 as wan0

To rename eth0 as wan0, edit a file called 70-persistent-net.rules in /etc/udev/rules.d/ directory, enter:
# vi /etc/udev/rules.d/70-persistent-net.rules
The names of the Ethernet devices are listed in this file as follows:
 
# PCI device 0x14e4:0x1680 (tg3)
SUBSYSTEM=="net",
ACTION=="add",
DRIVERS=="?*",
ATTR{address}=="b8:ac:6f:65:31:e5",
ATTR{dev_id}=="0x0",
ATTR{type}=="1",
KERNEL=="eth*",
NAME="eth0"
 
Locate and identify the line with the NIC from step 1 (look for the MAC address). It may look like above. In this example, the interface eth0 will be renamed to wan0 (change NAME="eth0" to NAME="wan0"):
 
# PCI device 0x14e4:0x1680 (tg3)
SUBSYSTEM=="net",
ACTION=="add",
DRIVERS=="?*",
ATTR{address}=="b8:ac:6f:65:31:e5",
ATTR{dev_id}=="0x0",
ATTR{type}=="1",
KERNEL=="eth*",
NAME="wan0"
 
Save and close the file. Reboot the system to test changes:
# reboot