Grub 2 has been rewritten
completely with the purpose of allowing great flexibility and gain of
performance. Among the various improvements, the main ones are:
;
The upgrade from Grub 1 to Grub 2 is relatively
easy. You must first install the Grub 2 package with the command:
# sudo apt-get install grub-pc
Once installed, Grub 2 will present a
test menu, with the kernel images found and also allows the
menu be edited.
Once the menu is defined, Grub2 can be
permanently installed with the command:
# sudo upgrade-from-grub-legacy /boot/grub/grub.cfg
It is important that you know what the changes are
important from Grub 1 to Grub 2, namely:
Changes
In the configuration they have no effect until the update-grub command is executed.
Normally the /boot/grub/grub.cfg should not be
edited manually because it is rewritten in updates to the Grub 2 package, when
a kernel is added or removed, or the user triggers the update-grub command.
This command remakes the load menu from other configuration files
and rewrite /boot/grub/grub.cfg.
The grub-mkconfig utility
can also be used to create a configuration for Grub:
# grub-mkconfig -o /boot/grub/grub.cfg
The main menu presentation configuration file
is located in /etc/default/grub.
This file contains the main information for
that Grub 2 can assemble the menu. It defines what the default menu option will be,
the waiting times for a user action, if the menu will be displayed in mode
graphic or text mode, among other options.
Example from /etc/default/grub:
GRUB_DEFAULT=0
#GRUB_SAVEDEFAULT = true
#GRUB_HIDDEN_TIMEOUT =0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=’LSB_RELEASE
-i -s 2> /dev/null || echo Debian’ GRUB_CMDLINE_LINUX_DEFAULT=
” quiet splash” GRUB_CMDLINE_LINUX_DEFAULT=” quiet splash” GRUB_CMDLINE_LINUX_DEFAULT=
” quiet splash” GRUB_CMDLINE_LINUX_DEFAULT=” quiet splash”
GRUB_CMDLINE_LINUX_DEFAULT=” quiet splash” GRUB_
#GRUB_TERMINAL =console
#GRUB_GFXMODE =640×480
#GRUB_DISABLE_LINUX_RECOVERY =” true”
#GRUB_INIT_TUNE =” 480 440 1”
See grub’s option comment:
Defines what will be the default Grub menu option. THE
GRUB_DEFAULT parameter can assume a numeric value, the name of the option in the menu
or the word “saved”.
If the value is numeric, indicate the menu position.
at /boot/grub/grub.cfg. You can also indicate the name of the menu “Ubuntu 2.6.31”.
If the value is “saved”, the default will be set
by the grub-set-default or grub-reboot command.
If this parameter is “true”, it tells Grub
that the default menu option will always be the last operating system selected
on the menu.
This parameter defines the time in seconds that
Grub will wait for a user action until the default menu option is
chosen automatically. No menu will be displayed unless
The user presses a key (usually the ESC).
If it equals zero, the default operating system
will load automatically without waiting for any intervention.
When this option is “true”, no counter of
The weather will be presented. If it is “false”, a countdown counter will be
presented with the time set in GRUB_HIDDEN_TIMEOUT.
This option will only be effective if the directive
GRUB_HIDDEN_TIMEOUT is commented, or active, when the user presses
some key during the GRUB_HIDDEN_TIMEOUT wait time.
GRUB_TIMEOUT defines the menu wait time
until the user makes their choice. Otherwise, it will execute the option
standard.
If the value is -1, Grub will wait for the user
indefinitely.
Determines the description of
system that will be used in the menu. If nothing is defined, Grub will use the default
of the system, which is generally defined by the command:
# lsb_release -i -s 2> /dev/null || echo Debian
SUSE LINUX
This directive passes
parameters for the Kernel during normal system load.
This directive passes parameters to the Kernel
during system load, either for normal kernel load or in mode
“recovery”.
This option, if uncommented, disables the menu
in graphic mode.
Defines the resolution of the menu graphic terminal.
Disable Kernel emergency mode if it is
equal to “true”.
Defines a “sound” that grub will make before
present the menu. The format is [note tone] [length].
Example: Immediate Third Party Contacts Theme
Grade:grub_init_tune=” 480 900 2 1000 2 800 2 400 2 600 3”
The scripts in this directory are read during the
The update-grub command call and its instructions are incorporated in the file
/boot/grub/grub.cfg.
The order of the items in the grub menu is determined
by the order of the scripts in this directory. The files are read according to
number that precedes your name, in ascending order.
Configures the initial parameters, such as the mode
graphic, standard menu option. These settings are generally imported from
/etc/default/grub.
Configure the background screen, text colors, etc.
Used to locate Kernels
Hurd. It is not used in most distributions.
Identifies the Kernels on the root device and creates
the menu items. All existing kernel images in /boot will be
placed on the menu.
Search for the image in /boot/memtest86+.bin used for testing
memory. To remove this item, you must remove the image in the directory
/boot.
This script searches for Linux and other systems
existing operations on the disk and create the menu items. The variables in this
The file determines how the names will appear in the menu.
Allows you to add customized entries to the menu of
Grub.
The settings are
usually done in the /etc/default/grub file.
It is not common to directly edit scripts from the /etc/grub.d directory.
Any change made to the /boot/grub/grub.cfg is rewritten when the command
update-grub is executed.
Grub2 runs before any operating system. It will generally load the operating system directly by setting it as the default or if there is only one operating system present.
If there is more than one operating system, it will display the menu to choose from.
The default wait time for the menu is 10s. If the user doesn’t do anything, it will start loading the default menu option.
The time count can be paralyzed if any key is pressed. The user can force the menu to be displayed by pressing the SHIFT key while loading grub2.
The partition naming system in grub2 was
simplified compared to grub1. The device count remains
starting from scratch.
An sda device will be named hd0, and an sdb device will be named hd1. However, the partitions follow the “normal” numbering, so the partition sda5 will be named hd0.5 and sda3 will be hd0.3.
Learn much more about Linux in our online course. You can register here. If you already have an account, or want to create one, just log in or create your user here.
Share
The sudo command on Linux executes a given command as if it were another user.…
The ss command on Linux is extremely useful for investigating sockets, providing various information about…
Free Linux command shows the amount of total memory in use and available, as well…
The shell has structures for testing conditions and executing certain program sequences several times (loop),…
The /etc/fstab file stores the configuration of which devices should be mounted and what is…
The Netcat Command in Linux or nc is a utility used to do “almost anything”…
This website uses cookies.