Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
grub2 -> initrd -> kernel with wrong root [SOLVED]
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
aggieben
n00b
n00b


Joined: 11 Dec 2008
Posts: 16

PostPosted: Thu Apr 03, 2014 7:32 pm    Post subject: grub2 -> initrd -> kernel with wrong root [SOLVED] Reply with quote

I've followed the handbook and finished each step according to the documentation, but when I reboot the system, the kernel blows up with a message that says:

Code:

>> Activating mdev
>> Determining root device...
>> Mounting root...
mount: mounting /dev/sda3 on /newroot failed: Invalid argument
!! Could not mount specified ROOT, try again
!! Could not find the root block device in .
   Please specify another value or: press Enter for the same, type "shell" for shell, or "q" to skip...
root block device() ::


This makes no sense because /dev/sda3 is my swap partition, and I specified root=/dev/sda4 in my grub.cfg, shown below. It looks like the initramfs is trying to determine the root automatically instead of just passing through the kernel options as specified in grub...so where did I go wrong?

Here are my partitions:
Code:

livecd ~ # parted /dev/sda
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                           
Model: ATA Maxtor 6V250F0 (scsi)
Disk /dev/sda: 251GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Name    Flags
 1      1049kB  3146kB  2097kB                  grub    bios_grub
 2      3146kB  137MB   134MB   ext2            boot
 3      137MB   8727MB  8590MB  linux-swap(v1)  swap
 4      8727MB  251GB   242GB   ext4            rootfs

(parted)                 


Here is my fstab:
Code:

/dev/sda2               /boot           ext2            noauto,noatime  1 2
/dev/sda4               /               ext3            noatime         0 1
/dev/sda3               none            swap            sw              0 0
/dev/cdrom              /mnt/cdrom      auto            noauto,ro       0 0
/dev/fd0                /mnt/floppy     auto            noauto          0 0

Here's my grub.cfg:

Code:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if loadfont unicode ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-ceda62bb-6332-45cd-8028-9d9d57b4a91f' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ec47d9cb-5ddd-40f6-8d05-48f1d6132b3a
        else
          search --no-floppy --fs-uuid --set=root ec47d9cb-5ddd-40f6-8d05-48f1d6132b3a
        fi
        echo    'Loading Linux x86_64-3.12.13-gentoo ...'
        linux   /kernel-genkernel-x86_64-3.12.13-gentoo root=/dev/sda4 ro rootfstype=ext4
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-genkernel-x86_64-3.12.13-gentoo
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-ceda62bb-6332-45cd-8028-9d9d57b4a91f' {
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-3.12.13-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.12.13-gentoo-advanced-ceda62bb-6332-45cd-8028-9d9d57b4a91f' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                set root='hd0,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ec47d9cb-5ddd-40f6-8d05-48f1d6132b3a
                else
                  search --no-floppy --fs-uuid --set=root ec47d9cb-5ddd-40f6-8d05-48f1d6132b3a
                fi
                echo    'Loading Linux x86_64-3.12.13-gentoo ...'
                linux   /kernel-genkernel-x86_64-3.12.13-gentoo root=/dev/sda4 ro rootfstype=ext4
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-3.12.13-gentoo
        }
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-3.12.13-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.12.13-gentoo-recovery-ceda62bb-6332-45cd-8028-9d9d57b4a91f' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                set root='hd0,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ec47d9cb-5ddd-40f6-8d05-48f1d6132b3a
                else
                  search --no-floppy --fs-uuid --set=root ec47d9cb-5ddd-40f6-8d05-48f1d6132b3a
                fi
                echo    'Loading Linux x86_64-3.12.13-gentoo ...'
                linux   /kernel-genkernel-x86_64-3.12.13-gentoo root=/dev/sda4 ro single rootfstype=ext4
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-3.12.13-gentoo
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###


Last edited by aggieben on Fri Apr 04, 2014 10:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Thu Apr 03, 2014 8:41 pm    Post subject: Reply with quote

edit /etc/fstab substituting the device name (nominally /dev/sda3) for the placeholder ROOT . same for BOOT placeholder (nominally /dev/sda1) use your values if different from nominal.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
aggieben
n00b
n00b


Joined: 11 Dec 2008
Posts: 16

PostPosted: Thu Apr 03, 2014 10:39 pm    Post subject: Reply with quote

I realize my post was long, but near the top I posted my fstab, which shows that I have real devices specified rather than the default placeholders. Here it is again:

My /etc/fstab (/mnt/gentoo/etc/fstab):
Code:

/dev/sda2               /boot           ext2            noauto,noatime  1 2
/dev/sda4               /               ext3            noatime         0 1
/dev/sda3               none            swap            sw              0 0
/dev/cdrom              /mnt/cdrom      auto            noauto,ro       0 0
/dev/fd0                /mnt/floppy     auto            noauto          0 0
Back to top
View user's profile Send private message
vaxbrat
l33t
l33t


Joined: 05 Oct 2005
Posts: 731
Location: DC Burbs

PostPosted: Fri Apr 04, 2014 1:23 am    Post subject: When did you run grub2-mkconfig? Reply with quote

I don't use genkernel myself but the likely culprit is that the initramfs archive may be doing something stupid to override the root=/dev/sda4 on the kernel line. That's a gzip compressed cpio archive so you can extract the files from it out by hand to a directory to inspect inside it.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Fri Apr 04, 2014 5:54 pm    Post subject: Reply with quote

'Could not find the root block device in .' suggests the initramfs did not install/activate/enable driver modules for your hard drives
apologies for my knee jerk reaction to the capital word ROOT
_________________
Defund the FCC.
Back to top
View user's profile Send private message
aggieben
n00b
n00b


Joined: 11 Dec 2008
Posts: 16

PostPosted: Fri Apr 04, 2014 11:00 pm    Post subject: Reply with quote

Looks like this was just a stupid thing - there was another disk in my system that apparently had an old MBR and grub installation pointed to it. I unplugged it and everything is fine.
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