error opening /dev/md2: No such file or directory

4 messages, 3 authors, 2004-12-02 · open the first message on its own page

error opening /dev/md2: No such file or directory

From: Robin Bowes <hidden>
Date: 2004-12-02 18:03:45

Hi,

I suspect this is not an mdadm problem but I am hoping someone can point 
me in the right direction...

I was running Fedora Core 2 and upgraded to Fedora Core 3 but am having 
problems following the upgrade (it won't boot due to some kernel 
issues). So, I thought I'd try a fresh install.

I'm tring to create a RAID1 array from a couple of spare 1.5GB 
partitions onto which I can put the fresh O/S install.

I used this command:

# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sdc1 missing
mdadm: error opening /dev/md2: No such file or directory

I've used "missing" since the other spare partition is on /dev/sdf which 
is being RMA'd at the moment - guess what make it is :)

The new FC3 system is running udev with which I'm not familiar.

How can I create the /dev/md2 device?

Thanks,

R.

Re: error opening /dev/md2: No such file or directory

From: Kevin P. Fleming <hidden>
Date: 2004-12-02 18:30:50

Robin Bowes wrote:
# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sdc1 missing
mdadm: error opening /dev/md2: No such file or directory
This is a side-effect of the way that the MD driver operates in a 
dynamic /dev environment. mdadm needs the /dev/mdX node to be available 
to be able to manipulate the array, but it doesn't exist until the array 
has been created. Catch-22.

At some point mdadm and the MD driver need a new communication method 
that uses a common device node for all arrays, but that won't happen soon.

In the meantime, you can manually create /dev/mdX nodes with mknod, just 
as you would have done before. Once the array is created, if you have it 
set to auto-start (using 0xfd partition types), it the device node will 
automatically appear when you boot your system. If you don't have it set 
to auto-start, you'll have to add the "mknod" command to your system 
startup scripts before trying to start the array directly.

Re: error opening /dev/md2: No such file or directory

From: Robin Bowes <hidden>
Date: 2004-12-02 18:37:28

Kevin P. Fleming wrote:
Robin Bowes wrote:
quoted
# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sdc1 missing
mdadm: error opening /dev/md2: No such file or directory
In the meantime, you can manually create /dev/mdX nodes with mknod, just 
as you would have done before. Once the array is created, if you have it 
set to auto-start (using 0xfd partition types), it the device node will 
automatically appear when you boot your system. If you don't have it set 
to auto-start, you'll have to add the "mknod" command to your system 
startup scripts before trying to start the array directly.
OK, they are set to auto-start.

I wasn't sure how to use mknod. So here's what I did:

[root@dude dev]# mknod --help
Usage: mknod [OPTION]... NAME TYPE [MAJOR MINOR]
Create the special file NAME of the given TYPE.

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

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

   b      create a block (buffered) special file
   c, u   create a character (unbuffered) special file
   p      create a FIFO

Report bugs to [off-list ref].
[root@dude dev]# mknod /dev/md2 b
mknod: when creating special files, major and minor device
numbers must be specified
Try `mknod --help' for more information.
[root@dude dev]# ls /dev/md1
/dev/md1
[root@dude dev]# file /dev/md1
/dev/md1: block special (9/1)
[root@dude dev]# file /dev/md0
/dev/md0: block special (9/0)
[root@dude dev]# file /dev/md5
/dev/md5: block special (9/5)
[root@dude dev]# mknod /dev/md2 b 9 2
[root@dude dev]# ls /dev/md2
/dev/md2

Done!

Thanks,

R.

Re: error opening /dev/md2: No such file or directory

From: Luca Berra <hidden>
Date: 2004-12-02 20:43:52

On Thu, Dec 02, 2004 at 06:03:45PM +0000, Robin Bowes wrote:
# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sdc1 missing
mdadm: error opening /dev/md2: No such file or directory

I've used "missing" since the other spare partition is on /dev/sdf which 
is being RMA'd at the moment - guess what make it is :)

The new FC3 system is running udev with which I'm not familiar.

How can I create the /dev/md2 device?
ah, udev, what a great pile of shit it is.

you could use the --auto= option of mdadm to have it create the device
for you, the only issue with that is that mdadm will use the first free
minor numbr it finds instead of using the minor implied by the device
name. (i was planning on changing that behaviour sooner or later).


-- 
Luca Berra -- bluca@comedia.it
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help