003. Raid Management

Source: Internet
Author: User
1. View raid group information
1 [[email protected] ~] # Mdadm-D/dev/md0 2/dev/md0: 3 version: 1.2 4 Creation Time: Mon Aug 29 22:47:23 2016 5 raid level: RAID5 # array level 6 array size: 3142656 (3.00 gib 3.22 GB) # array capacity size 7 used Dev size: 1047552 (1023.17 MIB 1072.69 MB) 8 raid devices: 3 # Number of RAID Members 9 total devices: 4 # the total number of members in raid, and the backup disk is also counted into 10 Persistence: superblock is persistent 11 Update Time: Mon Aug 29 22:49:25 2016 12 State: Clean 13 # status, there are three states: Clean indicates normal, degraded indicates a problem, recovering indicates that 14 active devices are being restored or constructed: 3 # The number of active raid members is 15 working devices: 5 # Number of working raid members 16 failed devices: 0 # faulty raid member 17 spare devices: 1 # number of alternate raid members 18 layout: Left-semi Ric 19 Chunk Size: 512 K 20 name: Random: 0 (Local to host kauai.example.net) 21 UUID: ed3cf105: 2f9bd528: 9ca7b99d: 0bcea5a1 # raid UUID value, which is the only 22 events: 18 23 Number major minor raiddevice state 24 0 8 21 0 Active Sync/dev/sdb5 25 1 8 22 1 Active Sync/dev/sdb6 26 2 8 23 2 Active Sync/dev/sdb7 27 3 8 24-Spare/dev/sdb8

2. Delete damaged disks using raid
1 [[email protected] ~] # Mdadm/dev/md0-F/dev/sdb6 # simulate sdb6 damage 2 mdadm: Set/dev/sdb6 faulty in/dev/md0 3 [[email protected] ~] # Mdadm/dev/md0-r/dev/sdb6 # Remove corrupted sdb6 4 mdadm: Hot removed/dev/sdb6 from/dev/md0

Note: After a damaged disk is removed, if there is a hot backup disk, the hot backup disk will automatically replace the original damaged disk. The raid is restored after automatic reconstruction.

Three raid new hot backup disk
1 [[email protected] ~] # Mdadm/dev/md0-A/dev/sdb6 # Add a new hot backup disk 2 mdadm: added/dev/sdb6

Note: The new hot backup disk must also be partitioned using fdisk.

Four raid new hard drive

Note: If you have not created enough raid space, you can add a new disk, but you must use the fdisk partition before you can.

4.1 Add a hard disk to raid
  1 [[email protected] ~]# mdadm /dev/md0 -a /dev/sdb6  2 mdadm: added /dev/sdb6

4.2 convert to an active Disk

Note:

1 because the new disk is a hot spare disk by default, you can convert it to an active disk according to the hard disk Number of the array.

2. the hard disk number to be converted is the RAID device number.

  1 [[email protected] ~]# mdadm -D /dev/md0  2 ……  3     Number   Major   Minor   RaidDevice State  4        3       8       24        0      active sync   /dev/sdb8  5        1       8       22        1      active sync   /dev/sdb6  6        4       8       23        2      active sync   /dev/sdb7  7        5       8       21        -      spare   /dev/sdb5  8 [[email protected] ~]# mdadm -G /dev/md0 -n4  9 mdadm: Need to backup 3072K of critical section..

003. Raid Management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.