背景
近日操作移動一台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卷組去激活