Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Determine RAID level of disk in RAID 10
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
onkelfusspilz
Tux's lil' helper
Tux's lil' helper


Joined: 26 Aug 2002
Posts: 130
Location: Germany

PostPosted: Thu Apr 14, 2016 10:12 am    Post subject: Determine RAID level of disk in RAID 10 Reply with quote

Hi,

I have a RAID 10 with 4 disks.
Code:
cat /proc/mdstat
tells me that one of the disks are failed. I did a SMART check on the other disks and I have some warnings on one of them. Now I want to replace two disks.
If the two disks with error or warning state are in one stripe-set (RAID 0), I should be able to remove both of them, replace them and do a resync, right? If the disks are members of each mirrored stripe set, both of them would fail and so would the whole RAID 1.

Is there a chance to find out if I can remove these two disks at the same time?
The rebuild would be needed only once instead of two times, saving me a lot of time.

Kind regards

Andreas
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2970
Location: Germany

PostPosted: Thu Apr 14, 2016 11:48 am    Post subject: Reply with quote

So you want to do it in one go, right?

Code:
mdadm /dev/md1 --add /dev/newdisk1 /dev/newdisk2 --replace /dev/failingdisk1
Back to top
View user's profile Send private message
onkelfusspilz
Tux's lil' helper
Tux's lil' helper


Joined: 26 Aug 2002
Posts: 130
Location: Germany

PostPosted: Thu Apr 14, 2016 2:36 pm    Post subject: Reply with quote

frostschutz wrote:
So you want to do it in one go, right?

Code:
mdadm /dev/md1 --add /dev/newdisk1 /dev/newdisk2 --replace /dev/failingdisk1


Basically: Yes. But since I don't have additional free ports/bays for harddisks on this particular machine, I need to remove the drive(s), shut the machine down, replace them and add the new disks to the RAID10 array. I would prefer to replace the two disks in one step, but I need to make sure that I remain with a valid stripeset while removing the disks.

Would mdadm give me a warning when I try to remove a disk and this action would degrade the array?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43208
Location: 56N 3W

PostPosted: Thu Apr 14, 2016 4:41 pm    Post subject: Reply with quote

onkelfusspilz,

You could try running a repair before you do the replacement.
If the repair works, your raid will appear to be good again. mdadm will read the raid set and copy data that fails to read on one part of the mirror from the other part of the mirror.

This normally causes the failed sector to be relocated.

You get into trouble if you have a failed sector in the same place on both parts of the mirror, or if sector relocation takes so long, the kernel decides that the drive has gone offline.
Then it gets kicked out of the array.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2970
Location: Germany

PostPosted: Thu Apr 14, 2016 6:13 pm    Post subject: Reply with quote

For a definite answer, please show mdadm --detail /dev/md?? and mdadm --examine /dev/sd?? for this RAID.

The huge advantage of --replace is that it kicks the to-be-replaced disk out only after the new disk is fully populated; until then the old disk may help serve data for the new disk. Thus --replace may succeed in cases where regular old fail/remove/add might not.

If you can't replace both at once due to lack of slots (USB3 might work) then I'd just --replace first and then add the new disk, never mind that you have to rebuild twice to do so. Rebuilding just takes time, failing to rebuild loses data.

You can grow a RAID10 array to RAID0 and it will kick out the redundancy disks for you, this is a fool proof way to not kick out an essential disk out of a RAID10 array, however you don't get to choose which disk to keep this way. You simply lose redundancy.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum