[TriLUG] Ubuntu FakeRAID or Software

Brian Blater brb.lists at gmail.com
Fri Nov 5 21:39:23 EDT 2010


> On Fri, Nov 5, 2010 at 9:28 AM, Jimmy Dorff <jdorff at phy.duke.edu> wrote:
>> On 11/05/2010 09:00 AM, Brian McCullough wrote:
>>>
>>> You might want to try setting the partition type correctly.
>>
>> Correct. Also populate /etc/mdadm.conf so your not relying on auto assembly.
>>
>> Once you have things running correctly, mdadm will print out your config in
>> the right format for the config file.
>>
>> -Jimmy

Ok, It can't be this difficult to setup a software RAID and have it
work after a reboot etc.

Tonight I get home and blow away all the partitions on the 4 drives
I'm using for the RAID. I recreate the partitions using type=fd for
linux raid member. I then create the array with:

# mdadm -C /dev/md0 -c 256 -l 5 -n 4 /dev/sdb2 /dev/sdc2 /dev/sdd2 /dev/sde2

and that works fine. I then assemble with:

# mdadm -A /dev/md0 /dev/sdb2 /dev/sdc2 /dev/sdd2 /dev/sde2

and it starts sync'ing. I format /dev/md0 with ext4 and mount the
partition to /data and I'm golden.

I then modify /etc/mdadm/mdadm.conf with:

ARRAY /dev/md0 UUID=d93fc355-4c3d-4733-6a23-c49e9513d009

hoping that will make it persistent. I reboot thinking all is great
only to find out that the array is not active.

# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5]
[raid4] [raid10]
md_d0 : inactive sdb2[0](S)
      36700416 blocks

unused devices: <none>

So, I run:
# mdadm -A --scan
mdadm: /dev/md0 has been started with 3 drives (out of 4)

Great, so now the array is degraded. So, I run:

# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5]
[raid4] [raid10]
md0 : active raid5 sdc2[1] sde2[3] sdd2[2]
      110101248 blocks level 5, 256k chunk, algorithm 2 [4/3] [_UUU]

md_d0 : inactive sdb2[0](S)
      36700416 blocks

unused devices: <none>

I guess that is telling me sdb2 is down. So, I fail /dev/md0 and
remove /dev/sdb2. Now if I try to re-add it to the array I get:

# mdadm /dev/md0 --re-add /dev/sdb2
mdadm: Cannot open /dev/sdb2: Device or resource busy

So, am I to assume there are problems with that hard drive? Is that
why I'm having so many problems making this work?

Why did it not automatically start the array after the reboot?

I'm getting frustrated, but I'm determined to make this work.

Thanks for being patient with me. I think my head is starting to hurt
from all this banging against the wall.

Brian



More information about the TriLUG mailing list