LVM分区丢失导致硬盘为只读

 

LVM分区丢失导致硬盘为只读
现像:本来如果tomcat程序down了以后会自动重启,但一晚上报警,登上服务器后发现硬盘为只读,而且登陆上以后不能reboot重启,查看系统日志如下
 
tail  /var/log/message
Nov 24 08:55:22 localhost smartd[3029]: Device: /dev/sdb, is SMART capable. Adding to "monitor" list.
Nov 24 08:55:23 localhost smartd[3029]: Device: /dev/sdb, 1021 Currently unreadable (pending) sectors
Nov 24 08:55:24 localhost smartd[3029]: Device: /dev/sdb, 1021 Offline uncorrectable sectors
Nov 24 09:25:24 localhost smartd[3047]: Device: /dev/sdb, 1133 Currently unreadable (pending) sectors
Nov 24 09:25:24 localhost smartd[3047]: Device: /dev/sdb, 1133 Offline uncorrectable sectors
Nov 24 09:55:25 localhost smartd[3047]: Device: /dev/sdb, 1133 Currently unreadable (pending) sectors
Nov 24 09:55:25 localhost smartd[3047]: Device: /dev/sdb, 1133 Offline uncorrectable sectors
Nov 24 10:25:24 localhost smartd[3047]: Device: /dev/sdb, 1133 Currently unreadable (pending) sectors
Nov 24 10:25:24 localhost smartd[3047]: Device: /dev/sdb, 1133 Offline uncorrectable sectors
Nov 24 10:55:24 localhost smartd[3047]: Device: /dev/sdb, 1133 Currently unreadable (pending) sectors
Nov 24 10:55:24 localhost smartd[3047]: Device: /dev/sdb, 1133 Offline uncorrectable sectors
Nov 24 11:25:24 localhost smartd[3047]: Device: /dev/sdb, 1133 Currently unreadable (pending) sectors
 
查看硬盘为LVM管理,
通过pvdiaplay, vgdisplay,lvdisplay发现有重Duplicate VolGroup00 ,看来是LVM坏了,修复如下:
 
1、pvs
[root@localhost yuanbor]# /sbin/pvs
WARNING: Duplicate VG name VolGroup00: Existing tWwhxK-0M8r-sqhQ-VW7m-0BYv-BPkO-pgBRM8 (created here) takes precedence over 7kU450-LaPn-afEa-iWGw-xiqD-Tmwe-ohpL3f
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup00 lvm2 a- 33.97G 32.00M
/dev/sdb3 VolGroup00 lvm2 a- 36.78G 32.00M
这个比较惨,两个VG名字重了,下面将第二个VG修改名字。
2、vgrename
[root@localhost yuanbor]#/sbin/vgrename 7kU450-LaPn-afEa-iWGw-xiqD-Tmwe-ohpL3f /dev/VolGroup01
WARNING: Duplicate VG name VolGroup00: Existing tWwhxK-0M8r-sqhQ-VW7m-0BYv-BPkO-pgBRM8 (created here) takes precedence over 7kU450-LaPn-afEa-iWGw-xiqD-Tmwe-ohpL3f
Volume group "VolGroup00" successfully renamed to "VolGroup01"
[root@localhost yuanbor]# /sbin/pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup00 lvm2 a- 33.97G 32.00M
/dev/sdb3 VolGroup01 lvm2 a- 36.78G 32.00M
3、lvscan
[root@localhost sdb3]# /sbin/lvscan
inactive '/dev/VolGroup01/LogVol00' [34.81 GB] inherit
inactive '/dev/VolGroup01/LogVol01' [1.94 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol00' [32.00 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [1.94 GB] inherit
可以看到新修改的VolGroup01是inactive状态。
4、vgchange
[root@localhost sdb3]# /sbin/vgchange -ay /dev/VolGroup01
2 logical volume(s) in volume group "VolGroup01" now active
[root@localhost mnt]# /sbin/lvscan
ACTIVE '/dev/VolGroup01/LogVol00' [34.81 GB] inherit
ACTIVE '/dev/VolGroup01/LogVol01' [1.94 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol00' [32.00 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [1.94 GB] inherit
好了,现在可以挂载了。
5、mount
[root@localhost mnt]# mount /dev/VolGroup01/LogVol00 /mnt/sdb3
 
查看是否有raid卡
Lspci  | grep –I raik

你可能感兴趣的:(raid,重复,只读,lvm,休闲)