Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Cannot open root device "sda4"
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
db5
n00b
n00b


Joined: 20 Oct 2012
Posts: 8

PostPosted: Sat Oct 20, 2012 3:35 pm    Post subject: [SOLVED] Cannot open root device "sda4" Reply with quote

Hi,

I have recently tried to install gentoo following the handbook but I am getting an error when trying to boot now with grub.

I firstly installed grub(1) to try it and I got a similar error about not being able to find the root partition, so I have now tried grub2, following [url]http://en.gentoo-wiki.com/wiki/Grub2]this guide[/url] as you are able to use grub2-mkconfig and I thought that may help me as I might have got the grub config incorrect.

This is the error I am getting when I try to boot into Gentoo via grub2: http://i.imgur.com/UT3HX.jpg

Here is my partition layout:

Code:

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *      718848  1534093311   766687232    7  HPFS/NTFS/exFAT
/dev/sda2      1534093312  1536190463     1048576   82  Linux swap / Solaris
/dev/sda3      1536190464  1540384767     2097152   83  Linux
/dev/sda4      1540384768  1953523711   206569472   83  Linux


/dev/sda1 is my Windows partition
/dev/sda2 is my swap partition
/dev/sda3 is my boot partition
/dev/sda4 is my root partition

Just wondering if anyone knew why I am getting this error and what steps I can take to fix it.

Thanks.


Last edited by db5 on Sat Oct 20, 2012 6:03 pm; edited 2 times in total
Back to top
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Sat Oct 20, 2012 4:00 pm    Post subject: Reply with quote

db5,

Welcome to gentoo :D

Please paste back ls -l /boot and your grub.cfg
_________________
Good luck :wink:

Since installing gentoo, my life has become one long emerge :)
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Sat Oct 20, 2012 4:05 pm    Post subject: Reply with quote

grub is not the problem. grub needs to find the kernel and then provide the tools for and then initiate the kernel loading process which it is doing.
your kernel config lacks hard disk controller drivers and possibly motherboard adapter drivers.
_________________
Defund the FCC.


Last edited by DONAHUE on Sat Oct 20, 2012 4:06 pm; edited 1 time in total
Back to top
View user's profile Send private message
db5
n00b
n00b


Joined: 20 Oct 2012
Posts: 8

PostPosted: Sat Oct 20, 2012 4:06 pm    Post subject: Reply with quote

BillWho wrote:
db5,

Welcome to gentoo :D

Please paste back ls -l /boot and your grub.cfg


Hi, thanks.

My ls -l /boot is:

Code:

total 5116
-rw-r--r-- 1 root root 1896157 Oct 20 15:01 System.map-genkernel-x86_64-3.4.9-gentoo
drwxr-xr-x 2 root root    4096 Oct 20 14:49 boot
drwxr-xr-x 2 root root    4096 Oct 20 15:47 grub
drwxr-xr-x 6 root root    4096 Oct 20 16:37 grub2
-rw-r--r-- 1 root root 3311376 Oct 20 15:01 kernel-genkernel-x86_64-3.4.9-gentoo
drwx------ 2 root root   16384 Oct 20 14:38 lost+found


And my grub.cfg is:

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
set default="0"

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 [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos4'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4  e98b4fdf-ae59-4d23-8675-a81a89532e0a
else
  search --no-floppy --fs-uuid --set=root e98b4fdf-ae59-4d23-8675-a81a89532e0a
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=
  insmod gettext
fi
terminal_output gfxterm
if sleep --interruptible 0 ; then
  set timeout=10
fi
### 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-e98b4fdf-ae59-4d23-8675-a81a89532e0a' {
   load_video
   insmod gzio
   insmod part_msdos
   insmod ext2
   set root='hd0,msdos3'
   if [ x$feature_platform_search_hint = xy ]; then
     search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  b244820b-2489-455e-b080-40f8c2b8586c
   else
     search --no-floppy --fs-uuid --set=root b244820b-2489-455e-b080-40f8c2b8586c
   fi
   echo   'Loading Linux x86_64-3.4.9-gentoo ...'
   linux   /kernel-genkernel-x86_64-3.4.9-gentoo root=/dev/sda4 ro 
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-e98b4fdf-ae59-4d23-8675-a81a89532e0a' {
   menuentry 'Gentoo GNU/Linux, with Linux x86_64-3.4.9-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.4.9-gentoo-advanced-e98b4fdf-ae59-4d23-8675-a81a89532e0a' {
      load_video
      insmod gzio
      insmod part_msdos
      insmod ext2
      set root='hd0,msdos3'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  b244820b-2489-455e-b080-40f8c2b8586c
      else
        search --no-floppy --fs-uuid --set=root b244820b-2489-455e-b080-40f8c2b8586c
      fi
      echo   'Loading Linux x86_64-3.4.9-gentoo ...'
      linux   /kernel-genkernel-x86_64-3.4.9-gentoo root=/dev/sda4 ro 
   }
   menuentry 'Gentoo GNU/Linux, with Linux x86_64-3.4.9-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.4.9-gentoo-recovery-e98b4fdf-ae59-4d23-8675-a81a89532e0a' {
      load_video
      insmod gzio
      insmod part_msdos
      insmod ext2
      set root='hd0,msdos3'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  b244820b-2489-455e-b080-40f8c2b8586c
      else
        search --no-floppy --fs-uuid --set=root b244820b-2489-455e-b080-40f8c2b8586c
      fi
      echo   'Loading Linux x86_64-3.4.9-gentoo ...'
      linux   /kernel-genkernel-x86_64-3.4.9-gentoo root=/dev/sda4 ro single
   }
}

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

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

menuentry 'Windows 8 (loader) (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-E628D7FE28D7CC25' {
   insmod part_msdos
   insmod ntfs
   set root='hd1,msdos1'
   if [ x$feature_platform_search_hint = xy ]; then
     search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  E628D7FE28D7CC25
   else
     search --no-floppy --fs-uuid --set=root E628D7FE28D7CC25
   fi
   drivemap -s (hd0) ${root}
   chainloader +1
}
### 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 ###
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Sat Oct 20, 2012 4:31 pm    Post subject: Reply with quote

Virtually everybody needs the black choices:
boot the cd, run lspci -k, the 'Driver in use:' listings will tell you which choices to make in the red. in menuconfig: type / ; in the dialog type the driver name and enter; in the help find the location and the prompt

Quote:
Device Drivers --->

< > ATA/ATAPI/MFM/RLL support (DEPRECATED) --->

SCSI device support --->
< > RAID Transport Class
-*- SCSI device support
< > SCSI target support
[*] legacy /proc/scsi/ support
*** SCSI support type (disk, tape, CD-ROM) ***
<*> SCSI disk support
< > SCSI tape support
< > SCSI OnStream SC-x0 tape support
<*> SCSI CDROM support
[ ] Enable vendor-specific extensions (for SCSI CDROM)
<*> SCSI generic support

<*> Serial ATA and Parallel ATA drivers --->
--- Serial ATA and Parallel ATA drivers
[ ] Verbose ATA error reporting
[*] ATA ACPI Support
[ ] SATA Port Multiplier support
*** Controllers with non-SFF native interface ***
<*> AHCI SATA support
< > Platform AHCI SATA support
< > Initio 162x SATA support
< > ACard AHCI variant (ATP 8620)
< > Silicon Image 3124/3132 SATA support
[*] ATA SFF support (for legacy IDE and PATA)
*** SFF controllers with custom DMA interface ***
< > Pacific Digital ADMA support
< > Pacific Digital SATA QStor support
< > Promise SATA SX4 support (Experimental)

[*] ATA BMDMA support
*** SATA SFF controllers with BMDMA ***
< > Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support
< > Marvell SATA support
< > NVIDIA SATA support
< > Promise SATA TX2/TX4 support
< > Silicon Image SATA support
< > SiS 964/965/966/180 SATA support
< > ServerWorks Frodo / Apple K2 SATA support
< > ULi Electronics SATA support
< > VIA SATA support
< > VITESSE VSC-7174 / INTEL 31244 SATA support
*** PATA SFF controllers with BMDMA ***
< > ALi PATA support
< > AMD/NVidia PATA support
< > ARASAN CompactFlash PATA Controller Support
< > ARTOP 6210/6260 PATA support
< > ATI PATA support
< > ARTOP/Acard ATP867X PATA support
< > CMD64x PATA support
< > CS5510/5520 PATA support
< > CS5530 PATA support
< > CS5536 PATA support
< > Cypress CY82C693 PATA support (Very Experimental)
< > EFAR SLC90E66 support
< > HPT 366/368 PATA support
< > HPT 370/370A/371/372/374/302 PATA support
< > HPT 371N/372N/302N PATA support
< > HPT 343/363 PATA support
< > IT8213 PATA support (Experimental)
< > IT8211/2 PATA support
< > JMicron PATA support
< > Marvell PATA support via legacy mode
< > NETCELL Revolution RAID support
< > Ninja32/Delkin Cardbus ATA support
< > Nat Semi NS87415 PATA support
< > Intel PATA old PIIX support
< > OPTI FireStar PATA support (Very Experimental)
< > Promise PATA 2027x support
< > Older Promise PATA controller support
< > RADISYS 82600 PATA support (Experimental)
< > RDC PATA support
< > SC1200 PATA support
< > Intel SCH PATA support
< > SERVERWORKS OSB4/CSB5/CSB6/HT1000 PATA support
< > CMD / Silicon Image 680 PATA support
< > SiS PATA support
< > Toshiba Piccolo support (Experimental)
< > Compaq Triflex PATA support
< > VIA PATA support
< > Winbond SL82C105 PATA support
*** PIO-only SFF controllers ***
< > CMD640 PCI PATA support (Experimental)
< > Intel PATA MPIIX support
< > Nat Semi NS87410 PATA support
< > OPTI621/6215 PATA support (Very Experimental)
< > PC Tech RZ1000 PATA support
*** Generic fallback / legacy drivers ***
< > ACPI firmware driver for PATA
< > Generic ATA support
< > Legacy ISA PATA support (Experimental
)

_________________
Defund the FCC.
Back to top
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Sat Oct 20, 2012 4:35 pm    Post subject: Reply with quote

db5,

It could be missed settings in .config. I also notice that the kernel is genkernel, but no initramfs-genkernel is present. How did you build the kernel :?:
_________________
Good luck :wink:

Since installing gentoo, my life has become one long emerge :)
Back to top
View user's profile Send private message
db5
n00b
n00b


Joined: 20 Oct 2012
Posts: 8

PostPosted: Sat Oct 20, 2012 4:41 pm    Post subject: Reply with quote

BillWho wrote:
db5,

It could be missed settings in .config. I also notice that the kernel is genkernel, but no initramfs-genkernel is present. How did you build the kernel :?:


I used genkernel all to build it as I have never built my own kernel before and I didn't really know what options I needed to select.

DONAHUE wrote:
Virtually everybody needs the black choices:
boot the cd, run lspci -k, the 'Driver in use:' listings will tell you which choices to make in the red. in menuconfig: type / ; in the dialog type the driver name and enter; in the help find the location and the prompt


I will try this, thanks.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Sat Oct 20, 2012 4:55 pm    Post subject: Reply with quote

genkernel builds most drivers as modules
to boot, hard drive and file system drivers must be built into the kernel or an initrd/initramfs must load the driver modules before the kernel runs.
genkernel all builds an initramfs and copies it to /boot; you do not have an initramfs in /boot; a mystery
_________________
Defund the FCC.
Back to top
View user's profile Send private message
db5
n00b
n00b


Joined: 20 Oct 2012
Posts: 8

PostPosted: Sat Oct 20, 2012 4:59 pm    Post subject: Reply with quote

DONAHUE wrote:
genkernel builds most drivers as modules
to boot, hard drive and file system drivers must be built into the kernel or an initrd/initramfs must load the driver modules before the kernel runs.
genkernel all builds an initramfs and copies it to /boot; you do not have an initramfs in /boot; a mystery


I have noticed that too, it has happened mutiple times as I have tried formatting the partitions and then trying to re-install, each time I get:

Code:
ls: cannot access /boot/initramfs*: No such file or directory
/boot/kernel-genkernel-x86_64-3.4.9-gentoo


When I run ls /boot/kernel* /boot/initramfs*
Back to top
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Sat Oct 20, 2012 5:01 pm    Post subject: Reply with quote

db5,

Just curious - what's in
Code:
drwxr-xr-x 2 root root    4096 Oct 20 14:49 boot

_________________
Good luck :wink:

Since installing gentoo, my life has become one long emerge :)
Back to top
View user's profile Send private message
db5
n00b
n00b


Joined: 20 Oct 2012
Posts: 8

PostPosted: Sat Oct 20, 2012 5:04 pm    Post subject: Reply with quote

BillWho wrote:
db5,

Just curious - what's in
Code:
drwxr-xr-x 2 root root    4096 Oct 20 14:49 boot


ls -l /boot/boot gives
Code:
total 0
Back to top
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Sat Oct 20, 2012 5:11 pm    Post subject: Reply with quote

db5,

Well at least we know nothing is hiding there :)

Maybe it's the way you're chrooting :?:
_________________
Good luck :wink:

Since installing gentoo, my life has become one long emerge :)
Back to top
View user's profile Send private message
db5
n00b
n00b


Joined: 20 Oct 2012
Posts: 8

PostPosted: Sat Oct 20, 2012 5:16 pm    Post subject: Reply with quote

BillWho wrote:
db5,

Well at least we know nothing is hiding there :)

Maybe it's the way you're chrooting :?:


This is how I am chrooting

Code:
# chroot /mnt/gentoo /bin/env -i TERM=$TERM /bin/bash
# env-update
# source /etc/profile
# export PS1="(chroot) $PS1"
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43194
Location: 56N 3W

PostPosted: Sat Oct 20, 2012 5:17 pm    Post subject: Reply with quote

db5,

genkernel should have made and installed both your kernel and the initramfs file.
If it didn't then genkernel did not complete successfully.

Put the genkernel log onto pastebin site - wgetpaste is your friend.
If you no longer have the log, genkernel should break the same way again. rerun genkernel as you did before, just to get to the error message that tells where the log is. Then post the log.
Should you get an initramfs file in /boot this time and no failure message, genkernel ran properly. Thats not to say you will get a working kernel, just that genkernel did what it was supposed to do.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
db5
n00b
n00b


Joined: 20 Oct 2012
Posts: 8

PostPosted: Sat Oct 20, 2012 5:21 pm    Post subject: Reply with quote

NeddySeagoon wrote:
db5,

genkernel should have made and installed both your kernel and the initramfs file.
If it didn't then genkernel did not complete successfully.

Put the genkernel log onto pastebin site - wgetpaste is your friend.
If you no longer have the log, genkernel should break the same way again. rerun genkernel as you did before, just to get to the error message that tells where the log is. Then post the log.
Should you get an initramfs file in /boot this time and no failure message, genkernel ran properly. Thats not to say you will get a working kernel, just that genkernel did what it was supposed to do.


Here is my genkernel.log, http://bpaste.net/show/52466/
Back to top
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Sat Oct 20, 2012 5:39 pm    Post subject: Reply with quote

This has happened before - you just need to disable a .config setting

Refer to this post https://forums.gentoo.org/viewtopic-p-7123382.html#7123382
_________________
Good luck :wink:

Since installing gentoo, my life has become one long emerge :)
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Sat Oct 20, 2012 6:02 pm    Post subject: Reply with quote

boot cd, mount gentoo partitions, enter the chroot, nominally:
Code:
  mount /dev/sda4 /mnt/gentoo
mount /dev/sda3 /mnt/gentoo/boot
cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
mount -t proc none /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile
export PS1="(chroot) $PS1"
then
Code:
genkernel --menuconfig all
edit menuconfig to remove the bad module
Quote:
Device Drivers --->
SCSI device support --->
[ ] SCSI low-level drivers --->
which will eliminate the offending <M> LibFC module as well as a lot of SCSI low-level drivers for equipments you don't have. Exit out of menuconfig saving the configuration and allow genkernel to complete. Then
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg
exit
reboot

_________________
Defund the FCC.
Back to top
View user's profile Send private message
db5
n00b
n00b


Joined: 20 Oct 2012
Posts: 8

PostPosted: Sat Oct 20, 2012 6:03 pm    Post subject: Reply with quote

BillWho wrote:
This has happened before - you just need to disable a .config setting

Refer to this post https://forums.gentoo.org/viewtopic-p-7123382.html#7123382


Thanks for that, after disabling that and rebuilding the kernel it generated the kernel and initramfs. I then re-generated the grub config and I can now boot into it fine.

Thanks for the help everyone.
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