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 10-24-2011, 05:28 AM   #1
aasami
LQ Newbie
 
Registered: Apr 2011
Posts: 19

Rep: Reputation: 2
Question RAID 1 disk is maked as Spare after replacement


Hi, 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?

Code:
# 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.
Code:
# 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
Code:
# 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.
 
Old 10-24-2011, 07:43 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Did you follow the correct procedure?
 
0 members found this post helpful.
Old 10-24-2011, 10:19 AM   #3
aasami
LQ Newbie
 
Registered: Apr 2011
Posts: 19

Original Poster
Rep: Reputation: 2
Exclamation md0 is synced unlike md1 what does it mean?

Yes, that's what I've done. Except I haven't done sfdisk because the drives are not identical. So I partitioned the drive manualy to align partitions with physical sectors.

But I've noticed one interresting thing: "Note that in Linux Software RAID you can create RAID Arrays by mirroring partitions and not entire disks."

This is imortatnt, because md0 is synced OK. So this has nothing to do with 4k sectors I assumed previously.

Thank you for the link.

Are there any other ideas that might help?

I have tried to mark sdb2 as failed and readd it, but nothing changed.
 
Old 10-26-2011, 09:51 AM   #4
aasami
LQ Newbie
 
Registered: Apr 2011
Posts: 19

Original Poster
Rep: Reputation: 2
Unhappy Lost in the dark.

I haven't found any clues that might suggest why this partition become a "spare".
Please any advice where may I look? There are precious customer's data in the RAID.

Any advice is welcome here.

Thaks. Aas.
 
Old 10-26-2011, 11:00 AM   #5
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
The procedure has always worked, both for me and others, as far as I'm aware. Are you sure you didn't skip any steps?
 
0 members found this post helpful.
Old 11-02-2011, 02:23 AM   #6
aasami
LQ Newbie
 
Registered: Apr 2011
Posts: 19

Original Poster
Rep: Reputation: 2
Unhappy

Except sfdisk, no. As I've said before, I had to manually partition the new drive because of it's 4KiB sector size, to align partitions to physical sectors.

Maybe it is because of the new 4KiB sector size disk, but I just can't figure out why this could be a problem or how to get it working. This is not my first disk replacement and it worked well every other time. So I assume the cause is the new disk's geometry.
 
Old 11-02-2011, 02:54 AM   #7
lqman
LQ Newbie
 
Registered: Nov 2010
Location: Surabaya, Indonesia
Distribution: debian, ubuntu, FreeBSD, Solaris
Posts: 17

Rep: Reputation: 3
Quote:
So I assume the cause is the new disk's geometry.
I agree with U.
U must create the partition scheme identically to make RAID type1 works corectly.

Try not to skip the sfdisk step.
 
0 members found this post helpful.
Old 12-29-2011, 03:48 AM   #8
aasami
LQ Newbie
 
Registered: Apr 2011
Posts: 19

Original Poster
Rep: Reputation: 2
Lightbulb Solved

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 the support.
I hope this helps someone.
 
  


Reply

Tags
disk, failed, fedora 14, raid1, replacement



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
[SOLVED] Raid 1 Disk Replacement not working frankkky Linux - Hardware 8 09-27-2010 09:02 AM
Intel ICH10R with 6xSATA RAID 5 with 1 spare disk Laodiceans Slackware 1 08-05-2010 12:21 PM
Setup RAID 5 + 1 spare disk Laodiceans Linux - General 1 08-05-2010 03:17 AM
Failed disk replacement - RAID 1 madia Linux - Hardware 1 06-28-2007 09:17 AM

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

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