# [SOLVED] Unable to boot because devices can't be found

## Kjammer

I can't boot into gentoo anymore because it cant find the root filesystem.  It stops early in the boot process and gives me a choice to run in single-user mode (read-only filesystem and no network).  The last I did before shutting down was a massive upgrade (emerge) spree.  Among the upgrades was Xorg-server 1.9 (which required udev and the removal of device-mapper), partway through a kde-meta update (upgrading from KDE-3.x to KDE 4) and then a revdep-rebuild attempt that stopped halfway because of a compilation issue.  I updated all the needed config files

Here is the boot process

```

 * Mounting proc at /proc ...                                     [ ok ]

 * Mounting sysfs at /sys ...                                     [ ok ]

 * Mounting /dev ...                                              [ ok ]

 * Starting udevd ...

udevd[931]: inotify_init failed: Function not implemented

error initializing inotify

udevd[931]: error initializing inotify

                                                                  [ !! ]

No /sbin/udevd found running; none killed.

 * Mounting devpts at /dev/pts ...                                [ ok ]

 * Checking root filesystem ...

fsck.ext3: No such file or directory while trying to open /dev/sda3

/dev/sda3:

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 e2fack with an alternate superblock:

    e2fsck -b 8193 <device>

 * Filesystem couldn't be fixed :(                                [ !! ]

Give root password for maintenance

(or type Control-D to continue):

```

Checking the /dev directory, I found all disk devices missing (sda, sda1, sda3, sdb, hda, et cetera), which is why e2fsck failed.

The current udev version is 151-r4.  Is this version unstable with amd64? or did I miss a step and forgot to configure udev manually? Or is the problem someplace else?

What can I do to get my system running again?

For reference, here are the relevant portions from the fstab file:

```

# <fs>             <mountpoint>        <type>      <opts>               <dump/pass>

/dev/sda1         /boot                ext2         noauto,noatime      1 2

/dev/sda3         /                    ext3         auto,noatime        0 1

/dev/sda2         none                 swap         sw                  0 0

/dev/cdrom        /mnt/cdrom           auto         noauto,user         0 0

```

Last edited by Kjammer on Wed Mar 23, 2011 9:13 am; edited 1 time in total

----------

## jburns

Is CONFIG_INOTIFY_USER=y in your kernel .config?

----------

## cach0rr0

you will most likely need to boot from a livecd, mount everything, chroot in, rebuild the kernel ensuring INOTIFY support is included, as well ensuring that CONFIG_SYSFS_DEPRECATED it *not* included.

----------

## DONAHUE

```
grep -i ide /usr/src/linux/.config
```

should produce *Quote:*   

> # CONFIG_IDE is not set

 if it does not change kernel configuration to use libata instead of legacy hard drive adapter drivers *Quote:*   

> Device Drivers --->
> 
> < > ATA/ATAPI/MFM/RLL support --->
> 
> SCSI device support --->
> ...

 find the driver(s) for your adapters and select them as builtin. Post an lspci if you want outside vote on drivers.

```
grep -i sysfs /usr/src/linux/.config
```

should produce *Quote:*   

> CONFIG_SYSFS_DEPRECATED is not set

 if it does not; change kernel config to eliminate  *Quote:*   

> General setup  ---> 
> 
> [ ] enable deprecated sysfs features to support old userspace tools

 

```
grep -i reloc /usr/src/linux/.config
```

should produce *Quote:*   

> 
> 
> # CONFIG_RELOCATABLE is not set

 if it does not; eliminate it *Quote:*   

> Processor type and features  ---> 
> 
> [ ] Build a relocatable kernel 

 

udev no longer makes device nodes for the legacy drivers.

CONFIG_SYSFS_DEPRECATED=y interferes with udev.

CONFIG_RELOCATABLE is reported to play badly with the latest gcc

The latest gcc is supposed to be a minor bug fix, however it has caused me problems first on testing branch and a couple of weeks later on stable branch. I escaped by following http://www.gentoo.org/doc/en/gcc-upgrading.xml as though a major upgrade.

```
eselect python list
```

should produce

 *Quote:*   

> Available Python interpreters:
> 
>   [1]   python2.6 *
> 
>   [2]   python3.1

 3.1 is not ready for major status

```
python-updater

perl-cleaner all

lafilefixer --justfixit

revdep-rebuild
```

----------

## Kjammer

Thanks for the tips, guys.  Although I won't be able to try any these solutions until Monday, At least I have something to look forward to this weekend.

----------

## Kjammer

Nope, still doesn't work.  Most of the aforementioned kernel options were already at the correct values.  And even when recompiled, inotify still failed.

DONAHUE: I wasn't sure what you were trying to say regarding the IDE kernel support.  If you meant go through and set some values to match lspci, then I did just that.

OTHER INFO: The hard drives are SATA and the CD/DVD drive is ATAPI controlled through the the motherboard's IDE.  The ATA and SATA controllers are run by nVidia GeForce 8300.

----------

## cach0rr0

 *Kjammer wrote:*   

> 
> 
> DONAHUE: I wasn't sure what you were trying to say regarding the IDE kernel support.  If you meant go through and set some values to match lspci, then I did just that.
> 
> 

 

There are two sets of drivers that will, technically, run your HDD controller

-the set under CONFIG_IDE (which is deprecated, and should not be used at all with newer udev; if you see that CONFIG_IDE is set in your config, expect problems)

-the set under CONFIG_ATA (which are recommended 99.99999999% of the time, and capable of handling your HDD controller even if you DO have an IDE drive)

The fact that you can even get to the init process, which is located ON the hard disk, implies that your kernel is capable of operating your HDD

However, this device does not exist when udev goes looking for it, which makes me (and presumably others) suspicious that you might be using the old CONFIG_IDE drivers

point blank, you should not be using CONFIG_IDE. Ever. 

If you can boot from a livecd, get network access, and chroot back in, I recommend dumping your entire kernel config up on pastebin(.com) and sharing the link

should be able to spot any issues/problems with it.

----------

## Kjammer

I put my /usr/src/linux/.config file on pastebin (LINK).  

Despite having CONFIG_IDE=n and CONFIG_ATA=y, it still doesn't work.  I checked that the kernel was built and that the resulting image was different when changes were made to .config using diff.  And I made sure that /usr/src/linux/arch/x86_64/boot/bzimage was copied correctly to the /boot directory.

Is there something else that needs configuring, or do I need to update the kernel?

----------

## cach0rr0

from your kernel config

```

# Linux kernel version: 2.6.27-gentoo-r8

```

this is, at this stage, ancient. i would  not expect this to be compatible with the latest udev 

should at *least* be something in the 30-series, ideally greater than .32, and ideally the latest stable gentoo-sources (or whatever sources you use)

kernel sources are not included in world updates. 

I would suggest at this point booting from a livecd, chrooting in, updating the kernel sources, building a new kernel, booting from the new kernel, and seeing if that doesnt fix the issue (it should)

boot to a livecd and

```

mkdir /mnt/gentoo #if this errors out because the directory already exists, as it does on SysRescueCD, ignore it, that's fine

mount /dev/sda3 /mnt/gentoo

mount /dev/sda1 /mnt/gentoo/boot

mount -t proc none /mnt/gentoo/proc

mount -o bind /dev /mnt/gentoo/dev

swapon /dev/sda2

chroot /mnt/gentoo /bin/bash

env-update

source /etc/profile

USE="symlink" emerge -v gentoo-sources

```

that should get you the latest gentoo-sources set. 

From there how you proceed depends on if you normally do genkernel, or normally do manual configuration (e.g. with make menuconfig)

Suggest going with menuconfig, and suggest using one of Pappy's seeds. If you get stuck there, we can help

(and of course, if you already know how to do all this stuff, no offense or slight intended!)

----------

## DONAHUE

Amen, Brother cach0rr0!

----------

## Kjammer

The system works now.   Thank you cach0rr0 and DONAHUE, you two were very helpful.

----------

## deadDrift

I just wanted to add that I was having the same error where the system could not find the root file system after my first install of Gentoo. I used the kernel-seeds and checking the configuration suggestions above. Now I have a working Gentoo system!!!

Thanks to everyone,

deadDrift

----------

