How to repair a Software RAID in easy way
- Category : Linux Helpline (Easy Guide)
- Posted on : Apr 15, 2019
- Views : 2,192
- By : Odalis J.
You may please use the following steps to repair a software raid. Let us assume the server have two HDD’s /dev/sda and /dev/sdb . The second HDD got corrupted and replaced. Now you need to rebuild the array and start sync process.
step 1 : Build the partition table same as the first disk,
# sfdisk -d /dev/sda > partition.txt # replace 'sda' 'sdb' -- partition.txt # sfdisk /dev/sdb < partition.txt --force
Now the new HDD /dev/sdb have the same partition scheme. Let us check the current RAID status from /proc/mdstat
# cat /proc/mdstat Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty] md1 : active raid1 sda1[0] 20971456 blocks [2/1] [U_] md2 : active raid1 sda2[0] 955260864 blocks [2/1] [U_] unused devices: <none>
See here there are two raid partitions /dev/md1 using sda1 as raid1 and /dev/md2 using sda2 as raid1 too. Raid one need two partitions . So let us add the new partitions to the raid as follows,
step : 2 – Add new HDD’s to software raid ,
# mdadm /dev/md1 -a /dev/sdb1 # mdadm /dev/md2 -a /dev/sdb2
Now let us again check the status,
# cat /proc/mdstat Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty] md1 : active raid1 sdb1[2] sda1[0] 20971456 blocks [2/1] [U_] [=================>...] recovery = 88.8% (18625152/20971456) finish=0.5min speed=70875K/sec md2 : active raid1 sdb2[2] sda2[0] 955260864 blocks [2/1] [U_] resync=DELAYED unused devices: <none>
Now you can see that the mirroring started.
Categories
- cPanel Question 47
- cPanel Software Management 29
- cPanel Tutorials 13
- Development 29
- Domain 13
- General 19
- Linux Helpline (Easy Guide) 156
- Marketing 47
- MySQL Question 13
- News 2
- PHP Configuration 14
- SEO 4
- SEO 42
- Server Administration 84
- SSL Installation 54
- Tips and Tricks 24
- VPS 3
- Web Hosting 44
- Website Security 22
- WHM questions 13
- WordPress 148
Subscribe Now
10,000 successful online businessmen like to have our content directly delivered to their inbox. Subscribe to our newsletter!Archive Calendar
Sat | Sun | Mon | Tue | Wed | Thu | Fri |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
Recent Articles
-
Posted on : Sep 17
-
Posted on : Sep 10
-
Posted on : Aug 04
-
Posted on : Apr 01
Tags
- ts
- myisam
- vpn
- sql
- process
- kill
- tweak
- server load
- attack
- ddos mitigation
- Knowledge
- layer 7
- ddos
- webmail
- DMARC
- Development
- nginx
- seo vpn
- Hosting Security
- wireguard
- innodb
- exim
- smtp relay
- smtp
- VPS Hosting
- cpulimit
- Plesk
- Comparison
- cpu
- encryption
- WHM
- xampp
- sysstat
- optimize
- cheap vpn
- php-fpm
- mariadb
- apache
- Small Business
- Error
- Networking
- VPS
- SSD Hosting
- Link Building
- centos
- DNS
- optimization
- ubuntu