Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Can't find root during boot
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
matt_w
Apprentice
Apprentice


Joined: 17 Nov 2003
Posts: 233
Location: UK

PostPosted: Thu Nov 01, 2018 10:19 pm    Post subject: [SOLVED] Can't find root during boot Reply with quote

TL:DR - genkernel did not compile with SCSI support so upon attempting to boot, the kernel could not find my hard drive. Rebuilding the kernel so that sata/scsi support was included solved the problem.

OP:

I'm thinking that the grub.cfg isn't lining up with what's in my /etc/fstab - I'm not sure how these are supposed to look in comparison to one another. If this isn't the problem, then genkernel might have missed some driver for my motherboard or something?

Relevant parts..
Code:
livecd ~ # cat /mnt/gentoo/etc/fstab

# <fs>         <mountpoint>       <type>      <opts>            <dump/pass>
/dev/sda2      /boot                ext2      defaults,noatime      1   2
/dev/sda3      none                 swap      sw                    0   0
/dev/sda4      /                    ext4      noatime,discard       0   1
/dev/sda5      /home                ext4      noatime,discard       0   2



Whole thing since I'm not sure what relevant and what's not..
Code:
livecd ~ # cat /mnt/gentoo/boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-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 [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4  c0d7df36-450c-4604-99f1-7c2f78a8210e
else
  search --no-floppy --fs-uuid --set=root c0d7df36-450c-4604-99f1-7c2f78a8210e
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=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
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-c0d7df36-450c-4604-99f1-7c2f78a8210e' {
   load_video
   if [ "x$grub_platform" = xefi ]; then
      set gfxpayload=keep
   fi
   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  1dd90af8-01da-4aef-b349-ccf33fd12d67
   else
     search --no-floppy --fs-uuid --set=root 1dd90af8-01da-4aef-b349-ccf33fd12d67
   fi
   echo   'Loading Linux x86_64-4.14.65-gentoo ...'
   linux   /kernel-genkernel-x86_64-4.14.65-gentoo root=UUID=c0d7df36-450c-4604-99f1-7c2f78a8210e ro 
   echo   'Loading initial ramdisk ...'
   initrd   /initramfs-genkernel-x86_64-4.14.65-gentoo
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-c0d7df36-450c-4604-99f1-7c2f78a8210e' {
   menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.14.65-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.14.65-gentoo-advanced-c0d7df36-450c-4604-99f1-7c2f78a8210e' {
      load_video
      if [ "x$grub_platform" = xefi ]; then
         set gfxpayload=keep
      fi
      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  1dd90af8-01da-4aef-b349-ccf33fd12d67
      else
        search --no-floppy --fs-uuid --set=root 1dd90af8-01da-4aef-b349-ccf33fd12d67
      fi
      echo   'Loading Linux x86_64-4.14.65-gentoo ...'
      linux   /kernel-genkernel-x86_64-4.14.65-gentoo root=UUID=c0d7df36-450c-4604-99f1-7c2f78a8210e ro 
      echo   'Loading initial ramdisk ...'
      initrd   /initramfs-genkernel-x86_64-4.14.65-gentoo
   }
   menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.14.65-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.14.65-gentoo-recovery-c0d7df36-450c-4604-99f1-7c2f78a8210e' {
      load_video
      if [ "x$grub_platform" = xefi ]; then
         set gfxpayload=keep
      fi
      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  1dd90af8-01da-4aef-b349-ccf33fd12d67
      else
        search --no-floppy --fs-uuid --set=root 1dd90af8-01da-4aef-b349-ccf33fd12d67
      fi
      echo   'Loading Linux x86_64-4.14.65-gentoo ...'
      linux   /kernel-genkernel-x86_64-4.14.65-gentoo root=UUID=c0d7df36-450c-4604-99f1-7c2f78a8210e ro single
      echo   'Loading initial ramdisk ...'
      initrd   /initramfs-genkernel-x86_64-4.14.65-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 ###


just for kicks:
Code:
livecd ~ # blkid
/dev/loop0: TYPE="squashfs"
/dev/sda2: UUID="1dd90af8-01da-4aef-b349-ccf33fd12d67" TYPE="ext2" PARTUUID="c87d7f83-cb81-5e41-ad3a-0e706b13dc9a"
/dev/sda3: UUID="a9e2dd9b-bfb3-4430-8797-433315348dfa" TYPE="swap" PARTUUID="5b7d6707-5b1d-c449-b21f-ef0532f81f4c"
/dev/sda4: UUID="c0d7df36-450c-4604-99f1-7c2f78a8210e" TYPE="ext4" PARTUUID="264324db-5f1e-194e-a633-9b780c840217"
/dev/sda5: UUID="8c110ea1-5dcc-4f0a-9c61-097950026fb6" TYPE="ext4" PARTUUID="a3104c5d-ece6-1846-ab83-1f26bdbebf6f"
/dev/sdb1: UUID="2018-10-29-02-12-38-44" LABEL="Gentoo amd64 20181028T214502Z" TYPE="iso9660" PTUUID="6b8b4567" PTTYPE="dos" PARTUUID="6b8b4567-01"
/dev/sdb2: SEC_TYPE="msdos" LABEL="GENTOOLIVE" UUID="C964-1D6E" TYPE="vfat" PARTUUID="6b8b4567-02"
/dev/sda1: PARTUUID="cce8b9b8-d41c-6745-b520-59fad8b85fe2"


Last edited by matt_w on Mon Nov 05, 2018 4:46 am; edited 4 times in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9824
Location: almost Mile High in the USA

PostPosted: Fri Nov 02, 2018 1:00 am    Post subject: Reply with quote

My guess is that genkernel indeed is missing a driver for your motherboard.

What you need to look for in that big long grub.cfg is the "linux ..." statements such as
Code:
   echo   'Loading Linux x86_64-4.14.65-gentoo ...'
   linux   /kernel-genkernel-x86_64-4.14.65-gentoo root=UUID=c0d7df36-450c-4604-99f1-7c2f78a8210e ro
   echo   'Loading initial ramdisk ...'
   initrd   /initramfs-genkernel-x86_64-4.14.65-gentoo

This tells me you're using initramfs and grub2 is also assuming you are using initramfs because root=UUID is not natively supported by the kernel.

I was about to ask about your blkid but luckily you got it, this was critical. As you can see the UUID of c0d7df36-450c-4604-99f1-7c2f78a8210e lines up with /dev/sda4 which is what you have in your /etc/fstab:
Code:
/dev/sda4: UUID="c0d7df36-450c-4604-99f1-7c2f78a8210e" TYPE="ext4" PARTUUID="264324db-5f1e-194e-a633-9b780c840217"

Hence, should look into missing driver issues.

You could also use UUID=XXXX in your fstab if you wish, modern mount tools and kernel knows how to convert those back to their /dev/sdXY block devices.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22672

PostPosted: Fri Nov 02, 2018 1:50 am    Post subject: Reply with quote

If you still need help, please post the last 20 lines of kernel output, ending where it says it cannot find the root device. That output can help us understand what steps succeeded and which step failed. That in turn will tell us which solutions are likely to apply.
Back to top
View user's profile Send private message
matt_w
Apprentice
Apprentice


Joined: 17 Nov 2003
Posts: 233
Location: UK

PostPosted: Fri Nov 02, 2018 3:27 am    Post subject: Reply with quote

Hu wrote:
If you still need help, please post the last 20 lines of kernel output, ending where it says it cannot find the root device. That output can help us understand what steps succeeded and which step failed. That in turn will tell us which solutions are likely to apply.

This really seems to me like a kernel config issue, the root device is correct.

Code:

>> Loading modules

<snip>

:: Loading from dmraid: <moves too quickly>
:: Loading from mdadm: dm-mod dm-snapshot <+ other stuff>
:: Loading from fs: nfs fuse squashfs cramfs configfs msdos
:: Loading from net: atl1c bnx2 e1000 igb pcnet32 r8169 sky2 tg3 virtio_net vmxnet3 macvlan vxlan bonding vxge cxgb4 cxgb cxgb3 tulip ixgbe ixgb virtio_net
:: Loading from crypto: sha256_generic cbc xts
>> Determining root device
!! Could not find the root block device in UUID=c0d7df36-450c-4604-99f1-7c2f78a8210e
!! - Please specify another value or:
!! - press Enter for the same
!! - type “shell” for shell
!! - type “q” to skip
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9824
Location: almost Mile High in the USA

PostPosted: Fri Nov 02, 2018 4:09 am    Post subject: Reply with quote

Yeah, likely.

You can start up the "shell" and run "blkid" there and verify that you can't see the hard disk... I think the error means that it can't find the device versus can't mount due to missing filesystem driver but I'm not sure. If blkid reports your partition, then likely you don't have the filesystem driver in your initramfs or built into your kernel.

Now I have never used genkernel so I don't know what's involved, but posting the contents of your lspci might be helpful.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
matt_w
Apprentice
Apprentice


Joined: 17 Nov 2003
Posts: 233
Location: UK

PostPosted: Fri Nov 02, 2018 4:27 am    Post subject: Reply with quote

eccerr0r wrote:
Yeah, likely.

You can start up the "shell" and run "blkid" there and verify that you can't see the hard disk... I think the error means that it can't find the device versus can't mount due to missing filesystem driver but I'm not sure. If blkid reports your partition, then likely you don't have the filesystem driver in your initramfs or built into your kernel.

I'll give that a go - it'd be nice to confirm this, at least, is the issue.
EDIT: blkid returns nothing, blkid -o list returns:
Code:

device .     fs_type .     label .     mount point       UUID
----------------------------------------------------------------------------------

So it looks like you're right: it's not seeing the hard disk

Quote:
...posting the contents of your lspci might be helpful.

As requested:
Code:

(chroot) livecd / # lspci
00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 12)
00:01.0 PCI bridge: Intel Corporation Core Processor PCI Express x16 Root Port (rev 12)
00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06)
00:1a.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05)
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 05)
00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 05)
00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 (rev 05)
00:1d.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a5)
00:1f.0 ISA bridge: Intel Corporation HM55 Chipset LPC Interface Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 4 port SATA AHCI Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 05)
00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 05)
02:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Madison [Mobility Radeon HD 5650/5750 / 6530M/6550M]
02:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Redwood HDMI Audio [Radeon HD 5000 Series]
03:00.0 Ethernet controller: Broadcom Limited NetLink BCM57780 Gigabit Ethernet PCIe (rev 01)
05:00.0 Network controller: Qualcomm Atheros AR928X Wireless Network Adapter (PCI-Express) (rev 01)
ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 02)
ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 02)
ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 02)
ff:02.1 Host bridge: Intel Corporation 1st Generation Core i3/5/7 Processor QPI Physical 0 (rev 02)
ff:02.2 Host bridge: Intel Corporation 1st Generation Core i3/5/7 Processor Reserved (rev 02)
ff:02.3 Host bridge: Intel Corporation 1st Generation Core i3/5/7 Processor Reserved (rev 02)


This might be a dumb question, but can I rebuild my own kernel manually using 'make menuconfig' and just... delete the old one? Not like it works..
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9824
Location: almost Mile High in the USA

PostPosted: Fri Nov 02, 2018 4:46 am    Post subject: Reply with quote

You should be able to, that's what I do, I don't use genkernel...

I'm surprised it omitted the AHCI drivers you need for your kernel. Unfortunately I don't know exactly what's needed to get that to build. It looks like genkernel using the --menuconfig option should give you that menuconfig that you're accustomed to seeing. Supposedly you can just use "make menuconfig" as usual and save the config, and then go back to genkernel and it will use that configuration too!

IMHO the only reason to use genkernel is for that initramfs if it's needed. I use a custom initramfs that I built a while ago and keep using it due to "not invented here syndrome" :( alas the Gentoo initramfs looks pretty full of features mine doesn't have.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1186

PostPosted: Fri Nov 02, 2018 6:33 am    Post subject: Reply with quote

If the only problem seems to be the wrong UUID, have you attempted manually changing the boot option from Grub to load based on the device location in the form of root=/dev/sdx, which is something I seem to recall having to do numerous occasions with regards to UUID being a non-option under certain conditions, like in case you don't have an initramfs or as others have pointed out that gentoo's initramfs is unique and I don't know if it does the job of telling init where the filesystem is to be mounted, if I have that right. Try a few other boot lines, and then once you get it right that would be a good time to go back and discover which of the many boot parameters are acceptable to the different moving parts (there is hardware and software to be concerned with this one).
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9824
Location: almost Mile High in the USA

PostPosted: Fri Nov 02, 2018 7:31 am    Post subject: Reply with quote

Well, we have proven that the kernel did not load the right drivers since the blkid experiment in the initramfs failed to report his hard drive, so even if hardcoded /dev/sdXY were used, it will not work....

UUID and LABEL are supported by the genkernel initramfs as well as many other initramfs (dracut, and my homemade one). Without initramfs, only PARTUUID is usable. With a kernel lacking all the necessary drivers, none of these are usable :)
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
matt_w
Apprentice
Apprentice


Joined: 17 Nov 2003
Posts: 233
Location: UK

PostPosted: Fri Nov 02, 2018 7:45 am    Post subject: Reply with quote

Rebuilt the kernel manually - the system works!
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