Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


mdadm_raid_1_replace_disk

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
mdadm_raid_1_replace_disk [2015/05/14 08:26] – [mdadm - replace failed RAID1 disk] adminmdadm_raid_1_replace_disk [2015/05/14 08:36] – [Speed up rebuild] admin
Line 2: Line 2:
 ~~TOC~~ ~~TOC~~
 =====mdadm - replace failed RAID1 disk===== =====mdadm - replace failed RAID1 disk=====
 +====Check and remove disk====
   * Check status:<code># cat /proc/mdstat   * Check status:<code># cat /proc/mdstat
 Personalities : [raid1] Personalities : [raid1]
Line 29: Line 30:
   * Check the serial number for the **good** drive:<code>]# smartctl -a /dev/sdb |grep -i serial   * Check the serial number for the **good** drive:<code>]# smartctl -a /dev/sdb |grep -i serial
 Serial Number:    9WJ0MGBM</code> Serial Number:    9WJ0MGBM</code>
 +====Replace drive====
   * Replace the failed drive, double check the serial number on the drive.   * Replace the failed drive, double check the serial number on the drive.
   * Copy boot sector / partition table to new drive:<code>sfdisk -d /dev/sdb | sfdisk /dev/sda</code>   * Copy boot sector / partition table to new drive:<code>sfdisk -d /dev/sdb | sfdisk /dev/sda</code>
 +====Rebuild RAID1 array====
   * Put new drive in array:<code>mdadm /dev/md125 -a /dev/sda3   * Put new drive in array:<code>mdadm /dev/md125 -a /dev/sda3
 mdadm /dev/md126 -a /dev/sda2 mdadm /dev/md126 -a /dev/sda2
Line 51: Line 54:
              
 unused devices: <none></code> unused devices: <none></code>
 +====Speed up rebuild====
 +  * Show current min/max limit:<code>sysctl dev.raid.speed_limit_min
 +sysctl dev.raid.speed_limit_max</code>
 +  * Increase speed:<code>sysctl -w dev.raid.speed_limit_min=500000</code>
 +
mdadm_raid_1_replace_disk.txt · Last modified: 2021/10/09 15:14 by 127.0.0.1