LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-21-2011, 07:28 PM   #1
Fmstrat
LQ Newbie
 
Registered: Jun 2011
Posts: 7

Rep: Reputation: Disabled
mdadm - RAID5 to RAID6, Spare won't become Active


Hi all,

I've been playing with this for hours, and have been unable to figure it out. I tried to convert my RAID5 array of 4 active disks and 1 spare to a RAID6 with 5 active disks.

I did this:

Code:
mdadm --grow /dev/md4 --raid-devices 5 --level 6
Here is what I have on /dev/md4:


Code:
/dev/sde1 active
/dev/sdg1 active
/dev/sdj1 active
/dev/sdf1 active
          removed
/dev/sdh5 spare
Code:
State: active, degraded, Not Started
I try the following commands:

Code:
mdadm --manage /dev/md4 --remove /dev/sdh5
mdadm --manage /dev/md4 --add /dev/sdh5
and it just adds it back as a spare. I then try:

Code:
mdadm --fail /dev/md4 /dev/sdh5
to see if it will reset any flags, and it says "/dev/sdh5 No Such Device". So, I tried to re-assemble by doing this:

Code:
mdadm --stop /dev/md4
mdadm --assemble --update=resync /dev/md4 /dev/sde1 /dev/sdg1 /dev/sdj1 /dev/sdf1 /dev/sdh5
but it tells me that /dev/sde is busy, and then that it has a bad superblock (From what I've read, I'm sure the bad superblock is just because of the "busy" message). I've tried this with the -f option, too, with no luck.

Where should I go from here?

Thanks,
B.
 
Old 06-21-2011, 07:53 PM   #2
Fmstrat
LQ Newbie
 
Registered: Jun 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
OK, I've tried a few other things, still no success.

Code:
mdadm --manage /dev/md4 --remove /dev/sdh5
mdadm --zero-superblock /dev/sdh5
fdisk /dev/sdh (delete partition, re-add)
mdadm --manage /dev/md4 --add /dev/sdh5
Still a spare. So I tried adding a whole new drive:

Code:
mdadm --manage /dev/md4 --remove /dev/sdh5
mdadm --manage /dev/md4 --add /dev/sdi1
But sdi1 is also labeled a spare.
 
Old 06-21-2011, 08:19 PM   #3
Fmstrat
LQ Newbie
 
Registered: Jun 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
And to add icing on the cake, I just tried to add the new drive WHILE the spare was already there, and now I have two spares. *sigh*
 
Old 06-21-2011, 08:49 PM   #4
Fmstrat
LQ Newbie
 
Registered: Jun 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
Sorry to keep posting in my own thread over and over again, but I rebooted and found another peice of potentially useful information. When booting, it says:

Code:
raid5: Failed to run raid set md4
mdadm: failed to start array /dev/md4: Input/output error
It seems to still think it's a raid5, even though mdadm --detail shows a raid6.
 
Old 06-21-2011, 08:54 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
Maybe this reading this will help (basically HOWTO for RAID conversions); it says you need 2 hot spares to grow from raid5 -> raid6 ... http://blog.serverhorror.com/2011/01...ux-with-mdadm/
 
Old 06-21-2011, 09:14 PM   #6
Fmstrat
LQ Newbie
 
Registered: Jun 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
Maybe this reading this will help (basically HOWTO for RAID conversions); it says you need 2 hot spares to grow from raid5 -> raid6 ... http://blog.serverhorror.com/2011/01...ux-with-mdadm/
Yup, I've tried with both spares, and get this:

Code:
[root@tvserver ~]# mdadm --grow /dev/md4 --raid-devices 6 --level 6
mdadm: Need to backup 1536K of critical section..
mdadm: /dev/md4: Cannot get array details from sysfs
 
Old 06-21-2011, 09:29 PM   #7
Fmstrat
LQ Newbie
 
Registered: Jun 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
It looks like the array needs to be running so that /sys/block/md4/md/stripe_cache_size will be created, and thats the reason for the sysfs problem.

However, I can't start the array because it's degraded..
 
Old 06-21-2011, 09:52 PM   #8
Fmstrat
LQ Newbie
 
Registered: Jun 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
OK, for anyone else who runs into this problem. I figured it out. It's an oddity with mdadm. I had to do the following:
  1. Conduct a fresh boot. For some reason if it wasn't a fresh boot before trying to do anything with md4, such as failing to assemble without --force, it would give me "in use" errors
  2. mdadm --stop /dev/md4
  3. mdadm --assemble --force /dev/md4 /dev/sde1 /dev/sdg1 /dev/sdi1 /dev/sdf1 /dev/sdj1

The array is currently rebuilding.

Thanks,
B.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Reshaping RAID5 array to RAID6 Ken Emerson Ubuntu 1 05-30-2011 05:30 PM
MDADM RAID5 coversion to RAID6 and drive sizes. kripz Linux - Server 2 12-03-2009 06:33 AM
RAID5 + spare assembles from different devices each boot jdavidow Linux - Hardware 4 01-09-2008 03:30 PM
RAID 5 with mdadm "spare" and "active sync" confusion ufmale Linux - Server 1 12-08-2007 10:31 AM
Raid5, wont use spare.. DigitalVixen Linux - Hardware 2 03-05-2005 12:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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