Linux 軟Raid建立方法:

來源:互聯網
上載者:User

標籤:linux

一。Raid 0 建立

# mdadm -C /dev/md0 -n 2 -a yes -l 0 -x /dev/sdb1 /dev/sdb2 /dev/sdb3[建立Raid 0 ,其中-C 建立, -n 指定磁碟塊數, -a  You haven‘t given enough devices (real or missing) to create this array, -x 指定空閑盤個數]

2. 查看

#mdadm -D /dev/md0

#cat /proc/mdstat

3. 類比磁碟故障

#mdadm /dev/md0 -f|--fail /dev/sdb1

[email protected] ~]# mdadm /dev/md0 -f /dev/sdb1

     mdadm: set /dev/sdb1 faulty in /dev/md0


    [[email protected] ~]# madam -D /dev/md0

-bash: madam: command not found

[[email protected] ~]# mdadm -D /dev/md0

/dev/md0:

       Version : 1.2

 Creation Time : Sat Apr 26 07:19:59 2014

    Raid Level : raid5

    Array Size : 2117632 (2.02 GiB 2.17 GB)

 Used Dev Size : 1058816 (1034.17 MiB 1084.23 MB)

  Raid Devices : 3

 Total Devices : 4

   Persistence : Superblock is persistent


   Update Time : Sat Apr 26 07:30:41 2014

         State : clean

Active Devices : 3

Working Devices : 3

Failed Devices : 1

 Spare Devices : 0


        Layout : left-symmetric

    Chunk Size : 512K


          Name : cnshla02.la.com:0  (local to host cnshla02.la.com)

          UUID : 32d58274:62d5e406:7a0cbd5d:5cd42c00

        Events : 37


   Number   Major   Minor   RaidDevice State

      3       8       22        0      active sync   /dev/sdb6

      1       8       18        1      active sync   /dev/sdb2

      4       8       19        2      active sync   /dev/sdb3


      0       8       17        -      faulty spare   /dev/sdb1

4.剔除故障磁碟

 [email protected] ~]# mdadm /dev/md0 --remove  /dev/sdb1

       mdadm: hot removed /dev/sdb1 from /dev/md0

5.添加磁碟到指定的raid

  [[email protected] ~]# mdadm /dev/md0 -a /dev/sdb1

     mdadm: added /dev/sdb1


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.