(yet another) Grub2 can't find root block device

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

(yet another) Grub2 can't find root block device

Postby Zeadar » Wed Sep 19, 2012 13:10

Hello,

Every time since kernel update I boot up, grub2 complains it cannot find the root block device. I am prompted to enter another value and, fortunately, I have enough experience to figure out /dev/sdb1 is the correct answer and my system cheerfully boots up like normal.

But I don't want to write /dev/sdb1 every time I boot my system and I miss the the bootsplash which is apparently located on this root device.

I have tried most of the commands for repairing grub e.g: grub2-mkconfig -o /boot/grub/grub.cfg, grub2-install /dev/sda1 and such.

I have also tried to figure something out form /etc/grub.d/10_linux but that's way over my head.

My partition table looks like this: (output from fdisk -l)
Code: Select all
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00096dfb

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63      385559      192748+  83  Linux
/dev/sda2          385560   946051784   472833112+  83  Linux
/dev/sda3       946051785   976768064    15358140    5  Extended
/dev/sda5       946051848   960397829     7172991   83  Linux
/dev/sda6       960397893   968590979     4096543+  83  Linux
/dev/sda7       968591043   976768064     4088511   82  Linux swap / Solaris

Disk /dev/sdb: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders, total 117231408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000de1ad

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   117225471    58611712   83  Linux


Thanks in advance!
Image
Zeadar
Young Hen
 
Posts: 36
Joined: Tue Oct 27, 2009 14:19

Re: (yet another) Grub2 can't find root block device

Postby Fitzcarraldo » Thu Sep 20, 2012 12:25

So you have one (two?) different Linux distributions installed on sda, plus SL installed on sdb? Is that it? Do you have GRUB 2 installed in the MBR of sda or in the boot sector of sda1? Ditto for sdb? Are you chainloading GRUB 2 on sdb from GRUB 2 on sda? Or do you just have one GRUB 2 menu with all the Linux distributions listed in it? What are the contents of grub.cfg in each of the Linux distributions you have got installed?
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7328
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: (yet another) Grub2 can't find root block device

Postby Zeadar » Thu Sep 20, 2012 14:16

Only only one linux distribution installed; Sabayon 10. Grub2 is installed on /dev/sda e.g the MBR. on. Didn't notice fdisk -l doesn't list mountpoints. Sorry about that.

Contents of grub.cfg is
Code: Select all
#
# 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_fonts ###
### END /etc/grub.d/00_fonts ###
### 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='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 --hint='hd1,msdos1'  cb14fc65-c423-4a47-af6a-3adf66f954d7
else
  search --no-floppy --fs-uuid --set=root cb14fc65-c423-4a47-af6a-3adf66f954d7
fi
    font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
  set gfxmode=1024x768
  load_video
  # vga= is deprecated, grub2 handles this just fine
  # making grub2 res == linux fb res
  set gfxpayload=keep
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  5600aaae-25a9-4823-b6ee-326233d1db67
else
  search --no-floppy --fs-uuid --set=root 5600aaae-25a9-4823-b6ee-326233d1db67
fi
insmod png
background_image -m stretch /grub/default-splash.png
if sleep --interruptible 2 ; then
  set timeout=0
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Sabayon GNU/Linux' --class sabayon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-cb14fc65-c423-4a47-af6a-3adf66f954d7' {
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  5600aaae-25a9-4823-b6ee-326233d1db67
        else
          search --no-floppy --fs-uuid --set=root 5600aaae-25a9-4823-b6ee-326233d1db67
        fi
        echo        'Loading Linux x86_64-3.5.0-sabayon ...'
        linux        /kernel-genkernel-x86_64-3.5.0-sabayon ro 
        echo        'Loading initial ramdisk ...'
        initrd        /initramfs-genkernel-x86_64-3.5.0-sabayon
}
submenu 'Advanced options for Sabayon GNU/Linux' $menuentry_id_option 'gnulinux-advanced-cb14fc65-c423-4a47-af6a-3adf66f954d7' {
        menuentry 'Sabayon GNU/Linux, with Linux x86_64-3.5.0-sabayon' --class sabayon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.5.0-sabayon-advanced-cb14fc65-c423-4a47-af6a-3adf66f954d7' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  5600aaae-25a9-4823-b6ee-326233d1db67
                else
                  search --no-floppy --fs-uuid --set=root 5600aaae-25a9-4823-b6ee-326233d1db67
                fi
                echo        'Loading Linux x86_64-3.5.0-sabayon ...'
                linux        /kernel-genkernel-x86_64-3.5.0-sabayon ro 
                echo        'Loading initial ramdisk ...'
                initrd        /initramfs-genkernel-x86_64-3.5.0-sabayon
        }
        menuentry 'Sabayon GNU/Linux, with Linux x86_64-3.5.0-sabayon (recovery mode)' --class sabayon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.5.0-sabayon-recovery-cb14fc65-c423-4a47-af6a-3adf66f954d7' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  5600aaae-25a9-4823-b6ee-326233d1db67
                else
                  search --no-floppy --fs-uuid --set=root 5600aaae-25a9-4823-b6ee-326233d1db67
                fi
                echo        'Loading Linux x86_64-3.5.0-sabayon ...'
                linux        /kernel-genkernel-x86_64-3.5.0-sabayon ro single init_opts=single
                echo        'Loading initial ramdisk ...'
                initrd        /initramfs-genkernel-x86_64-3.5.0-sabayon
        }
        menuentry 'Sabayon GNU/Linux, with Linux x86_64-3.4.0-sabayon' --class sabayon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.4.0-sabayon-advanced-cb14fc65-c423-4a47-af6a-3adf66f954d7' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  5600aaae-25a9-4823-b6ee-326233d1db67
                else
                  search --no-floppy --fs-uuid --set=root 5600aaae-25a9-4823-b6ee-326233d1db67
                fi
                echo        'Loading Linux x86_64-3.4.0-sabayon ...'
                linux        /kernel-genkernel-x86_64-3.4.0-sabayon ro 
                echo        'Loading initial ramdisk ...'
                initrd        /initramfs-genkernel-x86_64-3.4.0-sabayon
        }
        menuentry 'Sabayon GNU/Linux, with Linux x86_64-3.4.0-sabayon (recovery mode)' --class sabayon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.4.0-sabayon-recovery-cb14fc65-c423-4a47-af6a-3adf66f954d7' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  5600aaae-25a9-4823-b6ee-326233d1db67
                else
                  search --no-floppy --fs-uuid --set=root 5600aaae-25a9-4823-b6ee-326233d1db67
                fi
                echo        'Loading Linux x86_64-3.4.0-sabayon ...'
                linux        /kernel-genkernel-x86_64-3.4.0-sabayon ro single init_opts=single
                echo        'Loading initial ramdisk ...'
                initrd        /initramfs-genkernel-x86_64-3.4.0-sabayon
        }
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/10_linux.backup ###
menuentry 'Sabayon GNU/Linux' --class sabayon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-cb14fc65-c423-4a47-af6a-3adf66f954d7' {
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  5600aaae-25a9-4823-b6ee-326233d1db67
        else
          search --no-floppy --fs-uuid --set=root 5600aaae-25a9-4823-b6ee-326233d1db67
        fi
        echo        'Loading Linux x86_64-3.5.0-sabayon ...'
        linux        /kernel-genkernel-x86_64-3.5.0-sabayon ro 
        echo        'Loading initial ramdisk ...'
        initrd        /initramfs-genkernel-x86_64-3.5.0-sabayon
}
submenu 'Advanced options for Sabayon GNU/Linux' $menuentry_id_option 'gnulinux-advanced-cb14fc65-c423-4a47-af6a-3adf66f954d7' {
        menuentry 'Sabayon GNU/Linux, with Linux x86_64-3.5.0-sabayon' --class sabayon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.5.0-sabayon-advanced-cb14fc65-c423-4a47-af6a-3adf66f954d7' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  5600aaae-25a9-4823-b6ee-326233d1db67
                else
                  search --no-floppy --fs-uuid --set=root 5600aaae-25a9-4823-b6ee-326233d1db67
                fi
                echo        'Loading Linux x86_64-3.5.0-sabayon ...'
                linux        /kernel-genkernel-x86_64-3.5.0-sabayon ro 
                echo        'Loading initial ramdisk ...'
                initrd        /initramfs-genkernel-x86_64-3.5.0-sabayon
        }
        menuentry 'Sabayon GNU/Linux, with Linux x86_64-3.5.0-sabayon (recovery mode)' --class sabayon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.5.0-sabayon-recovery-cb14fc65-c423-4a47-af6a-3adf66f954d7' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  5600aaae-25a9-4823-b6ee-326233d1db67
                else
                  search --no-floppy --fs-uuid --set=root 5600aaae-25a9-4823-b6ee-326233d1db67
                fi
                echo        'Loading Linux x86_64-3.5.0-sabayon ...'
                linux        /kernel-genkernel-x86_64-3.5.0-sabayon ro single init_opts=single
                echo        'Loading initial ramdisk ...'
                initrd        /initramfs-genkernel-x86_64-3.5.0-sabayon
        }
        menuentry 'Sabayon GNU/Linux, with Linux x86_64-3.4.0-sabayon' --class sabayon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.4.0-sabayon-advanced-cb14fc65-c423-4a47-af6a-3adf66f954d7' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  5600aaae-25a9-4823-b6ee-326233d1db67
                else
                  search --no-floppy --fs-uuid --set=root 5600aaae-25a9-4823-b6ee-326233d1db67
                fi
                echo        'Loading Linux x86_64-3.4.0-sabayon ...'
                linux        /kernel-genkernel-x86_64-3.4.0-sabayon ro 
                echo        'Loading initial ramdisk ...'
                initrd        /initramfs-genkernel-x86_64-3.4.0-sabayon
        }
        menuentry 'Sabayon GNU/Linux, with Linux x86_64-3.4.0-sabayon (recovery mode)' --class sabayon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.4.0-sabayon-recovery-cb14fc65-c423-4a47-af6a-3adf66f954d7' {
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  5600aaae-25a9-4823-b6ee-326233d1db67
                else
                  search --no-floppy --fs-uuid --set=root 5600aaae-25a9-4823-b6ee-326233d1db67
                fi
                echo        'Loading Linux x86_64-3.4.0-sabayon ...'
                linux        /kernel-genkernel-x86_64-3.4.0-sabayon ro single init_opts=single
                echo        'Loading initial ramdisk ...'
                initrd        /initramfs-genkernel-x86_64-3.4.0-sabayon
        }
}
### END /etc/grub.d/10_linux.backup ###
### 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 ###


My partition table looks like this:



Sorry I made the first post so confusing. Don't know why I didn't realize that.
Thank you for your effort.
Image
Zeadar
Young Hen
 
Posts: 36
Joined: Tue Oct 27, 2009 14:19

Re: (yet another) Grub2 can't find root block device

Postby lxnay » Thu Sep 20, 2012 17:26

You are missing 1Mb free space at the beginning of the drive. Basically, the first partition MUST start at the 2048th block (given 512 bytes blocks).
That is a strict requirement nowadays, just google about it.
Image
Join us on IRC (chat.freenode.net #sabayon or WebChat)
Submit bugs to our Bug Tracker
Follow me on Twitter
Add me on Facebook
Add me on Google+
lxnay
Land Owner
 
Posts: 3405
Joined: Thu Oct 13, 2005 23:16
Location: Italy

Re: (yet another) Grub2 can't find root block device

Postby Zeadar » Thu Sep 20, 2012 19:47

Which drive are you talking about? What are the exact keywords I should search on? Will shrinking the first partition alone fix my problem? How could this work before the kernel update?

Confused newbie doesn't understand. :(
Image
Zeadar
Young Hen
 
Posts: 36
Joined: Tue Oct 27, 2009 14:19

Re: (yet another) Grub2 can't find root block device

Postby lxnay » Thu Sep 20, 2012 20:18

Until grub2 1.99, core.img fit in the first free blocks... this is no longer true with grub 2.00.
Our installer does NOT (and did not) produce such problematic partition layouts.
Image
Join us on IRC (chat.freenode.net #sabayon or WebChat)
Submit bugs to our Bug Tracker
Follow me on Twitter
Add me on Facebook
Add me on Google+
lxnay
Land Owner
 
Posts: 3405
Joined: Thu Oct 13, 2005 23:16
Location: Italy

Re: (yet another) Grub2 can't find root block device

Postby Zeadar » Thu Sep 20, 2012 20:20

Alright then. It's a reinstall then or can I just resize the first partition?
Image
Zeadar
Young Hen
 
Posts: 36
Joined: Tue Oct 27, 2009 14:19

Re: (yet another) Grub2 can't find root block device

Postby lxnay » Thu Sep 20, 2012 20:22

I think you can resize the first partition using Gparted. But it will take some time.
Image
Join us on IRC (chat.freenode.net #sabayon or WebChat)
Submit bugs to our Bug Tracker
Follow me on Twitter
Add me on Facebook
Add me on Google+
lxnay
Land Owner
 
Posts: 3405
Joined: Thu Oct 13, 2005 23:16
Location: Italy

Re: (yet another) Grub2 can't find root block device

Postby tollgate » Sun Sep 23, 2012 8:52

lxnay wrote:You are missing 1Mb free space at the beginning of the drive. Basically, the first partition MUST start at the 2048th block (given 512 bytes blocks).
That is a strict requirement nowadays, just google about it.


Just happened to be browsing this thread. Both my Sabayon 10 systems boot fine, but like the OP my sda1 starts at block 63 and my block size is 512. So I assume I am still using Grub2 1.9x.

Are you saying that at some point I (and probably many other users) will have to move sda1 so it starts at block 2048?
tollgate
Simple Hen
 
Posts: 60
Joined: Thu May 31, 2012 3:57
Location: Jomtien, Thailand

Re: (yet another) Grub2 can't find root block device

Postby lxnay » Sun Sep 23, 2012 10:00

As I said, our Installer leaves a 1Mb free space at the beginning of any disk since 2008 or even earlier.
Anyway yes, if you upgrade your MBR through grub2-install the system won't boot anymore.
Image
Join us on IRC (chat.freenode.net #sabayon or WebChat)
Submit bugs to our Bug Tracker
Follow me on Twitter
Add me on Facebook
Add me on Google+
lxnay
Land Owner
 
Posts: 3405
Joined: Thu Oct 13, 2005 23:16
Location: Italy

Next

Return to Beginners|Newbies Area

Who is online

Users browsing this forum: silverfire and 2 guests