因業務需要, 新增了新的磁碟, 因此需要把磁碟重新集成為 raid10
參考當前磁碟
[root@hh-yun-compute-131104 ~]# megacli -pdlist -aall | grep 'inquiry data:'
inquiry data: hitachi huc109060css600 a440kwkr7ghx
inquiry data: hitachi huc109060css600 a440kwkn3lrx
inquiry data: seagate st600mm0006 b001s0m4jc64
inquiry data: seagate st600mm0006 b001s0m4htab
查詢磁碟當前狀態
[root@hh-yun-compute-131104 ~]# megacli -pdlist -aall | grep "id" | uniq <- 取 252
enclosure device id: 252
[root@hh-yun-compute-131104 ~]# megacli -pdlist -aall | grep -e "disk\ group|slot\ number|postion:|firmware\ state:"
slot number: 0
drive's postion: diskgroup: 0, span: 0, arm: 0
firmware state: online, spun up
slot number: 1
drive's postion: diskgroup: 0, span: 0, arm: 1
firmware state: online, spun up
slot number: 2
firmware state: unconfigured(good), spun down <- 新新增磁碟
slot number: 3
firmware state: unconfigured(good), spun down <- 新新增磁碟
重組raid 磁碟方法
#!/bin/bash
rpm -ivh --force --nodeps
uiqnum=` megacli -pdlist -aall | grep "id" | uniq | awk -f: '' | awk ''`
disknum=`megacli -pdlist -aall | grep -e "disk\ group|slot\ number|postion:|firmware\ state:" | grep slot | awk -f[:\ ] ''`
disktotal=`megacli -pdlist -aall | grep -e "disk\ group|slot\ number|postion:|firmware\ state:" | grep slot | awk -f[:\ ] '' | wc -l`
if [ $disktotal -eq 4 ]
then
array=($disknum)
megacli -cfglddel -l0 -force -a0
megacli -cfgspanadd -r10 -array0[$uiqnum:$,$uiqnum:$] -array1[$uiqnum:$,$uiqnum:$] -a0
fi
重組並且同時建立多個磁碟的方法
#!/bin/bash
rpm -ivh --force --nodeps
if [ ! -f "/sbin/megacli" ]
then
ln -s /opt/megaraid/megacli/megacli64 "/sbin/megacli"
fiuiqnum=` megacli -pdlist -aall | grep "id" | uniq | awk -f: '' | awk ''`
disknum=`megacli -pdlist -aall | grep -e "disk\ group|slot\ number|postion:|firmware\ state:" | grep slot | awk -f[:\ ] ''`
disktotal=`megacli -pdlist -aall | grep -e "disk\ group|slot\ number|postion:|firmware\ state:" | grep slot | awk -f[:\ ] '' | wc -l`
if [ $disktotal -eq 4 ]
then
array=($disknum)
megacli -cfglddel -l0 -force -a0
megacli -cfgspanadd -r10 -array0[$uiqnum:$,$uiqnum:$] -array1[$uiqnum:$,$uiqnum:$] ra wb direct nocachedbadbbu sz200000 -a0
megacli -cfgspanadd -r10 -array0[$uiqnum:$,$uiqnum:$] -array1[$uiqnum:$,$uiqnum:$] ra wb direct nocachedbadbbu sz200000 -a0
megacli -cfgspanadd -r10 -array0[$uiqnum:$,$uiqnum:$] -array1[$uiqnum:$,$uiqnum:$] ra wb direct nocachedbadbbu -a0
fi
建立raid10(五塊磁碟)
建立raid10 五塊磁碟 raid10 5塊磁碟 上乙個bolg已經做了 raid5 3 個raid 2 個備份 在此條件下繼續以下步驟 1.先將磁碟系統解除安裝 2.看系統掛載裡是否還有md0 發現沒有了md0 3.使用mdadm命令建立raid10,名稱為 dev md0 4.格式化 5.掛載...
Linux基礎 磁碟列(如何建立raid10)
磁碟陣高效的資料組織和條帶化的並行訪問 獨立硬碟冗餘陣列 raid redundant array of independent disks raid資料組織的形式 條帶 硬碟中單個或多個連續的扇區,是一塊硬碟進行一次資料讀寫的最小單元 分條 同乙個硬碟的陣列中,有多個硬碟驅動器上相同位置編號的條帶...
RAID5和RAID10在磁碟讀寫選擇對比
磁碟讀寫速度的關鍵之一 cache cache技術最近幾年,在磁碟儲存技術上,發展的非常迅速,作為高階儲存,cache已經是整個儲存的核心所在,就是中低端儲存,也有很大的cache存在,包括最簡單的raid卡,一般都包含有幾十,甚至幾百兆的raid cache。cache的主要作用是什麼呢?作為快取...