Skip to contentSkip to conversation

Invalid argument when creating a RAID-0 array

DISCUSSION Ari Pollak 3 participants 4 messages Jun 14, 2003 – Jun 15, 2003 MD RAID

lore
Share & tools
lore

Ari Pollak

author
#0 lore raw

[Please CC me on replies]

I am currently trying to create a RAID-0 array using 5 SCSI drives with raidtools2 on Debian but it is failing. Any input would be appreciated. When I run 'mkraid /dev/md0', I get the following:

$ sudo mkraid /dev/md0
handling MD device /dev/md0
analyzing super-block
disk 0: /dev/sdb1, 4190400kB, raid superblock at 4190336kB
disk 1: /dev/sdc1, 4190400kB, raid superblock at 4190336kB
disk 2: /dev/sdd1, 4190400kB, raid superblock at 4190336kB
disk 3: /dev/sde1, 4180722kB, raid superblock at 4180608kB
disk 4: /dev/sdf1, 4190400kB, raid superblock at 4190336kB
/dev/md0: Invalid argument

Doing an strace of it gives the following reason for the Invalid argument:

open("/dev/md0", O_RDWR)                = 4
ioctl(4, 0x800c0930, 0xeffff7d8)        = -1 EINVAL (Invalid argument)
dup(2)                                  = 5
nfssvc(0x5)                             = 2

fstat64(5, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7001e000
_llseek(5, 0, 0xeffff4a0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(5, "/dev/md0: Invalid argument\n", 27/dev/md0: Invalid argument
) = 27

Contents of my /etc/raidtab:
raiddev /dev/md0
raid-level 0
nr-raid-disks 5
persistent-superblock 1
chunk-size 4
device /dev/sdb1
raid-disk 0
device /dev/sdc1
raid-disk 1
device /dev/sdd1
raid-disk 2
device /dev/sde1
raid-disk 3
device /dev/sdf1
raid-disk 4

Contents of /proc/mdstat:
Personalities : [raid0]
read_ahead not set
unused devices: <none>

kernel messages after running mkraid:
md: bind<sdb1,1>
md: bind<sdc1,2>
md: bind<sdd1,3>
md: bind<sde1,4>
md: bind<sdf1,5>
md: sdf1's event counter: 00000000
md: sde1's event counter: 00000000
md: sdd1's event counter: 00000000
md: sdc1's event counter: 00000000
md: sdb1's event counter: 00000000
too small chunk_size: 4096 < 8192
md: md0 stopped.
md: unbind<sdf1,4>
md: export_rdev(sdf1)
md: unbind<sde1,3>
md: export_rdev(sde1)
md: unbind<sdd1,2>
md: export_rdev(sdd1)
md: unbind<sdc1,1>
md: export_rdev(sdc1)
md: unbind<sdb1,0>
md: export_rdev(sdb1)

#1 lore raw
Quoted 6 lines · On Saturday June 14, [email protected] wrote:

[Please CC me on replies]

I am currently trying to create a RAID-0 array using 5 SCSI drives with raidtools2 on Debian but it is failing. Any input would be appreciated. When I run 'mkraid /dev/md0', I get the following:

....

Quoted 1 line

chunk-size 4

....

Quoted 1 line

too small chunk_size: 4096 < 8192

Maybe use a bigger chunk size, 4K is rather small. However I thought 4k would work. Maybe you aren't using an i386, as the minimum chunksize is currently connected with the system pagesize. What architecture are you using?

NeilBrown

author
#2 lore raw
Quoted 9 lines
Quoted 3 lines

[Please CC me on replies]

too small chunk_size: 4096 < 8192

Maybe use a bigger chunk size, 4K is rather small. However I thought 4k would work. Maybe you aren't using an i386, as the minimum chunksize is currently connected with the system pagesize. What architecture are you using?

Oops, I forgot to specify. I'm using an UltraSPARC on a Sun Enterprise 450, using kernel 2.4.19 (I haven't had a chance to try .21 yet). I was just following the Software-RAID HOWTO, which said that for striping, chunksize didn't really matter.

#3 lore raw

Hi Ari.

Quoted 11 lines
Quoted 6 lines
Quoted 1 line

too small chunk_size: 4096 < 8192

Maybe use a bigger chunk size, 4K is rather small. However I thought 4k would work. Maybe you aren't using an i386, as the minimum chunk size is currently connected with the system page size. What architecture are you using?

Oops, I forgot to specify. I'm using an UltraSPARC on a Sun Enterprise 450, using kernel 2.4.19 (I haven't had a chance to try .21 yet). I was just following the Software-RAID HOWTO, which said that for striping, chunk size didn't really matter.

As you've discovered, the chunk size can't be less than the system page size, and on the UltraSPARC platform, that's 8k - and the same is true of most platforms other than ix86.

Providing you meet the above requirement, the RAID chunk size for striping probably is irrelevant, but the page size requirement is one that applies irrespective of any other requirements.

Best wishes from Riley.
---
* Nothing as pretty as a smile, nothing as ugly as a frown.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.489 / Virus Database: 288 - Release Date: 10-Jun-2003