RAID 1 disk is marked as Spare after replacement

one of two disks in my RAID 1 died so I replaced it. When new disk has been added to array the sync process started and few minutes later it has become a Spare. How can I "force" the disk to be a regular part of an array?

# cat /proc/mdstat 
Personalities : [raid1] 
md0 : active raid1 sdb1[1] sda1[0]
  401472 blocks [2/2] [UU]

md1 : active raid1 sdb2[2](S) sda2[0]
  487982336 blocks [2/1] [U_]

unused devices: <none>

As you can see partition sdb1 is regular part of array md0. But sdb2 is marked as Spare and won't get added to md1.

The old disk was 500GB with 512B sectors and the new one is 1TB with 4KiB sector size. Can this be the root of the problem?

Old disk had the same geometry as sda. The new disk is sdb.

# fdisk -l /dev/sda

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000dda75

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63      803249      401593+  fd  Linux raid autodetect
/dev/sda2          803250   976768064   487982407+  fd  Linux raid autodetect

# fdisk -l /dev/sdb

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048      809343      403648   fd  Linux raid autodetect
/dev/sdb2          809344   976774159   487982408   fd  Linux raid autodetect

I have made sdb2 one block larger then sda2 (487982408 vs. 487982407+) So I assume all should be good.

It's Fedora 2.6.35.14-97.fc14.x86_64 I'll welcome any advice.

Thanks, Aas.


Solution 1:

I finaly found the root cause of the sync problem. It was because the other disk had some bad blocks so the sync process failed at some point. I created new md2 device and added it to vg00 as a new PV. Then pvmove all data off the bad md1 array, destroyed it, rebuilt initrd, removed the second disk and booted up off the new one. Thank you for support. I hope this helps someone.