<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.2.3">
</HEAD>
<BODY>
On Fri, 2004-12-03 at 16:34 +0000, Robin Bowes wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Aaron M. Hirsch wrote:</FONT>
<FONT COLOR="#000000">> I created md0-3 during boot and now want to create another raid device </FONT>
<FONT COLOR="#000000">> which would be md4.  I've gone through the man page and searched online </FONT>
<FONT COLOR="#000000">> but am coming up blanks for an answer.  I am using FC3 x86_64...</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> To create the new raid device I ran:  mdadm --create /dev/md4 --level=0 </FONT>
<FONT COLOR="#000000">> --raid-disks=2 /dev/hda6 /dev/hdc6 which errors out stating: mdadm: </FONT>
<FONT COLOR="#000000">> error opening /dev/md4: No such file or directory.  Of course it's not </FONT>
<FONT COLOR="#000000">> there yet, I'm just now trying to create it.</FONT>

<FONT COLOR="#000000">I ran into this yesterday.</FONT>

<FONT COLOR="#000000">You have two options:</FONT>

<FONT COLOR="#000000">1. From Luca Berra: "you could use the --auto= option of mdadm to have </FONT>
<FONT COLOR="#000000">it create the device for you, the only issue with that is that mdadm </FONT>
<FONT COLOR="#000000">will use the first free minor numbr it finds instead of using the minor </FONT>
<FONT COLOR="#000000">implied by the device name. (i was planning on changing that behaviour </FONT>
<FONT COLOR="#000000">sooner or later)."</FONT>

<FONT COLOR="#000000">2. Use mknod to create the device before creating the array. Here's what </FONT>
<FONT COLOR="#000000">I did to create /dev/md2:</FONT>

<FONT COLOR="#000000"># [root@dude dev]# mknod --help</FONT>
<FONT COLOR="#000000">Usage: mknod [OPTION]... NAME TYPE [MAJOR MINOR]</FONT>
<FONT COLOR="#000000">Create the special file NAME of the given TYPE.</FONT>

<FONT COLOR="#000000">   -Z, --context=CONTEXT   set security context (quoted string)</FONT>
<FONT COLOR="#000000">Mandatory arguments to long options are mandatory for short options too.</FONT>
<FONT COLOR="#000000">   -m, --mode=MODE   set permission mode (as in chmod), not a=rw - umask</FONT>
<FONT COLOR="#000000">       --help     display this help and exit</FONT>
<FONT COLOR="#000000">       --version  output version information and exit</FONT>

<FONT COLOR="#000000">Both MAJOR and MINOR must be specified when TYPE is b, c, or u, and they</FONT>
<FONT COLOR="#000000">must be omitted when TYPE is p.  If MAJOR or MINOR begins with 0x or 0X,</FONT>
<FONT COLOR="#000000">it is interpreted as hexadecimal; otherwise, if it begins with 0, as octal;</FONT>
<FONT COLOR="#000000">otherwise, as decimal.  TYPE may be:</FONT>

<FONT COLOR="#000000">   b      create a block (buffered) special file</FONT>
<FONT COLOR="#000000">   c, u   create a character (unbuffered) special file</FONT>
<FONT COLOR="#000000">   p      create a FIFO</FONT>

<FONT COLOR="#000000">Report bugs to <<A HREF="mailto:bug-coreutils@gnu.org">bug-coreutils@gnu.org</A>>.</FONT>

<FONT COLOR="#000000">[root@dude dev]# file /dev/md1</FONT>
<FONT COLOR="#000000">/dev/md1: block special (9/1)</FONT>
<FONT COLOR="#000000">[root@dude dev]# file /dev/md0</FONT>
<FONT COLOR="#000000">/dev/md0: block special (9/0)</FONT>
<FONT COLOR="#000000">[root@dude dev]# file /dev/md5</FONT>
<FONT COLOR="#000000">/dev/md5: block special (9/5)</FONT>
<FONT COLOR="#000000">[root@dude dev]# mknod /dev/md2 b 9 2</FONT>
<FONT COLOR="#000000">[root@dude dev]# ls /dev/md2</FONT>
<FONT COLOR="#000000">/dev/md2</FONT>

<FONT COLOR="#000000">Done!</FONT>

<FONT COLOR="#000000">(If you don't have the array set to auto-start, you'll have to add the </FONT>
<FONT COLOR="#000000">"mknod" command to your system startup scripts before trying to start </FONT>
<FONT COLOR="#000000">the array directly)</FONT>

<FONT COLOR="#000000">R.</FONT>

</PRE>
</BLOCKQUOTE>
<BR>
Thanks Robin!  This is exactly what I was looking for!  
</BODY>
</HTML>