LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   mdadm - RAID5 to RAID6, Spare won't become Active (https://www.linuxquestions.org/questions/linux-general-1/mdadm-raid5-to-raid6-spare-wont-become-active-887628/)

Fmstrat 06-21-2011 07:28 PM

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.

Fmstrat 06-21-2011 07:53 PM

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.

Fmstrat 06-21-2011 08:19 PM

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*

Fmstrat 06-21-2011 08:49 PM

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.

chrism01 06-21-2011 08:54 PM

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/

Fmstrat 06-21-2011 09:14 PM

Quote:

Originally Posted by chrism01 (Post 4392299)
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


Fmstrat 06-21-2011 09:29 PM

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..

Fmstrat 06-21-2011 09:52 PM

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.


All times are GMT -5. The time now is 05:08 PM.