環境:
* Dell R710 E5520*2/146GB*6 SAS/2GB*4
* Integrated RAID Controller(HW)
* CentOS 5.x
一開始要先找到系統上的 RAID Controller 系統型號是什麼,試了以下的方式。
root@m001 { /proc/scsi }$ cat scsi Attached devices: Host: scsi0 Channel: 02 Id: 00 Lun: 00 Vendor: DELL Model: PERC H700 Rev: 2.0. Type: Direct-Access ANSI SCSI revision: 05 Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: PLDS Model: DVD+-RW DS-8A3S Rev: HD52 Type: CD-ROM ANSI SCSI revision: 05
不過,我的系統是用 SAS 的,所以應該不是這一個。再試
root@m001 { /proc }$ cat devices Character devices: 1 mem 4 /dev/vc/0 4 tty 4 ttyS 5 /dev/tty 5 /dev/console 5 /dev/ptmx 6 lp 7 vcs 10 misc 13 input 21 sg 29 fb 128 ptm 136 pts 162 raw 180 usb 189 usb_device 202 cpu/msr 203 cpu/cpuid 216 rfcomm 251 blktap 252 uio 253 megaraid_sas_ioctl 254 pcmcia Block devices: 1 ramdisk 8 sd 9 md 11 sr 65 sd 66 sd 67 sd 68 sd 69 sd 70 sd 71 sd 128 sd 129 sd 130 sd 131 sd 132 sd 133 sd 134 sd 135 sd 253 device-mapper 254 mdp
也沒看出什麼端泥
root@m001 { /proc }$ cat diskstats 1 0 ram0 0 0 0 0 0 0 0 0 0 0 0 1 1 ram1 0 0 0 0 0 0 0 0 0 0 0 1 2 ram2 0 0 0 0 0 0 0 0 0 0 0 1 3 ram3 0 0 0 0 0 0 0 0 0 0 0 1 4 ram4 0 0 0 0 0 0 0 0 0 0 0 1 5 ram5 0 0 0 0 0 0 0 0 0 0 0 1 6 ram6 0 0 0 0 0 0 0 0 0 0 0 1 7 ram7 0 0 0 0 0 0 0 0 0 0 0 1 8 ram8 0 0 0 0 0 0 0 0 0 0 0 1 9 ram9 0 0 0 0 0 0 0 0 0 0 0 1 10 ram10 0 0 0 0 0 0 0 0 0 0 0 1 11 ram11 0 0 0 0 0 0 0 0 0 0 0 1 12 ram12 0 0 0 0 0 0 0 0 0 0 0 1 13 ram13 0 0 0 0 0 0 0 0 0 0 0 1 14 ram14 0 0 0 0 0 0 0 0 0 0 0 1 15 ram15 0 0 0 0 0 0 0 0 0 0 0 8 0 sda 2912902 5836954 68738123 7169600 160459782 17123814 1395096183 25929156 0 13643852 33091376 8 1 sda1 40 239 580 256 0 0 0 0 0 224 256 8 2 sda2 119 381 638 256 0 0 0 0 0 228 256 8 3 sda3 98 1738 2073 300 26 10 70 16 0 268 316 8 4 sda4 4 0 8 48 0 0 0 0 0 48 48 8 5 sda5 2912623 5834579 68734544 7168636 160459756 17123804 1395096113 25929140 0 13643356 33089664 253 0 dm-0 9539 0 268418 38228 2335167 0 18681336 3292088 0 1955100 3331236 253 1 dm-1 8687278 0 67271513 17692256 154407246 0 1209683729 24606260 0 8434120 42334020 253 2 dm-2 12322 0 263170 11840 16610092 0 132880736 14888900 0 4044548 14900772 253 3 dm-3 284 0 2266 952 2883732 0 23069856 468160 0 61080 469112 253 4 dm-4 39746 0 928154 173252 1347557 0 10780456 917888 0 69840 1091140 253 5 dm-5 75 0 600 304 0 0 0 0 0 52 304 11 0 sr0 7 10 136 3248 0 0 0 0 0 3144 3248 9 0 md0 0 0 0 0 0 0 0 0 0 0 0
有看到 sdx ,不過沒什麼用
root@m001 { /proc }$ dmidecode | grep -i sas root@m001 { /proc }$ dmidecode | less root@m001 { /proc }$ dmidecode # dmidecode 2.7 SMBIOS 2.6 present. 83 structures occupying 4569 bytes. Table at 0xCF79C000. Handle 0xDA00, DMI type 218, 11 bytes. OEM-specific Type Header and Data: DA 0B 00 DA B2 00 17 00 0E 20 00 Handle 0x0000, DMI type 0, 24 bytes. BIOS Information Vendor: Dell Inc. Version: 1.3.6 Release Date: 10/30/2009 Address: 0xF0000 Runtime Size: 64 kB ROM Size: 4096 kB ......
連這個都沒有。最後試到
root@m001 { /proc }$ dmesg | grep -i sas megasas: 00.00.04.31-RH1 Tues. June. 15 14:13:02 EST 2010 megasas: 0x1000:0x0079:0x1028:0x1f17: bus 3:slot 0:func 0 gen2: instance->base_addr = df1bc000<6>megasas: FW now in Ready state megasas_init_mfi: fw_support_ieee=0<6>scsi0 : LSI SAS based MegaRAID driver
終於有了。不過,怎麼不是它 SPEC 上說的 PERC 6/xx , SAS 5/E 呢?
不過,這個 MegaRAID driver 到是很多人討論到,所以就跟著找下去了。然後,找到了 LSI MegaRaid – MegaCli Linux Commands 這篇,就照著它,去 LSI Web Site 下載它的命令列工具。我是用第二頁的 MegaRAID SAS MegaCLI - Linux, Version 1.01.39 這個檔案。把 rpm 裝一下唄
[root@qa1 ~]# rpm -Uvh MegaCli-1.01.39-0.i386.rpm [root@qa1 ~]# rpm -ql MegaCli-1.01.39-0 /opt/MegaRAID/MegaCli/MegaCli /opt/MegaRAID/MegaCli/MegaCli64
接著去看看 help 吧. 一堆 command(請小心使用,它可以直接修改,刪除 VD)。由於我只要查詢而已,所以就執行以下 command.
[root@qa1 ~]# /opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aAll Adapter #0 ============================================================================== Versions ================ Product Name : PERC 6/i Integrated Serial No : 1122334455667788 FW Package Build: 6.2.0-0013 Mfg. Data ================ Mfg. Date : 06/24/08 Rework Date : 06/24/08 ......
終於看到它是:PERC 6/i Integrated, 然後
[root@qa1 ~]# /opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -L0 -a0 Adapter 0 -- Virtual Drive Information: Virtual Disk: 0 (target id: 0) Name: RAID Level: Primary-5, Secondary-0, RAID Level Qualifier-3 Size:696960MB State: Optimal Stripe Size: 64kB Number Of Drives:6 Span Depth:1 Default Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU Current Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU Access Policy: Read/Write Disk Cache Policy: Disk's Default
噔噔!終於出現了。原來是 RAID 5.