Confused by drive names hdb2[2]



I have raid set up on my linux computer.
I had a drive fail.

I ran mdadm -add /dev/md2 /dev/hda2

Which fixed the drive. For the moment. However I'm confused what [0]
or [1] or [2] means at the end of these drive descriptions in some
circumstances.

Fore example ... When I ran the command

cat /proc/mdstat
I get ....

[root@smclinux ~]# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 hda2[0] hdb2[1]
38973568 blocks [2/2] [UU]

md1 : active raid1 hda1[0] hdb1[1]
104320 blocks [2/2] [UU]

unused devices: <none>

But when i was rebuilding the drive with the first command mentioned
and then ran the command

# watch -n .1 cat /proc/mdstat (Which basically watches the rebuild)
I saw this ...

Every 0.1s: cat /proc/mdstat Tue Jan 31
15:24:05 2012

Personalities : [raid1]
md2 : active raid1 hda2[2] hdb2[1]
38973568 blocks [2/1] [_U]
[=>...................] recovery = 7.8% (3072384/38973568)
finish=40.1min speed=14912K/sec
md1 : active raid1 hda1[0] hdb1[1]
104320 blocks [2/2] [UU]

unused devices: <none>

I know this looks all very complex but really all Im interested in
understanding is what the [2] in the hda2 or [1] in hdb2.

I thought it meant the disk in the array, but that doesnt make sense
really. The system only has two drives. but now I see [0] [1] and [2]
thats 3 disks in the above printout . So I must be wrong. Can anyone
help me sort out what the [#] means and the end of the drive
description.

thanks.

.



Relevant Pages

  • [fwd] md raid1 chokes when one disk is removed
    ... (Was hoping to ask RedHat ... I like to give my system a bit of added resiliency with RAID1. ... Here's a capture of my Disk Druid: ... unused devices: ...
    (Fedora)
  • md raid1 chokes when one disk is removed
    ... Our boxes are SuperMicro 6018HT with dual SATA drives. ... I like to give my system a bit of added resiliency with RAID1. ... Here's a capture of my Disk Druid: ... unused devices: ...
    (RedHat)
  • Re: [opensuse] software raid missing a drive??
    ... linux:~ # cat /proc/mdstat ... Personalities: [raid1] ... it is a 2 disk raid running on 1 disk, ... unused devices: none. ...
    (SuSE)
  • [SLE] Whats wrong with my RAID1.
    ... unused devices: ... And this is when I use lsraid on md1 ... Is RAID1 not working anymore, ... if I remove one of the disk it will fail? ...
    (SuSE)
  • Re: New HDD Installation
    ... "John John" wrote: ... a single partition disk. ... confirm or change the active flag of the partition using the FDISK command. ... There are other ways to mark the partition active, either with a Windows ...
    (microsoft.public.windowsxp.general)