LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   query on mdadm for support of adding a disk to a running linear array (http://www.linuxquestions.org/questions/linux-software-2/query-on-mdadm-for-support-of-adding-a-disk-to-a-running-linear-array-786102/)

anuragccsu 02-01-2010 12:09 AM

query on mdadm for support of adding a disk to a running linear array
 
Hi All,

I am using mdadm 2.6.4 for managing RAIDs on Linux kernel 2.6.18. I've a query like whenever i tried to add a new disk to a running linear array(JBOD)i get a message "cannot add new disk to this array"

The exact steps are as follows:
create a new array as:
mdadm -C /dev/md0 -llinear -n2 /dev/sata/ /dev/sata2

it is getting added and i am able to see with -D command.

Now add a new disk sata3 as follows:

mdadm --grow /dev/md0 --add /dev/sata3 I get the output as:

md: sdb has invalid sb, not importing!
md: md_import_device returned -22
mdadm: cannot add new disk to this array.

So my first doubt is whether mdadm 2.6.4 supports this features or not if it supports then do i need to change the driver?

Please help!

macemoneta 02-02-2010 02:23 AM

It's saying that the superblock on sdb (the device you're adding, I suspect) is not valid for the operation. Prior to adding a drive to a RAID, I usualy:

Code:

dd if=/dev/zero of=/dev/xxx bs=512 count=1000
Then fdisk or parted/gparted to initialize. This makes sure the system doesn't pick up any stray old superblocks.

anuragccsu 02-03-2010 02:54 AM

Hi above,
thanks for your reply, i tried in the way you suggested but still the problem is same.
one more thing i've found out is that if we check this runnig array disk support for other RAID levels as i checked it for RAID5 it is adding the new disk to the runnig array as "spare", so is this what we mean by Hotadd or the new disk can be added as a active disk to the runnig array in any RAID level?
Thanks

macemoneta 02-03-2010 03:50 AM

I created a linear two drive array:

Code:

fdisk /dev/sdb
n,1,enter,enter,t,1,fd,w

fdisk /dev/sdc
n,1,enter,enter,t,1,fd,w

mdadm -C /dev/md0 -llinear -n2 /dev/sdb1 /dev/sdc1

cat /proc/mdstat:
Personalities : [linear]
md0 : active linear sdc1[1] sdb1[0]
      192512 blocks 64k rounding
     
unused devices: <none>

Next, I created a third device:

Code:

fdisk /dev/sdd
n,1,enter,enter,t,1,fd,w

I then added it to the array:

Code:

mdadm --grow /dev/md0 --add /dev/sdd1

cat /proc/mdstat:
Personalities : [linear]
md0 : active linear sdd1[2] sdc1[1] sdb1[0]
      288768 blocks 64k rounding
     
unused devices: <none>

There were no problems, using:

mdadm-3.0.3-2.fc12.x86_64
kernel-2.6.32.7-37.fc12.x86_64

You might want to recheck your steps, or update your software.


All times are GMT -5. The time now is 12:02 PM.