背景
近日操作移动一台R620 外接MD1400的设备。系统关机、服务器、存储断电、移机、链接、加电、开机,一气呵成。
但是。。。。。
系统起来后,fdisk -l 没有发现MD1400的硬盘信息,/var/log/message 日志如下
Jun 23 20:30:44 xz001 kernel: scsi 12:0:0:0: Direct-Access iDRAC SECUPD 0329 PQ: 0 ANSI: 0 CCS Jun 23 20:30:44 xz001 kernel: sd 12:0:0:0: Attached scsi generic sg2 type 0 Jun 23 20:30:44 xz001 kernel: sd 12:0:0:0: [sdb] 2112 512-byte logical blocks: (1.08 MB/1.03 MiB) Jun 23 20:30:44 xz001 kernel: sd 12:0:0:0: [sdb] Write Protect is off Jun 23 20:30:44 xz001 kernel: sd 12:0:0:0: [sdb] Assuming drive cache: write through Jun 23 20:30:44 xz001 kernel: sd 12:0:0:0: [sdb] Assuming drive cache: write through Jun 23 20:30:44 xz001 kernel: sdb: Jun 23 20:30:44 xz001 kernel: sd 12:0:0:0: [sdb] Assuming drive cache: write through Jun 23 20:30:44 xz001 kernel: sd 12:0:0:0: [sdb] Attached SCSI removable disk Jun 23 20:30:46 xz001 ntpd[5490]: Deferring DNS for 0.centos.pool.ntp.org 1 Jun 23 20:30:59 xz001 kernel: usb 1-1.6.2: USB disconnect, device number 5 Jun 23 20:31:05 xz001 kernel: usb 1-1.6.2: new high speed USB device number 6 using ehci_hcd Jun 23 20:31:05 xz001 kernel: usb 1-1.6.2: New USB device found, idVendor=0624, idProduct=0250 Jun 23 20:31:05 xz001 kernel: usb 1-1.6.2: New USB device strings: Mfr=4, Product=5, SerialNumber=6 Jun 23 20:31:05 xz001 kernel: usb 1-1.6.2: Product: Mass Storage Function Jun 23 20:31:05 xz001 kernel: usb 1-1.6.2: Manufacturer: Avocent Jun 23 20:31:05 xz001 kernel: usb 1-1.6.2: SerialNumber: 20120731 Jun 23 20:31:05 xz001 kernel: usb 1-1.6.2: configuration #1 chosen from 1 choice Jun 23 20:31:05 xz001 kernel: scsi13 : SCSI emulation for USB Mass Storage devices Jun 23 20:31:06 xz001 kernel: scsi 13:0:0:0: Direct-Access iDRAC SECUPD 0329 PQ: 0 ANSI: 0 CCS Jun 23 20:31:06 xz001 kernel: sd 13:0:0:0: Attached scsi generic sg2 type 0 Jun 23 20:31:06 xz001 kernel: sd 13:0:0:0: [sdb] 2112 512-byte logical blocks: (1.08 MB/1.03 MiB) Jun 23 20:31:06 xz001 kernel: sd 13:0:0:0: [sdb] Write Protect is off Jun 23 20:31:06 xz001 kernel: sd 13:0:0:0: [sdb] Assuming drive cache: write through Jun 23 20:31:06 xz001 kernel: sd 13:0:0:0: [sdb] Assuming drive cache: write through Jun 23 20:31:06 xz001 kernel: sdb: Jun 23 20:31:06 xz001 kernel: sd 13:0:0:0: [sdb] Assuming drive cache: write through Jun 23 20:31:06 xz001 kernel: sd 13:0:0:0: [sdb] Attached SCSI removable disk Jun 23 20:31:21 xz001 kernel: usb 1-1.6.2: USB disconnect, device number 6 Jun 23 20:31:24 xz001 kernel: usbcore: deregistering interface driver usb-storage
没有找到原因,重启系统,慢慢等待,识别ok了。但是没有lvm逻辑分区卷,这可如何挂载。
vgdisplay lvdisplay 反馈都是空
解决方式
一、vgscan
[root@xz001 log]# vgscan [root@xz001 log]# vgdisplay --- Volume group --- VG Name VolGroup00 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size 18.19 TiB PE Size 4.00 MiB Total PE 4767999 Alloc PE / Size 4767999 / 18.19 TiB Free PE / Size 0 / 0 VG UUID w7RGey-e8JH-TL6l-GVSB-tpRb-qeV0-ThA3Sy
[root@xz001 log]# lvdisplay --- Logical volume --- LV Path /dev/VolGroup00/LogVol00 LV Name LogVol00 VG Name VolGroup00 LV UUID cg90Rc-LKfe-4h3p-oFL9-6s2v-Yn6P-UJsJWg LV Write Access read/write LV Creation host, time w231.corp.iautos.cn, 2017-09-21 17:03:00 +0800 LV Status NOT available # open 1 LV Size 14.00 TiB Current LE 3670016 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 --- Logical volume --- LV Path /dev/VolGroup00/LogVol01 LV Name LogVol01 VG Name VolGroup00 LV UUID eaLGoE-1jb6-Ojgt-eY6v-Tknd-BmQr-atbIPc LV Write Access read/write LV Creation host, time w231.corp.iautos.cn, 2017-09-21 17:03:19 +0800 LV Status NOT available # open 1 LV Size 4.19 TiB Current LE 1097983 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1
以为是ok了,结果mount时提示
mount : special device /dev/VolGroup00/LogVol00 does not exist
原因 lvdisplay中 LV status 不正确
LV Status NOT available
解决方式
[root@xz001 log]# vgchange -ay /dev/VolGroup00 [root@xz001 log]# lvdisplay --- Logical volume --- LV Path /dev/VolGroup00/LogVol00 LV Name LogVol00 VG Name VolGroup00 LV UUID cg90Rc-LKfe-4h3p-oFL9-6s2v-Yn6P-UJsJWg LV Write Access read/write LV Creation host, time w231.corp.iautos.cn, 2017-09-21 17:03:00 +0800 LV Status available # open 1 LV Size 14.00 TiB Current LE 3670016 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 --- Logical volume --- LV Path /dev/VolGroup00/LogVol01 LV Name LogVol01 VG Name VolGroup00 LV UUID eaLGoE-1jb6-Ojgt-eY6v-Tknd-BmQr-atbIPc LV Write Access read/write LV Creation host, time w231.corp.iautos.cn, 2017-09-21 17:03:19 +0800 LV Status available # open 1 LV Size 4.19 TiB Current LE 1097983 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1
执行挂载命令,挂载成功。数据访问正常。
主要用到的命令
1、vgscan 2、vgchange -ay vgname
使用vgscan命令扫描系统中所有的卷组。
[通常用法]
vgscan #扫描并显示LVM卷组列表
vgchange 命令用于修改卷组的属性,经常是用来修改卷组是否处于活跃状态
处于活跃状态的卷组不能删除,必须将卷组设置成非活跃状态才能删除
[通常用法]
vgchange -ay myvg # 将myvg卷组激活
vgchange -an myvg # 将myvg卷组去激活