Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Block device /dev/sda3 is not a valid root device [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
degras
Guru
Guru


Joined: 05 Jan 2006
Posts: 455

PostPosted: Mon Aug 31, 2009 2:18 pm    Post subject: Block device /dev/sda3 is not a valid root device [SOLVED] Reply with quote

After updating the kernel and using genkernel I get the following message after booting my machine.
Code:
>> 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
Back to top
View user's profile Send private message
d2_racing
Moderator
Moderator


Joined: 25 Apr 2005
Posts: 13046
Location: Ste-Foy,Canada

PostPosted: Mon Aug 31, 2009 2:26 pm    Post subject: Reply with quote

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

Code:

# fdisk -l
# cat /etc/fstab
# cat /boot/grub/grub.conf

_________________
Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec
Back to top
View user's profile Send private message
degras
Guru
Guru


Joined: 05 Jan 2006
Posts: 455

PostPosted: Mon Aug 31, 2009 3:04 pm    Post subject: Reply with quote

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

Code:

# fdisk -l
# cat /etc/fstab
# cat /boot/grub/grub.conf


I booted from a liveCD, how do I chroot to my box?
Back to top
View user's profile Send private message
bobspencer123
Guru
Guru


Joined: 19 Dec 2005
Posts: 544

PostPosted: Mon Aug 31, 2009 3:50 pm    Post subject: Reply with quote

this should do it for you:

Code:

# 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
Back to top
View user's profile Send private message
degras
Guru
Guru


Joined: 05 Jan 2006
Posts: 455

PostPosted: Mon Aug 31, 2009 4:02 pm    Post subject: Reply with quote

bobspencer123 wrote:
this should do it for you:

Code:

# 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


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 ?
Back to top
View user's profile Send private message
bobspencer123
Guru
Guru


Joined: 19 Dec 2005
Posts: 544

PostPosted: Mon Aug 31, 2009 4:12 pm    Post subject: Reply with quote

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

Just issue commands as listed. (obviously leaving out the # ...)
Back to top
View user's profile Send private message
tw04l124
Veteran
Veteran


Joined: 03 Oct 2006
Posts: 1310
Location: A t z e l, lower austria

PostPosted: Mon Aug 31, 2009 4:20 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
degras
Guru
Guru


Joined: 05 Jan 2006
Posts: 455

PostPosted: Mon Aug 31, 2009 4:24 pm    Post subject: Reply with quote

OK, I issued the commands, but after rebooting I still get the message:
Code:
>> 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() ::
Back to top
View user's profile Send private message
signal11
n00b
n00b


Joined: 16 Mar 2003
Posts: 46

PostPosted: Mon Aug 31, 2009 4:37 pm    Post subject: Reply with quote

degras wrote:
OK, I issued the commands, but after rebooting I still get the message:
Code:
>> 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() ::

it's a long shot, but did you create your root file-system on some other device ?
Back to top
View user's profile Send private message
degras
Guru
Guru


Joined: 05 Jan 2006
Posts: 455

PostPosted: Mon Aug 31, 2009 5:41 pm    Post subject: Reply with quote

tw04l124 wrote:
hi

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



In this shell I don't have /boot directory.
Back to top
View user's profile Send private message
bobspencer123
Guru
Guru


Joined: 19 Dec 2005
Posts: 544

PostPosted: Mon Aug 31, 2009 5:45 pm    Post subject: Reply with quote

after you chroot (as per the instructions above)

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

Code:

# 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.
Back to top
View user's profile Send private message
signal11
n00b
n00b


Joined: 16 Mar 2003
Posts: 46

PostPosted: Mon Aug 31, 2009 5:49 pm    Post subject: Reply with quote

degras wrote:
tw04l124 wrote:
hi

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



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

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)
Code:
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
Back to top
View user's profile Send private message
degras
Guru
Guru


Joined: 05 Jan 2006
Posts: 455

PostPosted: Mon Aug 31, 2009 7:21 pm    Post subject: Reply with quote

bobspencer123 wrote:
after you chroot (as per the instructions above)

you need to provide us with the output of the originally requested command:
...
those are three distinct commands which should spit out some information for us. So execute each one ... and then post the result for us.


OK, here are the results:

Code:

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
Back to top
View user's profile Send private message
bobspencer123
Guru
Guru


Joined: 19 Dec 2005
Posts: 544

PostPosted: Mon Aug 31, 2009 7:36 pm    Post subject: Reply with quote

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

I need to modify my chroot directions slightly:

Code:

# 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:

Code:

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.
Back to top
View user's profile Send private message
degras
Guru
Guru


Joined: 05 Jan 2006
Posts: 455

PostPosted: Mon Aug 31, 2009 7:45 pm    Post subject: Reply with quote

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:

Code:

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

Back to top
View user's profile Send private message
bobspencer123
Guru
Guru


Joined: 19 Dec 2005
Posts: 544

PostPosted: Mon Aug 31, 2009 7:53 pm    Post subject: Reply with quote

can you now post the output of (while chrooted)

Code:

ls /boot/kernel* /boot/initramfs*


edit:

and

Code:

ls -all /usr/src


also here is a helpful guide for upgrading kernel and genkernel
Back to top
View user's profile Send private message
degras
Guru
Guru


Joined: 05 Jan 2006
Posts: 455

PostPosted: Mon Aug 31, 2009 7:58 pm    Post subject: Reply with quote

bobspencer123 wrote:
can you now post the output of (while chrooted)
...

OK
Code:
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
Back to top
View user's profile Send private message
bobspencer123
Guru
Guru


Joined: 19 Dec 2005
Posts: 544

PostPosted: Tue Sep 01, 2009 12:32 am    Post subject: Reply with quote

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

Hopefully someone else has some ideas.
Back to top
View user's profile Send private message
tw04l124
Veteran
Veteran


Joined: 03 Oct 2006
Posts: 1310
Location: A t z e l, lower austria

PostPosted: Tue Sep 01, 2009 10:07 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
gatonero
n00b
n00b


Joined: 01 Sep 2009
Posts: 5
Location: Aachen

PostPosted: Wed Sep 02, 2009 12:02 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
gatonero
n00b
n00b


Joined: 01 Sep 2009
Posts: 5
Location: Aachen

PostPosted: Wed Sep 02, 2009 6:55 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
d2_racing
Moderator
Moderator


Joined: 25 Apr 2005
Posts: 13046
Location: Ste-Foy,Canada

PostPosted: Wed Sep 02, 2009 12:07 pm    Post subject: Reply with quote

It's inside /boot/grub/grub.conf
_________________
Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec
Back to top
View user's profile Send private message
gatonero
n00b
n00b


Joined: 01 Sep 2009
Posts: 5
Location: Aachen

PostPosted: Wed Sep 02, 2009 5:23 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
d2_racing
Moderator
Moderator


Joined: 25 Apr 2005
Posts: 13046
Location: Ste-Foy,Canada

PostPosted: Wed Sep 02, 2009 10:34 pm    Post subject: Reply with quote

Good luck :P
_________________
Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec
Back to top
View user's profile Send private message
degras
Guru
Guru


Joined: 05 Jan 2006
Posts: 455

PostPosted: Thu Sep 03, 2009 2:23 pm    Post subject: Reply with quote

I typed:
Code:
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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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