Schimbare disk failed in raid Linux

By C December 13, 2015

In cele ce urmeaza voi posta pasii si comenzile de urmat in vederea schimbarii unui hard-disk aflat in RAID 1 software LINUX, care are pe el sectoare bad, sau pending-uri. In exemplul urmator trebuie schimbat sda-ul :

  1. Ne asiguram ca avem grub-ul instalat pe toate disk-urile :

#grub-install /dev/sdx (sdb, sdc, sdd)

2. Marcam ca si failed disk-ul dupa care il scoatem din fiecare partitie RAID :

#mdadm –manage /dev/md0 –fail /dev/sda1

#mdadm –manage /dev/md0 –remove /dev/sda1


#mdadm –manage /dev/md1 –fail /dev/sda2

#mdadm –manage /dev/md1 –remove /dev/sda2


#mdadm –manage /dev/md2 –fail /dev/sda3

#mdadm –manage /dev/md2 –remove /dev/sda3

3. Scoatem disk-ul fizic din server si introducem disk-ul nou.

4. Verificam daca sistemul de operare l-a vazut tot ca si sda sau ca si alt nume (ex. sde . In continuare se merge cu noul nume al disk-ului, iar in cazul de fata ramane sda) :

#fdisk -l (cu aceasta comanda verificam numele disk-ului adaugat)

5. Verificam daca apar cumva alte partitii RAID fata de cele pe care le aveam initial. In cazul in care apar le oprim :

#mdstat – vedem ce partitii avem. Ca si exemplu, ne apare partitia md127 pe care nu o aveam anterior. Aceasta trebuie oprita dupa cum urmeaza :

#mdadm –manage /dev/md127 –stop

6. Daca disk-ul nu este nou, stergem primii 512 biti de pe el :

#dd if=/dev/zero of=/dev/sda bs=512 count=2

7. Copiem informatia de boot de pe sdb pe sda :

#sfdisk -d /dev/sdb | sfdisk /dev/sda –force

8. Adaugam disk-ul in RAID :

#mdadm –manage /dev/md0 –add /dev/sda1

#mdadm –manage /dev/md1 –add /dev/sda2

#mdadm –manage /dev/md2 –add /dev/sda3

9. Verificam daca se reface RAID-ul.

#cat /proc/mdstat

In cazul in care apare o eroare de genul “mdadm: /dev/sda3 not large enough to join array” la adaugare, scoatem din RAID partitiile pe care le-am adaugat si copiem informatia de boot de pe alt disk, de exemplu sdc :

# sfdisk -d /dev/sdc | sfdisk /dev/sda –force


Succes !


  nd, aunt, we can only calm PRINCE2 PRINCE2-PRACTITIONER Exam Dumps down in the face of the past What s more, the surname is often three times, three times Let a woman get pregnant, sometimes only once is enough What Advise Xiaoyan to abort But what if this is really a bloody bone The ancestors will also blame Are people not willing to be rich You give me a random explanation, Xiao Xiao shook his head.

The three flat PRINCE2 Practitioner PRINCE2-PRACTITIONER melons saw that Liu Haizhu s PRINCE2 Practitioner PRINCE2-PRACTITIONER Exam Dumps mental head seemed to be wrong, so PRINCE2-PRACTITIONER Exam Dumps he took Liu Haizhu from the car PRINCE2 PRINCE2-PRACTITIONER Exam Dumps and he PRINCE2 PRINCE2-PRACTITIONER Exam Dumps went to buy pig s head meat. Write something Write poetry No, I don t know how to write poetry. Li four speak. In fact, since Li Si heard Li Yang s pleading, he has made up his mind not to move Li Wu.


Tags: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You're not a robot ! *