Skip to content

Instantly share code, notes, and snippets.

@BirknerAlex
Created October 12, 2018 17:14
Show Gist options
  • Save BirknerAlex/855a0a4a638a81478e9f126cfb43f0e5 to your computer and use it in GitHub Desktop.
Save BirknerAlex/855a0a4a638a81478e9f126cfb43f0e5 to your computer and use it in GitHub Desktop.
Replace RAID Disk

1. Lookup RAID Information

mdadm --detail /dev/md127 

Sample Output:

/dev/md127:
           Version : 1.2
     Creation Time : Fri Oct  5 15:22:45 2018
        Raid Level : raid10
        Array Size : 15630336 (14.91 GiB 16.01 GB)
     Used Dev Size : 7815168 (7.45 GiB 8.00 GB)
      Raid Devices : 4
     Total Devices : 4
       Persistence : Superblock is persistent

       Update Time : Fri Oct 12 18:55:47 2018
             State : clean, degraded 
    Active Devices : 3
   Working Devices : 3
    Failed Devices : 1
     Spare Devices : 0

            Layout : near=2
        Chunk Size : 512K

Consistency Policy : resync

              Name : sysresccd.lan:swap
              UUID : 1aa8bf1a:73e6cd31:3cb0644f:c2b307bf
            Events : 26

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync set-A   /dev/sda1
       1       8       17        1      active sync set-B   /dev/sdb1
       2       8       33        2      active sync set-A   /dev/sdc1
       -       0        0        3      removed

       3       8       65        -      faulty   /dev/sde1

2. Remove sde from Server (if hot swap works!)

3. Add new disk to Server (sdf)

4. Copy Partition Table

sfdisk -d /dev/sda | sfdisk /dev/sdf

5. Add new disk to raid

mdadm --manage /dev/md127 --add /dev/sdf1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment