Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] booting raid1 'Failed to open the device '/dev/md0'
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
strathmeyer
n00b
n00b


Joined: 14 Apr 2005
Posts: 28

PostPosted: Sat May 14, 2005 11:48 pm    Post subject: [solved] booting raid1 'Failed to open the device '/dev/md0' Reply with quote

I had an old Gentoo system running on software RAID1 that I wanted to upgrade to 2005.0 so I decided for a complete reinstall from stage1. I proceded as usual, but now when the system boots I get the error:

Failed to open the device '/dev/md0': No such file or directory

Things that I have done:
emerged raidtools, udev, hotplug, coldplug
created a mdadm.conf and raidtab
compiled raid1 support into the kernel

When I boot from the live cd, I can create and mount the array. The problem is just when booting the system. It seems that something's not creating the /dev/md0 device.

Any ideas?


Last edited by strathmeyer on Thu May 19, 2005 1:11 am; edited 1 time in total
Back to top
View user's profile Send private message
tcostigl
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 97

PostPosted: Sat May 14, 2005 11:58 pm    Post subject: Reply with quote

Did you set the partition type to "linux raid autodetect"?

Does /dev/md0 exist when you fire up the livecd? If so can't you copy it from the livecd when you mount "/dev" in your install environment.

Maybe one of those helps.
Back to top
View user's profile Send private message
tcostigl
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 97

PostPosted: Sun May 15, 2005 12:15 am    Post subject: Reply with quote

did you do this before chrooting to install environment?

Code:
# mount -o bind /dev /mnt/gentoo/dev
Back to top
View user's profile Send private message
strathmeyer
n00b
n00b


Joined: 14 Apr 2005
Posts: 28

PostPosted: Sun May 15, 2005 12:16 am    Post subject: Reply with quote

tcostigl wrote:
Did you set the partition type to "linux raid autodetect"?

Does /dev/md0 exist when you fire up the livecd? If so can't you copy it from the livecd when you mount "/dev" in your install environment.


Yes, I have the correct partition type. This array was running before, I've just reinstalled Gentoo on it.

(I'm not quite sure how udev works.) I've created /dev/md0 (a number of different ways...), but it 'disappears' on reboot. I assume this is udev's doing.
Back to top
View user's profile Send private message
strathmeyer
n00b
n00b


Joined: 14 Apr 2005
Posts: 28

PostPosted: Sun May 15, 2005 12:35 am    Post subject: Reply with quote

tcostigl wrote:
did you do this before chrooting to install environment?

Code:
# mount -o bind /dev /mnt/gentoo/dev


No, I didn't. What would that do? My problem isn't installing, it's booting. Should I boot the livecd, mount the partition, and do that now?
Back to top
View user's profile Send private message
tcostigl
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 97

PostPosted: Sun May 15, 2005 1:02 am    Post subject: Reply with quote

Yes, try it. I have just started doing the same thing you are trying. I am installing fresh. If I have the same problem I will let you know.

EDIT: before you copy over "/dev" make sure the livecd environment has no problem seeing the partition and read/writing it.
Back to top
View user's profile Send private message
slycordinator
Advocate
Advocate


Joined: 31 Jan 2004
Posts: 3065
Location: Korea

PostPosted: Sun May 15, 2005 1:29 am    Post subject: Reply with quote

strathmeyer wrote:
tcostigl wrote:
Did you set the partition type to "linux raid autodetect"?

Does /dev/md0 exist when you fire up the livecd? If so can't you copy it from the livecd when you mount "/dev" in your install environment.


Yes, I have the correct partition type. This array was running before, I've just reinstalled Gentoo on it.

(I'm not quite sure how udev works.) I've created /dev/md0 (a number of different ways...), but it 'disappears' on reboot. I assume this is udev's doing.


From /etc/conf.d/rc
Code:

# Use this variable to control the /dev management behavior.
#  auto   - let the scripts figure out what's best at boot
#  devfs  - use devfs (requires sys-fs/devfsd)
#  udev   - use udev (requires sys-fs/udev)
#  static - let the user manage /dev

RC_DEVICES="udev"

# UDEV OPTION:
# Set to "yes" if you want to save /dev to a tarball on shutdown
# and restore it on startup.  This is useful if you have a lot of
# custom device nodes that udev does not handle/know about.

RC_DEVICE_TARBALL="no"


This lets you change how /dev is created. Change RC_DEVICES to create the /dev the way you want.

And if you have /dev entries that udev doesn't understand you can change RC_DEVICE_TARBALL

btw: These entries in this file might only be available in the "~arch" versions of the baselayout.
Back to top
View user's profile Send private message
thedrez
n00b
n00b


Joined: 10 May 2005
Posts: 26

PostPosted: Sun May 15, 2005 7:46 am    Post subject: Reply with quote

*****************************************
[SOLVED]
Pleae ignore this text - solved elsewhere
https://forums.gentoo.org/viewtopic-t-337105-start-25.html
*****************************************
You're not alone - - -

I also tried using RAID1 - /dev/md0 and /dev/md1 in addition to some regualar partitions.

/dev/md1 was my / partition and I go the same errors....

If you look at the kernel messages on startup, you should be able to see that the kernel is assigning a device name to your device...

As you probably already know, when you enter your password and look in /dev directory, there aren't any devices there representing the /dev/md0.

Just so that you know - - - I got really frustrated and reinstalled using start scsi partitions... Same thing. Slightly different messge. Here's a brief output:
Quote:
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 232k freed
INIT: version 2.84 booting

Gentoo Linux; http://www.gentoo.org/
Copyright 2001-2004 Gentoo Technologies, Inc.; Distributed under the GPL

* Mounting proc at /proc... OK
* Mounting sysfs at /sys... OK
can't create lock file /etc/mtab~1095: Read-only file system (use -n flag to override) !!

* Mounting ramfs at /dev... OK
* Configuring system to use udev... OK
* Using /sbin/hotplug for udev management... OK
* Mounting devpts at /dev/pts... OK
* Activating (possible) swap... OK
* Remounting root filesystem read-only (if necessary)... OK
* Checking root filesystem...
ext2fs_check_if_mount: No such file or directory while determining whether /dev/sdb2 is mounted.
fsck.ext3: No such file or directory while trying to open /dev/sdb2
/dev/sdb2:
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

/sbin/rc: line 250: rc_splash: command not found
* Filesystem couldn't be fixed :( !!

/dev/console: No such file or directory
Give root password for maintenance
(or type Control-D for normal startup):

I know this looks different from what you are getting, but I think the problem is 'udev' not creating device nodes for either case.

So if I login and look inside /dev, here's the short listing:
    core -> /proc/kcore
    fd -> /proc/self/fd
    null
    pts
    shm
    sndstat -> /proc/asound/oss/sndstat
    stderr -> fd/2
    stdin -> fd/0
    stdout -> fd/1
impressive isn't it?
lsmod is almost irrelevant because I'm compiling everything in, with the exception of stuff I might play with later--

From what I understand of udev from http://www.reactivated.net/writing_udev_rules.html#operators:
Quote:
It is important to understand that writing rules is simply a means of customizing udev behaviour. Writing rules is not a workaround for the problem where no device nodes for your particular device exist. If no matching rules exist, udev will create the node anyway, using the name that was supplied by the kernel.
So if the kernel is seeing the device and you see something like
Quote:
Attached scsi disk sdb at scsi 1, channel 0, id 0, lun 0
then the kernel has assigned this device a device name. Shouldn't 'udev' create a device node with the name supplied by the kernel?

If so, why is it not?

I'm trying to avoid the temptation of siimply reinstalling. I really want to know why this isn't working.
_________________
*****************************************
Artificial intelligence is no match for natural stupidity!
Believe me, I know a lot about the latter. I'm a natural...
Back to top
View user's profile Send private message
thedrez
n00b
n00b


Joined: 10 May 2005
Posts: 26

PostPosted: Mon May 16, 2005 8:25 am    Post subject: Reply with quote

strathmeyer,

can you look at your kernel messages during boot ( I think it's shift-pgUp, shift-pgDwn ) after you get your error message...

Is the kernel detecting md0?
You should see a line that says something like:
Quote:
Attached md disk md0 at ???

Again, it will look something like that. If you don't see "md0" mentioned anywhere in the kernel startup messages, then you either did not compile the raid driver into the kernel **OR** the raid driver module is not in the initial ramdisk (if you used genkernel).

If the kernel does not 'name' the device, then udev (and probably devfs) will not create a device node file in /dev for you.

If you do see 'md0' in the kernel messages and you see that there is an attachment to "md0", then udev (or devfs) is not configured properly. If you are using udev, make sure that shmem, sysfs, tmpfs are all being created in you kernel config before compiling.

NOTE: simply copying /dev/md0 from the LiveCD environment to the chroot environment will not work if you are using a strict 'udev' implementation - as udev will manage device node creation in the /dev directory of the kernel's rootfs(?), it will not "know" that you've created /dev/md0 inside /dev of /dev/md0... The main criteria appears to be whether or not the kernel has "named" the device so that udev can manage it.

Hope this helps,
_________________
*****************************************
Artificial intelligence is no match for natural stupidity!
Believe me, I know a lot about the latter. I'm a natural...
Back to top
View user's profile Send private message
strathmeyer
n00b
n00b


Joined: 14 Apr 2005
Posts: 28

PostPosted: Mon May 16, 2005 11:46 pm    Post subject: Reply with quote

(My apologies if I seem difficult. I have to do this all in lynx, and can't copy the exact messages or navigate gracefully.)

The error message that I'm getting is /sbin/rc: line 250: rc_splash: command not found, * filesystem couldn't be fixed (give root password for maintainence, etc)

I edited /etc/conf.d/rc; RC_DEVICES wasn't in my file, but I added it (="udev"). Should RC_DEVICE_TARBALL be yes or no?

The silly thing now is that the md devices are there, but I'm still getting the same error. I also took a look in the udev config file, and the lines for the md devices are there when I mount from the livecd.

Also, shmem, sysfs, and tmps are in my kernel.

I am seeing the message 'Attached md disk md0 at...' Does this mean that it's udev that's screwing up?

And I'm more confused than ever.
Back to top
View user's profile Send private message
strathmeyer
n00b
n00b


Joined: 14 Apr 2005
Posts: 28

PostPosted: Tue May 17, 2005 11:12 pm    Post subject: Reply with quote

Tried adding 'debfs=nomount gentoo=udev' to the boot line. Still no dice.

Am I nuts? Does raid just not work with Gentoo anymore? Can anyone get it working with 2005.0? If the answer is yes, I'll just try to install again. Now I actually think I just upgraded from 2004.3, and I copied a lot of config files instead of looking at the new defaults.

This really has me frustrated. When I search for the error message on google, I get no useful results. What the heck is going on?
Back to top
View user's profile Send private message
slycordinator
Advocate
Advocate


Joined: 31 Jan 2004
Posts: 3065
Location: Korea

PostPosted: Wed May 18, 2005 12:09 am    Post subject: Reply with quote

strathmeyer wrote:
and I copied a lot of config files instead of looking at the new defaults.


There's your problem. Things change with a newer system and configuration files change accordingly.
Back to top
View user's profile Send private message
strathmeyer
n00b
n00b


Joined: 14 Apr 2005
Posts: 28

PostPosted: Wed May 18, 2005 1:34 am    Post subject: Reply with quote

slycordinator wrote:
strathmeyer wrote:
and I copied a lot of config files instead of looking at the new defaults.


There's your problem. Things change with a newer system and configuration files change accordingly.


That still doesn't explain why I can't track down this problem. I can't even figure out where it's originating. (kernel, udev, which config file, etc)

Oh, well.
Back to top
View user's profile Send private message
thedrez
n00b
n00b


Joined: 10 May 2005
Posts: 26

PostPosted: Wed May 18, 2005 1:54 am    Post subject: Reply with quote

strathmeyer, just so you know, I asked a related question under a different topic title:
UDEV and Software RAID

Here's a repsonse I got back:
Quote:
SuperYak wrote:
Maybe this will help:
https://forums.gentoo.org/viewtopic-p-1949250.html#1949250

I don't have the system running right now, but I'm hoping to fire it up later (~6hrs)... I let you know if any of this helps...



As a bit of research, try entering your password at the "maintenance" shell prompt just after the error and do an ls /dev and if there are only a few entries there (say ~15) then write them down, so that we can all see them - - - if there are more than that, count how many of each kind (i.e. 2xhda, 10xtty, 1xconsole, etc...) ***BUT*** if you see hundreds of files (i.e. 16xhda, 16xhdb, 16xhdc, 16xhdd, 16xhde... 16xsda, 16xsdb, 16xsdc, etc...) then just make note of that - - - the difference between these 3 scenarios should help some of the "gurus" around here determine whether you've got udev running, running correctly, or some other condition....

Don't dispare, I'm sure you have /dev/md0 in your system root partition **AND** I believe I've been having the same type of problem. I'm almost positive that I have udev running correctly, and it does not create a device node for md0 in the /dev directory on startup...

I'll know more later...
_________________
*****************************************
Artificial intelligence is no match for natural stupidity!
Believe me, I know a lot about the latter. I'm a natural...
Back to top
View user's profile Send private message
strathmeyer
n00b
n00b


Joined: 14 Apr 2005
Posts: 28

PostPosted: Thu May 19, 2005 1:10 am    Post subject: solved Reply with quote

Upgraded to baselayout-1.11.12-r1 and udev-056 and everything works fine. (These are ~ versions, and I don't know what versions I was using before. Sorry1)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum