# root device, emerge and env-update problems [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() ::

```

So then I booted with a live CD and 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 

```

Presumably I need to address these emerge and env-update problems before I continue.Last edited by degras on Mon Sep 28, 2009 6:47 pm; edited 1 time in total

----------

## Mike Hunt

in /etc/portage/package.mask you need an operator (= < > <= >=) like this 

```
<=dev-util/scons-0.98.3 
```

to mask version less than and including that one.

Do you have the correct filesystem support in your kernel?

And emerge --sync might fix that man-pages thing. If it doesn't please report back.

----------

## jomen

...and to be able to even expect emerge --sync to work

(or to have network at all in chroot)

you would need to copy

/etc/resolv.conf

from your running system/livecd to /etc/resolv.conf in the chroot

Eighter do this before entering chroot - or afterwards in another terminal/console.

----------

## d2_racing

Also, can you post this :

```

# emerge --info

```

----------

## degras

 *jomen wrote:*   

> ...and to be able to even expect emerge --sync to work
> 
> (or to have network at all in chroot)
> 
> you would need to copy
> ...

 

What exact directory do you mean by system/livecd ?  Do you mean /mnt/cdrom/ ?  Or do you mean copy /etc/resolv.conf like onto itself, between chrooting ?  Will I be overwritng with an old version as the live CD is gentoo 2007?Last edited by degras on Fri Sep 11, 2009 8:48 pm; edited 2 times in total

----------

## degras

 *d2_racing wrote:*   

> Also, can you post this :
> 
> ```
> 
> # emerge --info
> ...

 

```

livecd / # emerge --info

Portage 2.1.4.4 (unavailable, gcc-4.1.2, glibc-2.6.1-r0, 2.6.19-gentoo-r5 x86_64)

=================================================================

System uname: 2.6.19-gentoo-r5 x86_64 AMD Sempron(tm) Processor 2800+

Timestamp of tree: Fri, 11 Sep 2009 20:30:01 +0000

app-shells/bash:     3.2_p17-r1

dev-java/java-config: 1.3.7, 2.1.4

dev-lang/python:     2.4.4-r9

dev-python/pycrypto: 2.0.1-r6

dev-util/cmake:      2.4.6-r1

sys-apps/baselayout: 1.12.10-r5

sys-apps/sandbox:    1.2.18.1-r2

sys-devel/autoconf:  2.61-r1

sys-devel/automake:  1.5, 1.7.9-r1, 1.9.6-r2, 1.10

sys-devel/binutils:  2.18-r1

sys-devel/gcc-config: 1.4.0-r4

sys-devel/libtool:   1.5.26

virtual/os-headers:  2.6.23-r3

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=k8 -O2 -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"

CXXFLAGS="-march=k8 -O2 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X alsa jack-tmpfs kde mp3 opengl oss qt3 qt4 vorbis xv"

Unset:  ACCEPT_KEYWORDS, CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

```

----------

## d2_racing

Hi, you have something wrong : 

```
Portage 2.1.4.4 (unavailable, gcc-4.1.2, glibc-2.6.1-r0, 2.6.19-gentoo-r5 x86_64) 
```

Can you post this :

```

# eselect profile list

```

----------

## Mike Hunt

 *degras wrote:*   

> What exact directory do you mean by system/livecd ?  Do you mean /mnt/cdrom/ ?  Or do you mean copy /etc/resolv.conf like onto itself, between chrooting ?  Will I be overwritng with an old version as the live CD is gentoo 2007?

 

When you booted the install CD did you have networking ? if so then copy the /etc/resolv.conf to /mnt/gentoo/etc before chrooting.

Either

In the cd system with the installed system mounted at /mnt/gentoo, run:

```
echo "nameserver 4.2.2.6" >> /mnt/gentoo/etc/resolv.conf
```

Or in the chroot, run:

```
echo "nameserver 4.2.2.6" >> /etc/resolv.conf
```

Or you can configure your network to use dhcp, in which case the resolv.conf will be configured by dhcp.

----------

## jomen

 *Quote:*   

> !!! 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 

 

This suggests you cannot download anything because networking in chroot does not work.

If it was working before chroot, the easiest way is to copy /etc/resolv.conf to /etc in your chroot.

Like Mike Hunt also said.

----------

## degras

 *d2_racing wrote:*   

> 
> 
> Can you post this :
> 
> ```
> ...

 

```
livecd / # eselect profile list

Available profile symlink targets:

  [1]   default/linux/amd64/2008.0

  [2]   default/linux/amd64/2008.0/desktop

  [3]   default/linux/amd64/2008.0/developer

  [4]   default/linux/amd64/2008.0/no-multilib

  [5]   default/linux/amd64/2008.0/server

  [6]   default/linux/amd64/10.0

  [7]   default/linux/amd64/10.0/desktop

  [8]   default/linux/amd64/10.0/developer

  [9]   default/linux/amd64/10.0/no-multilib

  [10]  default/linux/amd64/10.0/server

  [11]  hardened/amd64

  [12]  hardened/amd64/multilib

  [13]  selinux/2007.0/amd64

  [14]  selinux/2007.0/amd64/hardened

  [15]  selinux/v2refpolicy/amd64

  [16]  selinux/v2refpolicy/amd64/desktop

  [17]  selinux/v2refpolicy/amd64/developer

  [18]  selinux/v2refpolicy/amd64/hardened

  [19]  selinux/v2refpolicy/amd64/server

  [20]  hardened/linux/amd64/10.0

  [21]  hardened/linux/amd64/10.0/no-multilib

```

I rebooted, but I still get the message about the Block device not being a valid root device.

So then I rebooted with the live CD and at the terminal I typed:

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

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

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

livecd / # emerge -Dup world

!!! /etc/make.profile is not a symlink and will probably prevent most merges.

!!! It should point into a profile within /usr/portage/profiles/

!!! (You can safely ignore this message when syncing. It's harmless.)

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

Calculating world dependencies \

!!! All ebuilds that could satisfy "sys-libs/db:4.4" have been masked.

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

- sys-libs/db-4.4.20_p4-r1 (masked by: missing keyword)

- sys-libs/db-4.4.20_p4 (masked by: missing keyword)

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

refer to the Gentoo Handbook.

(dependency required by "dev-lang/python-2.4.4-r9" [installed])

!!! Problem resolving dependencies for media-sound/alsa-utils

!!! Depgraph creation failed.

livecd / # echo "nameserver 4.2.2.6" >> /etc/resolv.conf

```

I also did an emerge --sync, which said:

```

 * An update to portage is available. It is _highly_ recommended

 * that you update portage now, before any other packages are updated.

 * To update portage, run 'emerge portage' now.

```

What do I do now?

----------

## d2_racing

Hi, you should run this :

```

# eselect profile set 7

# eselect profile list

```

----------

## degras

Thanks, those commands worked fine:

```

livecd / # eselect profile set 7

livecd / # eselect profile list

Available profile symlink targets:

  [1]   default/linux/amd64/2008.0

  [2]   default/linux/amd64/2008.0/desktop

  [3]   default/linux/amd64/2008.0/developer

  [4]   default/linux/amd64/2008.0/no-multilib

  [5]   default/linux/amd64/2008.0/server

  [6]   default/linux/amd64/10.0

  [7]   default/linux/amd64/10.0/desktop *

  [8]   default/linux/amd64/10.0/developer

  [9]   default/linux/amd64/10.0/no-multilib

  [10]  default/linux/amd64/10.0/server

  [11]  hardened/amd64

  [12]  hardened/amd64/multilib

  [13]  selinux/2007.0/amd64

  [14]  selinux/2007.0/amd64/hardened

  [15]  selinux/v2refpolicy/amd64

  [16]  selinux/v2refpolicy/amd64/desktop

  [17]  selinux/v2refpolicy/amd64/developer

  [18]  selinux/v2refpolicy/amd64/hardened

  [19]  selinux/v2refpolicy/amd64/server

  [20]  hardened/linux/amd64/10.0

  [21]  hardened/linux/amd64/10.0/no-multilib

```

Now should I reboot?

----------

## d2_racing

Your grub is mess up or your kernel.

Can you post this :

```

# mount

# fdisk -l

# cat /boot/grub/grub.conf

```

----------

## degras

Here is the output:

```

livecd / # mount

/dev/sda1 on /mnt/gentoo/boot type ext2 (rw)

/dev/sda3 on /mnt/gentoo type ext3 (rw)

/dev/sda1 on /mnt/gentoo/boot type ext2 (rw)

none on /mnt/gentoo/proc type proc (rw)

/dev on /mnt/gentoo/dev type none (rw,bind)

/dev/sda3 on /mnt/gentoo type ext3 (rw)

/dev/sda1 on /mnt/gentoo/boot type ext2 (rw)

none on /mnt/gentoo/proc type proc (rw)

/dev on /mnt/gentoo/dev type none (rw,bind)

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 /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

```

----------

## d2_racing

Can you post this :

```

# cd /boot

# ls -la

# cd /usr/src && ls -la

```

----------

## degras

Here is the output:

```

livecd boot # ls -la

total 11214

drwxr-xr-x  4 root root    1024 Aug 30 22:55 .

drwxr-xr-x 20 root root    4096 Feb 13  2008 ..

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

-rw-r--r--  1 root root 1164345 Jan 29  2008 System.map-genkernel-x86_64-2.6.22-gentoo-r9

-rw-r--r--  1 root root 1210004 Sep  1 18:21 System.map-genkernel-x86_64-2.6.23-gentoo-r8

lrwxrwxrwx  1 root root       1 Nov 12  2007 boot -> .

drwxr-xr-x  2 root root    1024 Nov 22  2007 grub

-rw-r--r--  1 root root 2694273 Jan 29  2008 initramfs-genkernel-x86_64-2.6.22-gentoo-r9

-rw-r--r--  1 root root 2234523 Sep  1 18:40 initramfs-genkernel-x86_64-2.6.23-gentoo-r8

-rw-r--r--  1 root root 2004264 Jan 29  2008 kernel-genkernel-x86_64-2.6.22-gentoo-r9

-rw-r--r--  1 root root 2099800 Sep  1 18:21 kernel-genkernel-x86_64-2.6.23-gentoo-r8

drwx------  2 root root   12288 Nov 12  2007 lost+found

livecd boot # cd /usr/src && ls -la

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 Sep  1 18:39 linux-2.6.23-gentoo-r8

```

I guess there should not be two of each genkernel files?

----------

## d2_racing

I never used Genkernel, so I'm pretty stuck right now.

----------

## degras

When I boot I still get:

```

>> 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() :: 

```

Which instructions should I follow to re-install?   :Twisted Evil: 

----------

