前回作ったLVM領域を適当なところにマウントして、テスト用のファイルを用意します。
# mount /dev/testvol/testlog /mnt/testdir/ # cd /mnt/testdir # wget http://ftp.riken.jp/Linux/centos/5.5/isos/x86_64/CentOS-5.5-x86_64-LiveCD.iso --2011-02-12 12:32:58-- http://ftp.riken.jp/Linux/centos/5.5/isos/x86_64/CentOS-5.5-x86_64-LiveCD.iso ftp.riken.jp をDNSに問いあわせています... 134.160.38.1 ftp.riken.jp|134.160.38.1|:80 に接続しています... 接続しました。 HTTP による接続要求を送信しました、応答を待っています... 200 OK 長さ: 728184832 (694M) [application/octet-stream] `CentOS-5.5-x86_64-LiveCD.iso' に保存中 100%[=============================================================================================>] 728,184,832 3.53M/s 時間 3m 18s 2011-02-12 12:36:16 (3.51 MB/s) - `CentOS-5.5-x86_64-LiveCD.iso' へ保存完了 [728184832/728184832] # ls CentOS-5.5-x86_64-LiveCD.iso lost+found次にディスク不良を想定して、稼働中のディスクをremoveします。
注意:動作中のディスクは絶対にremoveしないでください。
# umount /mnt/testdir/ # cat /proc/scsi/scsi Attached devices: Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: silicon Model: -power Rev: 0.00 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: WDC WD10EADS-00L Rev: 01.0 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi2 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: SAMSUNG HD103SI Rev: 1AG0 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi3 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: WDC WD10EADS-00L Rev: 01.0 Type: Direct-Access ANSI SCSI revision: 05 # echo "scsi remove-single-device 2 0 0 0 " > /proc/scsi/scsi # cat /proc/scsi/scsi Attached devices: Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: silicon Model: -power Rev: 0.00 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: WDC WD10EADS-00L Rev: 01.0 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi3 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: WDC WD10EADS-00L Rev: 01.0 Type: Direct-Access ANSI SCSI revision: 05ディスクをremoveしたら、LVMの状態を確認。
使用中にremoveしたもんだからI/O errorが発生してる。
# lvs -a -o +devices LV VG Attr LSize Origin Snap% Move Log Copy% Convert Devices testlog testvol -wi-ao 5.00G /dev/sdb(0) # tail /var/log/messages Feb 12 12:23:04 localhost ntpd[2775]: kernel time sync enabled 0001 Feb 12 12:26:49 localhost ntpd[2775]: synchronized to 202.224.32.4, stratum 2 Feb 12 12:51:53 localhost kernel: ata2.00: disabled Feb 12 12:51:59 localhost kernel: scsi 2:0:0:0: rejecting I/O to dead device Feb 12 12:51:59 localhost lvm[2145]: Mirror device, 253:2, has failed. Feb 12 12:51:59 localhost lvm[2145]: Device failure in testvol-testlog Feb 12 12:51:59 localhost kernel: scsi 2:0:0:0: rejecting I/O to dead device Feb 12 12:52:00 localhost last message repeated 55 times Feb 12 12:52:00 localhost lvm[2145]: Repair of mirrored LV testvol/testlog finished successfully. Feb 12 12:52:02 localhost lvm[2145]: No longer monitoring mirror device testvol-testlog for events # dmesg | tail scsi 2:0:0:0: rejecting I/O to dead device scsi 2:0:0:0: rejecting I/O to dead device scsi 2:0:0:0: rejecting I/O to dead device scsi 2:0:0:0: rejecting I/O to dead device scsi 2:0:0:0: rejecting I/O to dead device scsi 2:0:0:0: rejecting I/O to dead device scsi 2:0:0:0: rejecting I/O to dead device scsi 2:0:0:0: rejecting I/O to dead device scsi 2:0:0:0: rejecting I/O to dead device scsi 2:0:0:0: rejecting I/O to dead deviceremoveしたディスクを戻します。
# cat /proc/scsi/scsi Attached devices: Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: silicon Model: -power Rev: 0.00 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: WDC WD10EADS-00L Rev: 01.0 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi3 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: WDC WD10EADS-00L Rev: 01.0 Type: Direct-Access ANSI SCSI revision: 05 # echo "scsi add-single-device 2 0 0 0 " > /proc/scsi/scsi # cat /proc/scsi/scsi Attached devices: Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: silicon Model: -power Rev: 0.00 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: WDC WD10EADS-00L Rev: 01.0 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi3 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: WDC WD10EADS-00L Rev: 01.0 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi2 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: SAMSUNG HD103SI Rev: 1AG0 Type: Direct-Access ANSI SCSI revision: 05無事に認識(Attached)されたようです。
# dmesg | tail sdc: Write Protect is off sdc: Mode Sense: 00 3a 00 00 SCSI device sdc: drive cache: write back SCSI device sdc: 1953525168 512-byte hdwr sectors (1000205 MB) sdc: Write Protect is off sdc: Mode Sense: 00 3a 00 00 SCSI device sdc: drive cache: write back sdc: unknown partition table sd 2:0:0:0: Attached scsi disk sdc sd 2:0:0:0: Attached scsi generic sg2 type 0LVMの状態を見てみると、メタデータが不正だとかでVolumeGroupから外されてた。
# lvs -a -o +devices WARNING: Inconsistent metadata found for VG testvol - updating to use version 9 Removing PV /dev/sdc (M9T2Zc-HHF1-OWcd-Ehx9-scGl-ARiZ-LdrYsx) that no longer belongs to VG testvol LV VG Attr LSize Origin Snap% Move Log Copy% Convert Devices testlog testvol -wi-ao 5.00G /dev/sdb(0) # vgs VG #PV #LV #SN Attr VSize VFree testvol 2 1 0 wz--n- 1.82T 1.81T # pvs PV VG Fmt Attr PSize PFree /dev/sdb testvol lvm2 a- 931.51G 926.51G /dev/sdc lvm2 -- 931.51G 931.51G /dev/sdd testvol lvm2 a- 931.51G 931.51G復旧しましょう。
# pvcreate /dev/sdc Physical volume "/dev/sdc" successfully created # pvs PV VG Fmt Attr PSize PFree /dev/sdb testvol lvm2 a- 931.51G 926.51G /dev/sdc lvm2 -- 931.51G 931.51G /dev/sdd testvol lvm2 a- 931.51G 931.51G # vgextend testvol /dev/sdc Volume group "testvol" successfully extended # pvs PV VG Fmt Attr PSize PFree /dev/sdb testvol lvm2 a- 931.51G 926.51G /dev/sdc testvol lvm2 a- 931.51G 931.51G /dev/sdd testvol lvm2 a- 931.51G 931.51G # vgs VG #PV #LV #SN Attr VSize VFree testvol 3 1 0 wz--n- 2.73T 2.72TLogicalVolumeを停止してからコンバート。
# lvchange -an /dev/testvol/testlog # lvconvert -m 1 /dev/testvol/testlog Conversion starts after activation # lvchange -ay /dev/testvol/testlog # lvs -a -o +devices LV VG Attr LSize Origin Snap% Move Log Copy% Convert Devices testlog testvol mwi-a- 5.00G testlog_mlog 4.22 testlog_mimage_0(0),testlog_mimage_1(0) [testlog_mimage_0] testvol Iwi-ao 5.00G /dev/sdb(0) [testlog_mimage_1] testvol Iwi-ao 5.00G /dev/sdd(0) [testlog_mlog] testvol lwi-ao 4.00M /dev/sdc(0) # mount /dev/testvol/testlog /mnt/testdir/ # ls /mnt/testdir CentOS-5.5-x86_64-LiveCD.iso lost+found
0 件のコメント:
コメントを投稿