LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-25-2012, 10:43 AM   #1
C4talyst
LQ Newbie
 
Registered: Oct 2009
Posts: 10

Rep: Reputation: 0
RAID 1 Device Number Question (CentOS 6.2)


Hello,

I have a fileserver running CentOS 6.2 that uses mdadm for RAID. A drive failed this week and I replaced it. However, when replacing it, I did not first mark the drive as failed before it was removed from the array. The new drive was added without issue, however, when I review the data in /proc/mdstat, the device number for the new drive is 2, instead of 1.

Here's the output; the part I'm referring to is bolded:

Code:
[root@stormsilo etc]# more /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdb1[2] sda1[0]
      204788 blocks super 1.0 [2/2] [UU]

md1 : active raid1 sda2[0]
      1048568 blocks super 1.1 [2/1] [U_]

md2 : active raid1 sda3[0]
      487131004 blocks super 1.1 [2/1] [U_]
      bitmap: 3/4 pages [12KB], 65536KB chunk

unused devices: <none>
How can I get my array to see the sdb drive as device 1 again?
 
Old 02-26-2012, 11:50 AM   #2
C4talyst
LQ Newbie
 
Registered: Oct 2009
Posts: 10

Original Poster
Rep: Reputation: 0
134 views and I thought this was going to be an easy one! :^ D
 
Old 02-27-2012, 10:21 AM   #3
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
The 2 will mark the role of the drive in the array, i.e. it looks like it’s treated like a hot-spare. So the question is, how to convert a hot-spare to a normal member.
 
Old 02-27-2012, 08:24 PM   #4
brak44
Member
 
Registered: Aug 2010
Location: Brisbane Australia
Distribution: Centos, Fedora
Posts: 87

Rep: Reputation: 24
You might want to have a look at
http://bugs.centos.org/view.php?id=5549
This behaviour of incrementing the Number instead of making it 0 as per the following example is new for mdadm.
I'm unsure whether it is intentional or a minor bug.

[root@localhost ~]# mdadm -V
mdadm - v3.2.2 - 17th June 2011
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdb1[1]
204788 blocks super 1.0 [2/1] [_U]

md2 : active raid1 sdb3[1] sda3[0]
308266876 blocks super 1.1 [2/2] [UU]
bitmap: 2/3 pages [8KB], 65536KB chunk

md1 : active raid1 sdb2[1] sda2[0]
4094968 blocks super 1.1 [2/2] [UU]

unused devices: <none>
[root@localhost ~]# mdadm /dev/md0 --add /dev/sda1
mdadm: /dev/sda1 reports being an active member for /dev/md0, but a --re-add fails.
mdadm: not performing --add as that would convert /dev/sda1 in to a spare.
mdadm: To make this a spare, use "mdadm --zero-superblock /dev/sda1" first.
[root@localhost ~]# mdadm --zero-superblock /dev/sda1
[root@localhost ~]# mdadm /dev/md0 --add /dev/sda1
mdadm: added /dev/sda1
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda1[2] sdb1[1]
204788 blocks super 1.0 [2/2] [UU]

md2 : active raid1 sdb3[1] sda3[0]
308266876 blocks super 1.1 [2/2] [UU]
bitmap: 2/3 pages [8KB], 65536KB chunk

md1 : active raid1 sdb2[1] sda2[0]
4094968 blocks super 1.1 [2/2] [UU]
 
Old 02-27-2012, 09:41 PM   #5
brak44
Member
 
Registered: Aug 2010
Location: Brisbane Australia
Distribution: Centos, Fedora
Posts: 87

Rep: Reputation: 24
It's related to mdadm version 3.2.2

Same test with version 3.2.1
[root@localhost ~]# mdadm -V
mdadm - v3.2.1 - 28th March 2011
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sda3[0] sdb3[1]
308266876 blocks super 1.1 [2/2] [UU]
bitmap: 1/3 pages [4KB], 65536KB chunk

md1 : active raid1 sda2[0] sdb2[1]
4094968 blocks super 1.1 [2/2] [UU]

md0 : active raid1 sda1[0] sdb1[1]
204788 blocks super 1.0 [2/2] [UU]

unused devices: <none>
[root@localhost ~]# mdadm /dev/md0 --fail /dev/sdb1
mdadm: set /dev/sdb1 faulty in /dev/md0
[root@localhost ~]# mdadm /dev/md0 --remove /dev/sdb1
mdadm: hot removed /dev/sdb1 from /dev/md0
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sda3[0] sdb3[1]
308266876 blocks super 1.1 [2/2] [UU]
bitmap: 0/3 pages [0KB], 65536KB chunk

md1 : active raid1 sda2[0] sdb2[1]
4094968 blocks super 1.1 [2/2] [UU]

md0 : active raid1 sda1[0]
204788 blocks super 1.0 [2/1] [U_]

unused devices: <none>
[root@localhost ~]# mdadm /dev/md0 --add /dev/sdb1
mdadm: re-added /dev/sdb1
You have new mail in /var/spool/mail/root
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sda3[0] sdb3[1]
308266876 blocks super 1.1 [2/2] [UU]
bitmap: 1/3 pages [4KB], 65536KB chunk

md1 : active raid1 sda2[0] sdb2[1]
4094968 blocks super 1.1 [2/2] [UU]

md0 : active raid1 sdb1[1] sda1[0]
204788 blocks super 1.0 [2/2] [UU]

unused devices: <none>
 
Old 02-28-2012, 08:15 AM   #6
C4talyst
LQ Newbie
 
Registered: Oct 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Reuti View Post
The 2 will mark the role of the drive in the array, i.e. it looks like it’s treated like a hot-spare. So the question is, how to convert a hot-spare to a normal member.
I don't think it's being marked as a hot spare. The /proc/mdstat output indicates that the mirror is operating normally. When I replaced the drive, I didn't remove the old drive from the array first. Had I done that, I'm thinking the new drive would have been listed as 1 when it was added.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i change my sendmail port number in centos 5.4 saravanakumar Linux - Server 2 08-04-2011 10:40 AM
Problem with network and RAID on Centos 5.2 and Centos 5.4 thesirwolf Linux - Hardware 1 04-02-2010 11:47 AM
CentOS 5.2 Mirrored RAID error and general question nino90 Linux - Hardware 3 01-07-2009 12:36 PM
CentOS 4.3 LInux Raid 1 Losing OS Raid member Sigkill(9) Linux - Hardware 1 09-13-2008 11:01 PM
What is the device alias number? ukrainet Linux - Newbie 4 02-11-2005 06:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:24 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