LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-26-2020, 01:28 PM   #1
giobaxx
Member
 
Registered: Jul 2013
Posts: 37

Rep: Reputation: Disabled
rebuild Raid 1 after disk failure


Hello Guys



I need some help because I will have to replace a disk in a Linux Workstation and rebuild its Software Raid1. For Sure before start I will run a full data backup but I never did a RAID repair, so I need to be sure about the step I have to follow. The system should be configured like below, could you tell me if the procedure i wrote is correct or no:



Quote:

md0 /dev/sda1 + /dev/sdb1 where is mounted the Swap Partition



md1 /dev/sda2 + /dev/sdb2 where is mounted the / Partition



md2 /dev/sda3 + /dev/sdb3 where is mounted the Swap Partition




I have sda2 that is marked as failed I have to replace I need to mark all the partition /dev/sdb as failed



m
Quote:
dadm --manage /dev/md0 --fail /dev/sdb1



mdadm --manage /dev/md1 --fail /dev/sdb2



mdadm --manage /dev/md2 --fail /dev/sdb3




then I will remove all the partition from the raid:



Quote:
mdadm --manage /dev/md0 --remove /dev/sdb1



mdadm --manage /dev/md1 --remove /dev/sdb2



mdadm --manage /dev/md2 –remove /dev/sdb3


Then I shut down the system and I will replace the disk where I have to create the same partition type I have in sda



Quote:
sfdisk -d /dev/sda | sfdisk /dev/sdb




and then I will add the partition to the raid system



Quote:
mdadm --manage /dev/md0 --add /dev/sdb1



mdadm --manage /dev/md1 --add /dev/sdb2



mdadm --manage /dev/md2 –add /dev/sdb3




Is it correct what I wrote? I hope yes, now what it make me more concerned if the RAID software needs boot in UEFI mode. If I remember well in this case I should have a standard Partition /boot/efi and I hould have a situation like this



/
Quote:
dev/sda1 Where is Mounted /boot/efi



md0 /dev/sda2 + /dev/sdb2 where is mounted the Swap Partition



md1 /dev/sda3 + /dev/sdb3 where is mounted the /



md2 /dev/sda4 + /dev/sdb4 where is mounted /Home


Now If the broken disk were sda we need to repair not only the Raid partitions but also reinstall the /dev/sda1 with the efi partition to make the system bootable again. In this case there is a way to proceed?





Thanks in Advance.

Gio
 
Old 04-26-2020, 01:47 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,337

Rep: Reputation: 1332Reputation: 1332Reputation: 1332Reputation: 1332Reputation: 1332Reputation: 1332Reputation: 1332Reputation: 1332Reputation: 1332Reputation: 1332
You should install a copy of the bootloader and efi partition on drive sdb so that if sda fails you can remove it and boot from sdb. The copy will not be managed by RAID, but it seldom changes so you can manage it yourself.

In your description, you say sda2 is failed. Do you mean sdb2? Make sure you know which drive has failed by issuing read commands to the drive. Also make very sure you know which physical drive it is in the system by observing the disk select lights. Your steps are correct if sdb is the failed drive.
 
Old 04-26-2020, 07:18 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,414

Rep: Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197
Presumes the system will boot with the RAID in degraded mode. The initrd in most distros should handle it ok, but I recall Debian not having the logic in there for quite a while - hopefully they also have it sorted by now.
In need you could always use a liveUSB.
 
  


Reply

Tags
raid1


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Failure after failure after failure.....etc 69Rixter Linux - Laptop and Netbook 5 04-14-2015 09:58 AM
Rebuild from RAID-6 2-disk simultaneous failure politenessTKY Linux - Newbie 3 10-17-2012 07:33 PM
ICP raid controller, no automatic rebuild of raid 5 after replacing bad disk auclark@wsu.edu Linux - Newbie 3 12-14-2009 10:54 AM
[SOLVED] Software RAID (mdadm) - RAID 0 returns incorrect status for disk failure/disk removed Marjonel Montejo Linux - General 4 10-04-2009 06:15 PM
replace failure disk and rebuild RAID with mdadm ufmale Linux - Software 0 11-15-2007 02:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration