mdadm: ADD_NEW_DISK failed: Invalid argument

mdadm: ADD_NEW_DISK failed: Invalid argument

am 04.02.2011 01:31:19 von Jon Forrest

(I see that other people have had this problem
but not in the same situation as me. Mine
is probably as simple as you can get).

I'm learning about how to manage software raid
by using loopback devices on a RHEL6 system
(2.6.32-71.14.1.el6.i686).

I create two loopback devices thusly:

# dd if=/dev/zero of=file0 bs=1k count=100
100+0 records in
100+0 records out
102400 bytes (102 kB) copied, 0.000689998 s, 148 MB/s
# cp file0 file1
# losetup /dev/loop0 file0
# losetup /dev/loop1 file1

I can create a RAID1 volume with no problems:

# mdadm --create /dev/md0 --raid-device=2 --level=1 /dev/loop0 /dev/loop1
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.

However, doing the same thing but creating a RAID0 volume
fails thusly:

# dd if=/dev/zero of=file2 bs=1k count=100
100+0 records in
100+0 records out
102400 bytes (102 kB) copied, 0.000699377 s, 146 MB/s
# cp file2 file3
# losetup /dev/loop2 file2
# losetup /dev/loop3 file3
# mdadm --create /dev/md1 --raid-device=2 --level=0 /dev/loop2 /dev/loop3
mdadm: Defaulting to version 1.2 metadata
mdadm: ADD_NEW_DISK for /dev/loop2 failed: Invalid argument

I don't understand what went wrong? Any ideas?

Cordially,
--
Jon Forrest
Research Computing Support
College of Chemistry
173 Tan Hall
University of California Berkeley
Berkeley, CA
94720-1460
510-643-1032
jlforrest@berkeley.edu

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: mdadm: ADD_NEW_DISK failed: Invalid argument

am 04.02.2011 01:45:20 von mathias.buren

On 4 February 2011 00:31, Jon Forrest wrote:
> (I see that other people have had this problem
> but not in the same situation as me. Mine
> is probably as simple as you can get).
>
> I'm learning about how to manage software raid
> by using loopback devices on a RHEL6 system
> (2.6.32-71.14.1.el6.i686).
>
> I create two loopback devices thusly:
>
> # dd if=3D/dev/zero of=3Dfile0 bs=3D1k count=3D100
> 100+0 records in
> 100+0 records out
> 102400 bytes (102 kB) copied, 0.000689998 s, 148 MB/s
> # cp file0 file1
> # losetup /dev/loop0 file0
> # losetup /dev/loop1 file1
>
> I can create a RAID1 volume with no problems:
>
> # mdadm --create /dev/md0 --raid-device=3D2 --level=3D1 /dev/loop0 /d=
ev/loop1
> mdadm: Defaulting to version 1.2 metadata
> mdadm: array /dev/md0 started.
>
> However, doing the same thing but creating a RAID0 volume
> fails thusly:
>
> # dd if=3D/dev/zero of=3Dfile2 bs=3D1k count=3D100
> 100+0 records in
> 100+0 records out
> 102400 bytes (102 kB) copied, 0.000699377 s, 146 MB/s
> # cp file2 file3
> # losetup /dev/loop2 file2
> # losetup /dev/loop3 file3
> # mdadm --create /dev/md1 --raid-device=3D2 --level=3D0 /dev/loop2 /d=
ev/loop3
> mdadm: Defaulting to version 1.2 metadata
> mdadm: ADD_NEW_DISK for /dev/loop2 failed: Invalid argument
>
> I don't understand what went wrong? Any ideas?
>
> Cordially,
> --
> Jon Forrest
> Research Computing Support
> College of Chemistry
> 173 Tan Hall
> University of California Berkeley
> Berkeley, CA
> 94720-1460
> 510-643-1032
> jlforrest@berkeley.edu
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid"=
in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.ht=
ml
>

I just tried this on Ubuntu 10.10 and I got this:

sudo mdadm --create /dev/md0 --raid-device=3D2 --level=3D1 /dev/loop0 /=
dev/loop1
mdadm: /dev/loop0 is too small: 100K
mdadm: /dev/loop1 is too small: 100K
mdadm: create aborted


mdadm - v2.6.7.1 - 15th October 2008
2.6.35-26-generic

// Mathias
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" i=
n
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: mdadm: ADD_NEW_DISK failed: Invalid argument

am 04.02.2011 03:10:28 von NeilBrown

On Thu, 03 Feb 2011 16:31:19 -0800 Jon Forrest wrote:

> (I see that other people have had this problem
> but not in the same situation as me. Mine
> is probably as simple as you can get).
>
> I'm learning about how to manage software raid
> by using loopback devices on a RHEL6 system
> (2.6.32-71.14.1.el6.i686).
>
> I create two loopback devices thusly:
>
> # dd if=/dev/zero of=file0 bs=1k count=100
> 100+0 records in
> 100+0 records out
> 102400 bytes (102 kB) copied, 0.000689998 s, 148 MB/s
> # cp file0 file1
> # losetup /dev/loop0 file0
> # losetup /dev/loop1 file1
>
> I can create a RAID1 volume with no problems:
>
> # mdadm --create /dev/md0 --raid-device=2 --level=1 /dev/loop0 /dev/loop1
> mdadm: Defaulting to version 1.2 metadata
> mdadm: array /dev/md0 started.
>
> However, doing the same thing but creating a RAID0 volume
> fails thusly:
>
> # dd if=/dev/zero of=file2 bs=1k count=100
> 100+0 records in
> 100+0 records out
> 102400 bytes (102 kB) copied, 0.000699377 s, 146 MB/s
> # cp file2 file3
> # losetup /dev/loop2 file2
> # losetup /dev/loop3 file3
> # mdadm --create /dev/md1 --raid-device=2 --level=0 /dev/loop2 /dev/loop3
> mdadm: Defaulting to version 1.2 metadata
> mdadm: ADD_NEW_DISK for /dev/loop2 failed: Invalid argument
>
> I don't understand what went wrong? Any ideas?

Probably chunk size is larger than your 100k devices.

Try:

mdadm --create /dev/md1 --raid-devices=2 --level=0 --metadata=1.0
--chunksize=4 ....

The metadata=1.0 causes the least amount of space to be used for metadata.

OR just make much larger files. Surely you can spare a few meg??

NeilBrown


>
> Cordially,

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: mdadm: ADD_NEW_DISK failed: Invalid argument

am 04.02.2011 18:02:25 von Jon Forrest

On 2/3/2011 6:10 PM, NeilBrown wrote:

> Probably chunk size is larger than your 100k devices.
>
> Try:
>
> mdadm --create /dev/md1 --raid-devices=2 --level=0 --metadata=1.0
> --chunksize=4 ....
>
> The metadata=1.0 causes the least amount of space to be used for metadata.

That worked (should be --bitmap-chunk instead of --chunksize).

> OR just make much larger files. Surely you can spare a few meg??

Absolutely. My point is just that a failure such as this
should result in a meaningful error message.
Ironically, mdadm seems to have regressed.
On Ubuntu 10.10, which uses version 2.6.7.1 of
mdadm I see the kind of error message I'd expect, e.g.

mdadm: /dev/loop0 is too small: 100K
mdadm: /dev/loop1 is too small: 100K

However, on RHEL6, which uses the newer version 3.1.3 of
mdadm, I get

mdadm: ADD_NEW_DISK for /dev/loop2 failed: Invalid argument

This looks like a regression to me.

I'd agree that what I'm doing is unrealistic. I was
just preparing a document about how to use mdadm so
I didn't need large volumes. But, it would be nice
if the latest version of mdadm did what earlier
versions did.

Cordially,
--
Jon Forrest
Research Computing Support
College of Chemistry
173 Tan Hall
University of California Berkeley
Berkeley, CA
94720-1460
510-643-1032
jlforrest@berkeley.edu
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html