User Tools

Site Tools


mdadm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mdadm [2023/11/17 13:46] – [Speed Up or Slow Down Raid rebuild] normanmdadm [2025/06/20 11:25] (current) – [“not enough to start the array” – error while staring mdadm RAID array] norman
Line 1: Line 1:
 ====== Mdadm Helpers ====== ====== Mdadm Helpers ======
 +
 +*************
 +
 +===== Debian Disable/Enable Raid Monthly Checks =====
 +
 +<code>dpkg-reconfigure mdadm</code>
 +
 +or edit cron job
 +
 +<code>nano /etc/cron.d/mdadm</code>
 +
 +[[https://askubuntu.com/questions/1304738/mdadm-checking-raid-5-array-after-each-restart|External Link]]
 +
 +
  
 ===== How do I replace a disk marked as removed from a linux md raid-5 array ===== ===== How do I replace a disk marked as removed from a linux md raid-5 array =====
Line 28: Line 42:
  Assemble the pre-existing array:  Assemble the pre-existing array:
 <code>mdadm -A -f /dev/md0</code> <code>mdadm -A -f /dev/md0</code>
 +
 +
 +RUN raid 1 with one disk:
 +<code>
 +mdadm --run /dev/md126
 +</code>
 +
 +Then Add disk:
 +<code>
 +mdadm --manage /dev/md126 --add /dev/sdf4
 +</code>
  
 ====== Test Email Settings ====== ====== Test Email Settings ======
Line 54: Line 79:
  
 Removing the spares=1 option or just recreating the mdadm.conf from scratch fixes the problem: Removing the spares=1 option or just recreating the mdadm.conf from scratch fixes the problem:
 +
 +====== **Update MDADM config file** ======
 +
  
 <code>/usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf.copy</code> <code>/usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf.copy</code>
Line 59: Line 87:
 Double check new configuration ad then save as mdadm.conf Double check new configuration ad then save as mdadm.conf
  
 +====== **Just in case** ======
  
 +Run <code>update-initramfs -u</code>
 ====== Speed Up or Slow Down Raid rebuild ====== ====== Speed Up or Slow Down Raid rebuild ======
  
Line 98: Line 128:
  
  
-===== Speed Change Script Demo =====+===== Speed Change Script Example =====
  
  
Line 111: Line 141:
 tput setaf 2 tput setaf 2
 tput bold tput bold
-if [[ $speed == '200000' ]]; then +if [[ $speed == '150000' ]]; then 
-    sysctl -w dev.raid.speed_limit_max=15000 | cut -c 28- | sed  -e   's/^/                 /'+    sysctl -w dev.raid.speed_limit_max=10000 | cut -c 28- | sed  -e   's/^/                 /' 
 +    sysctl -w dev.raid.speed_limit_min=1000  | cut -c 28- | sed  -e   's/^/                 /'
 else else
-    sysctl -w dev.raid.speed_limit_max=200000 | cut -c 28- | sed  -e 's/^/                 /'+    sysctl -w dev.raid.speed_limit_max=150000 | cut -c 28- | sed  -e 's/^/                 /' 
 +    sysctl -w dev.raid.speed_limit_min=10000  | cut -c 28- | sed  -e   's/^/                 /'
 fi fi
 +
 tput sgr0 tput sgr0
 </code> </code>
  
mdadm.1700228783.txt.gz · Last modified: by norman