grub

Grub: Boot frozen

The boot process with grub may be frozen at different stages, for a variety of reasons. This page aims to list possible scenarios, and redirect the user to a proper fix, according to scenario.

Frozen at "GRUB" after nvidia driver upgrade

Symptom:
boot computer, but before any grub boot menu is displayed, the monitor is black with the only letters "GRUB" written on it.
Context:
This happened just after a broken nvidia driver upgrade.

The general steps to fix the problem were:
1- boot into the system using a rescue disk.

Debugging grub

Table of Contents

Here are some tips for debugging strategies for grub.

During the boot process, you can press the Pause|Break key on your keyboard, and press Return to resume.

echo

See in the manual: 14.3.13 echo.

Use echo statements:

echo    'Loading initial ramdisk...'

or:

if [ -e /boot/grub/example/test1.cfg ]; then
    echo "Here"
else
    echo "There"
fi

configuration file

See also in the official manual the section: "5.4 Embedding a configuration file into GRUB".

Logs

Kernel boot parameters

Official documentation

See: man bootparam.
For up-to-date information, see the kernel source file Documentation/kernel-parameters.txt (usually within /usr/src/linux/).

Getting started

Understanding your system

There are 3 types of boot parameters:
1) linux kernel parameters, e.g. log_buf_len=1M
2) module parameter, with the module name and the parameter separated by a dot, e.g. nvidia-drm.modeset=1

/etc/grub.d/

http://linux.overshoot.tv/wiki/grub

41_custom

This script generate the following in grub.cfg:

### 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 ###

It references /boot/grub/custom.cfg, a custom file which can be used to add additional entries.

Questions:
Where is ${config_directory} set?

check:
/boot/grub/grubenv
man grub-editenv

Syndicate content