Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Grub2 hangs at loading initial ramdisk
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
vokiel
Tux's lil' helper
Tux's lil' helper


Joined: 01 Oct 2004
Posts: 110

PostPosted: Fri Mar 31, 2017 3:13 am    Post subject: [SOLVED] Grub2 hangs at loading initial ramdisk Reply with quote

Looked around a bit, unfortunately I'm short on solutions that would fix it. I am booting in Pure UEFI mode, so I may be missing something somewhere. I tried this without the add_efi_memmap with no difference.

I'm wondering If I don't have some framebuffer/console issue but in any case here's some configs I have, I'd be glad to get new ideas. Thanks.

blkid:

Code:

/dev/loop0: TYPE="squashfs"
/dev/sda1: UUID="1926b3fc-3063-437e-ba6e-60a07f321d23" TYPE="ext2" PARTLABEL="/boot" PARTUUID="e7ec08db-3929-4cb5-90bd-c1a238802158"
/dev/sda2: UUID="7CA5-F437" TYPE="vfat" PARTLABEL="/boot/efi" PARTUUID="0567e57d-4e83-4b1c-b0b2-d6cb3a71eed3"
/dev/sda3: UUID="ad5dab09-eb90-467b-a439-ae6e1311762b" TYPE="swap" PARTLABEL="swap" PARTUUID="fc25657a-52fb-4b08-91c2-c76aadc6b416"
/dev/sda4: UUID="b093fe62-bc1f-40b8-80d7-97dbd76665f6" TYPE="ext4" PARTLABEL="/" PARTUUID="43b058b9-3fe5-42b7-831c-1ad4d285164b"
/dev/sda5: UUID="fa3384fe-cee9-430a-a6b5-01a2e43d1487" TYPE="ext4" PARTLABEL="/var" PARTUUID="baa95ebd-7268-4024-9820-5b9843ff2414"
/dev/sda6: UUID="b8099f51-48b4-4865-b12d-10e686841374" TYPE="ext4" PARTLABEL="/var/log" PARTUUID="9fda307c-ecc3-4a00-a65b-fe5425f7fbf8"
/dev/sda7: UUID="d5603030-ea0d-4b9a-bd6f-e54e5dc40c6b" TYPE="ext4" PARTLABEL="/var/tmp" PARTUUID="30cec216-3e80-4a1a-af1f-a4eb20dc475b"
/dev/sda8: UUID="9111aac2-21bf-4401-8794-e79cd44ca2f0" TYPE="xfs" PARTLABEL="/usr/portage" PARTUUID="9cfb89c5-c736-4966-83e0-85098be922e5"
/dev/sda9: UUID="3d25960f-78df-4d26-86a2-afdb9c101954" TYPE="ext4" PARTLABEL="/opt" PARTUUID="245aa901-9a22-40ae-a00b-dcba3317219f"
/dev/sda10: UUID="1af94d1a-15ee-4bb5-b91f-ee60ed7ad802" TYPE="crypto_LUKS" PARTLABEL="/home" PARTUUID="584e0fbc-9d30-45c1-b94e-ec0359923ef7"
/dev/sda11: UUID="d60ed62f-9e1a-488d-aac5-b7ee1a536b94" TYPE="xfs" PARTLABEL="/media" PARTUUID="75e68e9e-229e-4d78-b49a-74527ee95e00"
/dev/sdb1: LABEL="SYSRESC" UUID="F6AC-DE81" TYPE="vfat" PARTUUID="00042139-01"


/boot/grub/grub.cfg

Code:

#
# 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  b093fe62-bc1f-40b8-80d7-97dbd76665f6
else
  search --no-floppy --fs-uuid --set=root b093fe62-bc1f-40b8-80d7-97dbd76665f6
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=800x600
  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-b093fe62-bc1f-40b8-80d7-97dbd76665f6' {
        load_video
        if [ "x$grub_platform" = xefi ]; then
                set gfxpayload=keep
        fi
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  1926b3fc-3063-437e-ba6e-60a07f321d23
        else
          search --no-floppy --fs-uuid --set=root 1926b3fc-3063-437e-ba6e-60a07f321d23
        fi
        echo    'Loading Linux 4.9.16-gentoo ...'
        linux   /vmlinuz-4.9.16-gentoo root=UUID=b093fe62-bc1f-40b8-80d7-97dbd76665f6 ro  add_efi_memmap rootfstype=ext4
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-genkernel-x86_64-4.9.16-gentoo
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-b093fe62-bc1f-40b8-80d7-97dbd76665f6' {
        menuentry 'Gentoo GNU/Linux, with Linux 4.9.16-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.16-gentoo-advanced-b093fe62-bc1f-40b8-80d7-97dbd76665f6' {
                load_video
                if [ "x$grub_platform" = xefi ]; then
                        set gfxpayload=keep
                fi
                insmod gzio
                insmod part_gpt
                insmod ext2
                set root='hd0,gpt1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  1926b3fc-3063-437e-ba6e-60a07f321d23
                else
                  search --no-floppy --fs-uuid --set=root 1926b3fc-3063-437e-ba6e-60a07f321d23
                fi
                echo    'Loading Linux 4.9.16-gentoo ...'
                linux   /vmlinuz-4.9.16-gentoo root=UUID=b093fe62-bc1f-40b8-80d7-97dbd76665f6 ro  add_efi_memmap rootfstype=ext4
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.9.16-gentoo
        }
        menuentry 'Gentoo GNU/Linux, with Linux 4.9.16-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.9.16-gentoo-recovery-b093fe62-bc1f-40b8-80d7-97dbd76665f6' {
                load_video
                if [ "x$grub_platform" = xefi ]; then
                        set gfxpayload=keep
                fi
                insmod gzio
                insmod part_gpt
                insmod ext2
                set root='hd0,gpt1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  1926b3fc-3063-437e-ba6e-60a07f321d23
                else
                  search --no-floppy --fs-uuid --set=root 1926b3fc-3063-437e-ba6e-60a07f321d23
                fi
                echo    'Loading Linux 4.9.16-gentoo ...'
                linux   /vmlinuz-4.9.16-gentoo root=UUID=b093fe62-bc1f-40b8-80d7-97dbd76665f6 ro single
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.9.16-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 vokiel on Fri Mar 31, 2017 11:46 pm; edited 1 time in total
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Fri Mar 31, 2017 4:41 am    Post subject: Reply with quote

Quote:
Grub2 hangs at loading initial ramdisk


I assume your kenrel does not load correct? just your bootloader

or do you see your kernel? (which i most likely doubt as of now in my understanding of grub2 wiht uefi)

Code:
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b093fe62-bc1f-40b8-80d7-97dbd76665f6' {
        load_video
        if [ "x$grub_platform" = xefi ]; then
                set gfxpayload=keep
        fi
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  1926b3fc-3063-437e-ba6e-60a07f321d23
        else
          search --no-floppy --fs-uuid --set=root 1926b3fc-3063-437e-ba6e-60a07f321d23
        fi
        echo    'Loading Linux 4.9.16-gentoo ...'
        linux   /vmlinuz-4.9.16-gentoo root=UUID=b093fe62-bc1f-40b8-80d7-97dbd76665f6 ro  add_efi_memmap rootfstype=ext4
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-genkernel-x86_64-4.9.16-gentoo
}


rant: These grub generated boot entires are just crap

AFAIK set root='hd0,gpt1'

should be second partition

--

Have a look:

Code:
ASUS-G75VW roman # blkid
/dev/sda1: PARTLABEL="grub" PARTUUID="4703ed5f-d593-4f4a-88f7-54fca61ea851"
/dev/sda2: SEC_TYPE="msdos" UUID="82FC-C0ED" TYPE="vfat" PARTLABEL="boot" PARTUUID="cfb4c72a-4a3a-40f0-bc01-689d9edd5624"
/dev/sda3: UUID="..." TYPE="LVM2_member" PARTUUID="..."
/dev/sdb2: UUID="..." TYPE="ext4" PARTUUID="..."
/dev/mapper/....: UUID="...." TYPE="..."
/dev/mapper/...t: UUID="..." TYPE="..."


Quote:
/dev/sda2: SEC_TYPE="msdos" UUID="82FC-C0ED" TYPE="vfat" PARTLABEL="boot" PARTUUID="cfb4c72a-4a3a-40f0-bc01-689d9edd5624"


2nd partition

Code:
menuentry ' Besitzer:  ' {
        insmod part_gpt
        set root='hd0,gpt2'
        echo    ' boot entry for SanDisk SSD'

    linux /4.9.17-gentoo-23-03-2017   rootfstype=.. keymap=.. init=.. ramdisk=.. dolvm ro real_root=.. crypt_root=..
    initrd /early_ucode.cpio /initramfs-genkernel-x86_64-4.2.3-gentoo

}


note

Quote:
set root='hd0,gpt2'


2nd partition

ignore the linux / initrd part, that is my box specific.

not sure if that is important SEC_TYPE="msdos"

--

off topic, just hint: when you use luks

Quote:
/dev/sda10: UUID="1af94d1a-15ee-4bb5-b91f-ee60ed7ad802" TYPE="crypto_LUKS" PARTLABEL="/home" PARTUUID="584e0fbc-9d30-45c1-b94e-ec0359923ef7"


than you should use luks for everything except /Boot (like i do)

as you can see on my layout above, my root is => hdd => lvm2 => luks => ext4
anything else is according to the gentoo handbook for uefi hardware(i moved my installation over a year ago to this hardware)
Back to top
View user's profile Send private message
vokiel
Tux's lil' helper
Tux's lil' helper


Joined: 01 Oct 2004
Posts: 110

PostPosted: Fri Mar 31, 2017 12:02 pm    Post subject: Reply with quote

Roman_Gruber wrote:
Grub2 hangs at loading initial ramdisk

I assume your kenrel does not load correct? just your bootloader

or do you see your kernel? (which i most likely doubt as of now in my understanding of grub2 wiht uefi)



I assume it loads as I do get rc logs on every boot.

I'm going to play with grub.cfg as you suggested, but I'm leaning towards a EFI + Nvidia + framebuffer problem. I don't have the nvidia driver installed yet or nouveau for that matter, maybe that's the issue. I just assumed I could boot this thing far enough with generic video card support.

Edit: Looking at my laptop, I have set root='hd1,gpt2'. It seems my /boot & /boot/efi are inverted on this new install, so gpt1 is probably right. It should point on the kernel partition anyway.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Fri Mar 31, 2017 10:15 pm    Post subject: Reply with quote

vokiel wrote:

I assume it loads as I do get rc logs on every boot.

I'm going to play with grub.cfg as you suggested, but I'm leaning towards a EFI + Nvidia + framebuffer problem. I don't have the nvidia driver installed yet or nouveau for that matter, maybe that's the issue. I just assumed I could boot this thing far enough with generic video card support.

Edit: Looking at my laptop, I have set root='hd1,gpt2'. It seems my /boot & /boot/efi are inverted on this new install, so gpt1 is probably right. It should point on the kernel partition anyway.


When you see the kernel than it is not a grub problem anymore.

You have now to check where it stops.

Is root mounted?

=> is init started and does it run to the end? where does it ends

-=>> grub usually points to the vfat boot partition, assuming uefi + gentoo handbook layout. OFC there are different ways to boot a box, thats out of scope now.


Some guys upload a picture from their smartphone from the screen where the Operating system hangs. that makes thing also much easier for us to help you.

--

I may suggest that you check with a livecd which kernel modules are in use, and recheck your kernel. recheck if your root gets mounted, check if it runs through init, where it stops.
Back to top
View user's profile Send private message
vokiel
Tux's lil' helper
Tux's lil' helper


Joined: 01 Oct 2004
Posts: 110

PostPosted: Fri Mar 31, 2017 11:03 pm    Post subject: Reply with quote

I get the following lines on screen:

Code:

Booting Gentoo GNU/Linux'

Loading Linux 4.9.16-gentoo....
Loading initial ramdisk ...


Then nothing, but as I hinted I get rc.logs entries for each boot attempt, they look like:

Code:

rc sysinit logging started at Fri Mar 31 18:38:07 2017


   OpenRC 0.23.2 is starting up Gentoo Linux (x86_64)

 * /proc is already mounted
 * Mounting /run ...
 * /run/openrc: creating directory
 * /run/lock: creating directory
 * /run/lock: correcting owner
 * Caching service dependencies ...
File descriptor 3 (pipe:[4595]) leaked on lvm invocation. Parent PID 1900: /bin/sh
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
 [ ok ]
 * Remounting devtmpfs on /dev ...
 [ ok ]
 * Mounting /dev/mqueue ...
 [ ok ]
 * Mounting /dev/shm ...
 [ ok ]
 * Creating list of required static device nodes for the current kernel ...
 [ ok ]
 * Loading kernel modules ...
insmod /lib/modules/4.9.16-gentoo/kernel/fs/binfmt_misc.ko
 [ ok ]
 * Mounting fuse control filesystem ...
 [ ok ]
 * Mounting persistent storage (pstore) filesystem ...
 [ ok ]
 * Mounting cgroup filesystem ...
 [ ok ]
 * Starting udev ...
 [ ok ]
 * Generating a rule to create a /dev/root symlink ...
 [ ok ]
 * Populating /dev with existing devices through uevents ...
 [ ok ]

rc boot logging started at Fri Mar 31 18:38:07 2017

 * Setting system clock using the hardware clock [UTC] ...
 [ ok ]
 * Checking local filesystems  ...
/dev/sda4: clean, 152925/1966080 files, 910975/7864320 blocks
/dev/sda1: clean, 359/8192 files, 22234/32768 blocks
 [ ok ]
 * Remounting root filesystem read/write ...
 [ ok ]
 * Remounting filesystems ...
 [ ok ]
 * Updating /etc/mtab ...
 * Creating mtab symbolic link
 [ ok ]
 * Activating swap devices ...
swapon: cannot open /dev/mapper/crypt-swap: No such file or directory
 [ ok ]
 * Mounting local filesystems ...
 [ ok ]
 * Mounting misc binary format filesystem ...
 [ ok ]
 * Loading custom binary format handlers ...
 [ ok ]
 * Configuring kernel parameters ...
 [ ok ]
 * Creating user login records ...
 [ ok ]
 * Setting hostname to hadron  ...
 [ ok ]
 * Setting terminal encoding [UTF-8] ...
 [ ok ]
 * Setting keyboard mode [UTF-8] ...
 [ ok ]
 * Loading key mappings [us] ...
 [ ok ]
 * Bringing up network interface lo ...
 [ ok ]
 * Initializing random number generator ...
 [ ok ]

rc boot logging stopped at Fri Mar 31 18:38:10 2017

rc default logging started at Fri Mar 31 18:38:10 2017

 * Setting up dm-crypt mappings ...
 *   crypt-swap using: -c aes-xts-plain64:sha512 -h sha256 -d /dev/urandom create crypt-swap /dev/sda3 ...
WARNING: The --hash parameter is being ignored in plain mode with keyfile specified.
 [ ok ]
 *     pre_mount: mkswap -f /dev/mapper/crypt-swap ...
 [ ok ]
 [ ok ]
 * Checking your configfile (/etc/syslog-ng/syslog-ng.conf) ...
 [ ok ]
 * Starting syslog-ng ...
 [ ok ]
 * Starting cronie ...
 [ ok ]
 * Bringing up interface enp2s0
 *   Caching network module dependencies
 *   You are using a bash array for config_enp2s0.
 *   This feature will be removed in the future.
 *   Please see net.example for the correct format for config_enp2s0.
 *   192.168.1.204 ...
 [ ok ]
 *   You are using a bash array for routes_enp2s0.
 *   This feature will be removed in the future.
 *   Please see net.example for the correct format for routes_enp2s0.
 *   Adding routes
 *     default via 192.168.1.1 ...
 [ ok ]
 [ ok ]
 * Mounting network filesystems ...
 [ ok ]
 * Starting sshd ...
 [ ok ]
 * Starting local ...
 [ ok ]

rc default logging stopped at Fri Mar 31 18:38:12 2017


Some problem with lvm, I'm not too sure that's really important, I'm not consciously using it as far as I know. Some other issue with crypt-swap being created after attempting to mount it. Not quite reasons enough to blank the screen.
Back to top
View user's profile Send private message
vokiel
Tux's lil' helper
Tux's lil' helper


Joined: 01 Oct 2004
Posts: 110

PostPosted: Fri Mar 31, 2017 11:45 pm    Post subject: Reply with quote

All right got the lack of output on the screen fixed. I believe missing the following from my Kernel config was an issue:

CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y

And probably the nomodeset option for the nvidia card, but since I don't have the driver yet, I'm not sure.
Back to top
View user's profile Send private message
vokiel
Tux's lil' helper
Tux's lil' helper


Joined: 01 Oct 2004
Posts: 110

PostPosted: Fri Mar 31, 2017 11:46 pm    Post subject: Reply with quote

As always thanks for the help, much appreciated :)
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