# Block device /dev/sda3 is not a valid root device [SOLVED]

## degras

After updating the kernel and using genkernel I get the following message after booting my machine.

```
>> Determening root device

>> Block device /dev/sda3 is not a valid root device...

>> Could not find the root block device in .

Please specify a device to boot, or "shell" for a shell..

boot() ::
```

I think I forgot a step or steps.Last edited by degras on Mon Sep 28, 2009 6:49 pm; edited 1 time in total

----------

## d2_racing

Hi, can you boot from a LiveCD, chroot your box and post this :

```

# fdisk -l

# cat /etc/fstab

# cat /boot/grub/grub.conf

```

----------

## degras

 *d2_racing wrote:*   

> Hi, can you boot from a LiveCD, chroot your box and post this :
> 
> ```
> 
> # fdisk -l
> ...

 

I booted from a liveCD, how do I chroot to my box?

----------

## bobspencer123

this should do it for you:

```

# mount /dev/sdxy /mnt/gentoo

[where "x" is the letter of your / partition and "y" is the number .. typically sda3 if you followed handbook]

# mount -t proc none /mnt/gentoo/proc

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

# chroot /mnt/gentoo /bin/bash

# env-update && source /etc/profile

```

----------

## degras

 *bobspencer123 wrote:*   

> this should do it for you:
> 
> ```
> 
> # mount /dev/sdxy /mnt/gentoo
> ...

 

Oh dear, I need to be root to mount, but when I su to root it won't accept the usual password,

is the root password different for the liveCD ?

----------

## bobspencer123

you are automagically root ... no su'ing needed.

Just issue commands as listed. (obviously leaving out the # ...)

----------

## Roman_Gruber

hi

in grub.conf or menu.lst in /boot/grub check this out

title bla bla

root (hd0,0)

kernel .... realroot 

realroot must point to your boot partition not your root partition dont forget

e.g. working old setup 

title 2.6.30-tuxonice-r4_27_July_2009_r2

root(hd0,0)

kernel /2.6.30-tuxonice-r4_27_July_2009_r2  resume=swap:/dev/sdb5 fastboot

title 2.6.30-tuxonice-r4_a

root(hd0,0)

kernel /2.6.30-tuxonice-r4_a resume=swap:/dev/sdb5

or really failsafe

title /2.6.29-tuxonice-r2_26_May mit powertop unterstuetzung

root(hd0,0)

kernel /2.6.29-tuxonice-r2_26_May realroot=/dev/sda5 resume=swap:/dev/sdb5 vga=0x37c fastboot

----------

## degras

OK, I issued the commands, but after rebooting I still get the message:

```
>> Determening root device 

>> Block device /dev/sda3 is not a valid root device... 

>> Could not find the root block device in . 

Please specify a device to boot, or "shell" for a shell.. 

boot() ::
```

----------

## signal11

 *degras wrote:*   

> OK, I issued the commands, but after rebooting I still get the message:
> 
> ```
> >> Determening root device 
> 
> ...

 

it's a long shot, but did you create your root file-system on some other device ?

----------

## degras

 *tw04l124 wrote:*   

> hi
> 
> in grub.conf or menu.lst in /boot/grub check this out
> 
> 

 

In this shell I don't have /boot directory.

----------

## bobspencer123

after you chroot (as per the instructions above)

you need to provide us with the output of the originally requested command:

```

# fdisk -l

# cat /etc/fstab

# cat /boot/grub/grub.conf 

```

those are three distinct commands which should spit out some information for us. So execute each one ... and then post the result for us.

----------

## signal11

 *degras wrote:*   

>  *tw04l124 wrote:*   hi
> 
> in grub.conf or menu.lst in /boot/grub check this out
> 
>  
> ...

 

you need to mount /boot somewhere. for example, assume that you have 3 partitions as follows:

/dev/sda1        (is boot-device)

/dev/sda2              (is swap)

/dev/sda3              (is root-file-system)

then you can do the following (after you have booted the machine with the live-cd)

```
mount /dev/sda3 /mnt/gentoo (no need to explicitly supply the file-system type)

mkdir -p /mnt/gentoo/boot   (create /mnt/gentoo/boot if not present already)

mount /dev/sda1 /mnt/gentoo/boot

```

----------

## degras

 *bobspencer123 wrote:*   

> after you chroot (as per the instructions above)
> 
> you need to provide us with the output of the originally requested command:
> 
> ...
> ...

 

OK, here are the results:

```

livecd / # fdisk -l

Disk /dev/sda: 81.9 GB, 81964302336 bytes

255 heads, 63 sectors/track, 9964 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x00042e91

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1           5       40131   83  Linux

/dev/sda2               6          68      506047+  82  Linux swap / Solaris

/dev/sda3              69        9964    79489620   83  Linux

livecd / # cat /etc/fstab

# /etc/fstab: static file system information.

#

# noatime turns off atimes for increased performance (atimes normally aren't 

# needed; notail increases performance of ReiserFS (at the expense of storage 

# efficiency).  It's safe to drop the noatime options if you want and to 

# switch between notail / tail freely.

#

# The root filesystem should have a pass number of either 0 or 1.

# All other filesystems should have a pass number of 0 or greater than 1.

#

# See the manpage fstab(5) for more information.

#

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

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

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

/dev/sda3               /               ext3            noatime         0 1

/dev/sda2               none            swap            sw              0 0

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

#/dev/fd0               /mnt/floppy     auto            noauto          0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for 

# POSIX shared memory (shm_open, shm_unlink).

# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will

#  use almost no memory if not populated with files)

shm                     /dev/shm        tmpfs           nodev,nosuid,noexec    0 0

livecd / # cat /boot/grub/grub.conf

cat: /boot/grub/grub.conf: No such file or directory

```

----------

## bobspencer123

ok ... now to get the command: cat /boot/grub/grub.conf  ...... to work

I need to modify my chroot directions slightly:

```

# mount /dev/sda3 /mnt/gentoo

# mkdir /mnt/gentoo/boot

# mount /dev/sda1 /mnt/gentoo/boot

# mount -t proc none /mnt/gentoo/proc

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

# chroot /mnt/gentoo /bin/bash

# env-update && source /etc/profile 

```

now:

```

cat /boot/grub/grub.conf

```

edit: also have a look  at this page of the handbook  for instructions on editing grub for a genkernel based kernel install.

----------

## degras

 *bobspencer123 wrote:*   

> ok ... now to get the command: cat /boot/grub/grub.conf  ...... to work
> 
> I need to modify my chroot directions slightly:
> 
> ...
> ...

 

the cat command worked this time, now what:

```

livecd / # env-update && source /etc/profile

--- Invalid atom in /etc/portage/package.mask: dev-util/scons-0.98.3

>>> Regenerating /etc/ld.so.cache...

livecd / # cat /boot/grub/grub.conf

default 30

timeout 0

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title=Gentoo Linux (2.6.23-gentoo-r8)

root (hd0,0)

kernel /boot/kernel-genkernel-x86_64-2.6.23-gentoo-r8 root=/dev/ram0 init=linuxrc ramdisk=8192 real_root=/dev/sda3

initrd /boot/initramfs-genkernel-x86_64-2.6.23-gentoo-r8

title=Gentoo Linux 2.6.22

root (hd0,0)

kernel /boot/kernel-genkernel-x86_64-2.6.22-gentoo-r9 root=/dev/ram0 init=linuxrc ramdisk=8192 real_root=/dev/sda3

initrd /boot/initramfs-genkernel-x86_64-2.6.22-gentoo-r9

title=Gentoo Linux 2.6 rescue

root (hd0,0)

kernel /boot/kernel-genkernel-x86_64-2.6.22-gentoo-r9 root=/dev/ram0 init=linuxrc ramdisk=8192 real_root=/dev/sda3

initrd /boot/initramfs-genkernel-x86_64-2.6.22-gentoo-r9

```

----------

## bobspencer123

can you now post the output of (while chrooted)

```

ls /boot/kernel* /boot/initramfs*

```

edit:

and

```

ls -all /usr/src

```

also  here  is a helpful guide for upgrading kernel and genkernel

----------

## degras

 *bobspencer123 wrote:*   

> can you now post the output of (while chrooted)
> 
> ...
> 
> 

 

OK

```
livecd / # ls /boot/kernel* /boot/initramfs*

/boot/initramfs-genkernel-x86_64-2.6.22-gentoo-r9

/boot/initramfs-genkernel-x86_64-2.6.23-gentoo-r8

/boot/kernel-genkernel-x86_64-2.6.22-gentoo-r9

/boot/kernel-genkernel-x86_64-2.6.23-gentoo-r8

livecd / # ls -all /usr/src

total 20

drwxr-xr-x  5 root root 4096 Aug 30 22:26 .

drwxr-xr-x 16 root root 4096 Jun 15  2008 ..

-rw-r--r--  1 root root    0 Apr 17  2007 .keep

lrwxrwxrwx  1 root root   22 Aug 30 22:26 linux -> linux-2.6.23-gentoo-r8

drwxr-xr-x 19 root root 4096 Feb  7  2008 linux-2.6.22-gentoo-r9

drwxr-xr-x 19 root root 4096 Dec 22  2007 linux-2.6.23-gentoo-r3

drwxr-xr-x 20 root root 4096 Aug 30 23:27 linux-2.6.23-gentoo-r8

```

----------

## bobspencer123

My untrained eye can't find any blatant errors with any of your config settings.

Hopefully someone else has some ideas.

----------

## Roman_Gruber

well some idea, if you cant boot.

backup your /usr/src/linux/.config 

This file is your kernel config, safe it somewhere safe.

then emerge genkernel and make a genkernel kernel

try, if you are able to boot into your system with a genkernel kernel

----------

## gatonero

Today I got the same error. My mistake is, that I formated all partitions with ext3 and didn't adapt /etc/fstab. So I will follow your chroot instructions tomorrow and hopefully fix that error.

----------

## gatonero

As I presumed, my /etc/fstab wasn't correct. Now my system is still looking for /dev/sda3 while it is /dev/hda3. But after entering at the prompt /dev/hda3 the system boots and I am able to login. Now I am searching where I have to change from /dev/sda3 to /dev/hda3. /etc/fstab is correct.

----------

## d2_racing

It's inside /boot/grub/grub.conf

----------

## gatonero

Thank You, exactly that was the reason. Now I have a very basic gentoo installation in a virtualbox. I will collect some experiences for installing it later as my main system.

----------

## d2_racing

Good luck  :Razz: 

----------

## degras

I typed:

```
livecd gentoo # mount /dev/sda3 /mnt/gentoo

livecd gentoo # mkdir /mnt/gentoo/boot

mkdir: cannot create directory `/mnt/gentoo/boot': File exists

livecd gentoo # mount /dev/sda1 /mnt/gentoo/boot

livecd gentoo # mount -t proc none /mnt/gentoo/proc

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

livecd gentoo # chroot /mnt/gentoo /bin/bash

livecd / # env-update && source /etc/profile

--- Invalid atom in /etc/portage/package.mask: dev-util/scons-0.98.3

>>> Regenerating /etc/ld.so.cache...

livecd / # emerge -Dup world

--- Invalid atom in /etc/portage/package.mask: dev-util/scons-0.98.3

These are the packages that would be merged, in order:

Calculating world dependencies /

!!! All ebuilds that could satisfy "sys-apps/man-pages-posix" have been masked.

!!! One of the following masked packages is required to complete your request:

- sys-apps/man-pages-posix-2003a (masked by: ~amd64 keyword)

For more information, see MASKED PACKAGES section in the emerge man page or 

refer to the Gentoo Handbook.

(dependency required by "sys-apps/man-pages-3.00" [ebuild])

!!! Problem resolving dependencies for sys-apps/man-pages

!!! Depgraph creation failed.

livecd / # emerge -u gentoo-sources

...

!!! Couldn't download 'genpatches-2.6.24-9.base.tar.bz2'. Aborting.

 * Fetch failed for 'sys-kernel/gentoo-sources-2.6.24-r8'

!!! can't process invalid log file: merge.ERROR

```

Oh dear, what next ?  Somebody help please!

...

I had to reinstall gentoo.

----------

