3.2 Bootloaders Flashcards
What is the path to the GRUB configuration file?
The path to the GRUB configuration file is /boot/grub/grug.conf or /boot/grub/menu.lst (which is a symbolic link to /boot/grub/grub.conf).
How do you change the default operating system when using GRUB?
Change the default operating system by editing the default
option in the grub.conf file.
Which setting displays the available operating systems during system boot up?
The #hiddenmenu
option (or absence of hiddenmenu
) displays available operating systems during system boot up.
What is the syntax used to identify the root file system for each operating system in the GRUB menu?
The syntax for identifying the foot file system for each operating system is hd#,#
, where the first # is the device number and the second # is the partition, starting with zero (0) for both.
How can you require authentication for the options in the GRUB menu?
The password
option requires authentication for the options in the GRUB menu.
How many stages does GRUB have?
GRUB has two stages.
Where does Stage 1 of GRUB reside?
Stage 1 of GRUB resides in the MBR
What is the primary purpose of GRUB Stage 1?
Stage 1 of GRUB points to the location of Stage 2.
Where does Stage 2 of GRUB reside?
Stage 2 of GRUB resides in a disk partition - typically /boot
How do you install GRUB from the command line?
grub-install /dev/sda
What are the two sections of the GRUB configuration file?
- Global
- Menu Selection
How does GRUB refer to disk devices and partitions?
hd#,#
, where the first # is the device number and the second # is the partition, starting with zero (0) for both.
What is the path of the GRUB root?
- If the /boot directory is mounted to a separate partition: /grub
- If the /boot directory is on the same partition as the rest of the filesystem: /boot/grub
What are GRUB Global options?
- default: menu item that will be booted if the user makes no selection
- timeout: seconds to wait before booting the default menu item
- gfxmenu: location of image file for graphical boot menu
- splashimage: location of image file for graphical boot menu
- hiddenmenu: prevent graphical menu from being displayed at boot
- password: password required for booting
- password –md5: encrypted password required for booting
What are the GRUB Title options?
- title: Title of the menu item
- lock: Require password to boot this title
- root: Location of the partition to be mounted as GRUB root
- rootnoverify: Location of partition with an operating system GRUB might not recognize
- kernel: Location of the Linux kernel, e.g., /boot/vmlinuz
- initrd: Location of the initrd image to use when creating the initial RAM disk, e.g., /boot/initrd
Keys used with Interactive GRUB at boot time
- e: edit boot sequence commands for a menu item
- o: add boot sequence command for a menu item after the current line
- O: add boot sequence command for a menu item before the current line
- d: delete selected boot sequence command from a menu item
- a: modify kernel arguments before booting
- b: boot when done editing
- c: command line
How can you use interactive GRUB to specify a different run level?
Specify ‘3’ as a boot option.
What is the command to generate an encrypted password for GRUB?
grub-md5-crypt
What does the default
GRUB option do?
Specify the operating system that boots as the default. The value may be the entry number (e.g., 0, 1, 2) or the name of the entry (e.g., Fedora).
What does the timeout
GRUB option do?
Sets the number of seconds GRUB waits before automatically booting the default operating system.
What does the gfxmenu
GRUB option do?
Specifies the image file which is displayed for the graphical boot menu. E.g., gfxmenu=(hd0,0)/grub/splash.xpm.gz
identifies the default splash image.
What does the splashimage
GRUB option do?
Specifies the image file which is displayed for the graphical boot menu. E.g., splashimage=(hd0,0)/grub/splash.xpm.gz
identifies the default splash image.
What does the hiddenmenu
GRUB option do?
Disables/Enables the menu that lists the operating system options.
- hiddenmenu disables GRUB from displaying the available operating systems.
- # hiddenmenu displays the available operating systems.Note: Adding the pound (#) symbol to this line only prevents the operating systems from being displayed on startup. If the user hits any key before GRUB selects the default operating system, the operating systems are displayed.
What does the title
GRUB option do?
Specify the title a user sees in the menu.
What does the root
GRUB option do?
Specifies the location of the root file system. E.g., root (hd0,0)
specifies the first partition on the first hard drive as the root file system and root (hd0,1)
specifies the second partition on the first hard drive as the root file system.
What does the rootnoverify (fd0)
GRUB option do?
Specifies the floppy drive as the root file system and that it should be loaded regardless of whether GRUB recognizes it.
What does the kenrel
GRUB option do?
Specifies the kernel for the entry and kernel options. E.g., kernel /vmlinuz-2.6.33.3-85.fc13.i686
.
What does the initrd
GRUB option do?
Specifies the initial RAM disk (initrd image) file. E.g., initrd /initramfs-2.6.33.3-85.fc13.i686.img
.
What does the chainloader
GRUB option do?
Specify the number of sectors to be read. E.g., chainloader +1
specifies that GRUB should read one sector.
What does the password
GRUB option do?
Require authentication for the options in the GRUB menu.
What does the password --md5
GRUB option do?
Require authentication for the options in the GRUB menu using an encrypted password. To create an encrypted password: In a shell prompt, type grub-md5-crypt
.
What does the lock
GRUB option do?
Prevent unauthorized boot of the operating system. When the lock keyword is present for an operating system, the password is required before the user can select and boot an operating system.
What is GRUB2?
The updated version of the Grand Unified Boot Loader (GRUB) utility: any version of GRUB 1.98 or later.
What is the path of the configuration file for GRUB2?
The configuration file for GRUB2 is /boot/grub/grub.cfg. It is similar to GRUB Legacy’s /boot/grub/menu.lst. It should not be edited directly.
How should /boot/grub/grub.cfg be edited?
The /boot/grub/grub.cfg configuration file should be generated using the update-grub
command.
How does the update-grub
command generate the /boot/grub/grub.cfg GRUB2 configuration file?
The update-grub
command uses the /etc/default/grub file and the /etc/grub.d/ directory to generate the /boot/grub/grub.cfg configuration file.
What does the /etc/grub.d directory hold?
The /etc/grub.d/ directory holds script files that are read when the update-grub
command is used. The scripts are run in numeric/alphabetical order.
What are the script files that reside in the /etc/grub.d directory?
- 00_header: Sets initial appearance items such as the graphics mode, default selection, timeout, etc. These settings are typically imported from the /etc/default/grub file.
- 05_debian_theme: Sets the GRUB2 background image, text colors, selection highlighting, and themes.
- 10_linux: Identifies kernels on the root device for the operating system in use and creates menu entries.
- 30_os-prober: Executes os-prober to search for other operating systems (i.e., Windows, Linux, etc.,) and place the results in the GRUB2 menu.
- 40_custom: Allows for custom menu entries which are imported directly into /boot/grub/grub.cfg without any changes.
What does the GRUB_DEFAULT
option of the GRUB2 /etc/default/grub configuration file do?
Sets the default menu entry. Can be numeric (e.g., GRUB_DEFAULT=0
) or the complete menu entry in quotes (e.g., GRUB_DEFAULT="Ubuntu, Linux 2.6.31-9-generic"
).
What does the GRUB_SAVEDEFAULT
When GRUB_SAVEDEFAULT=true
, automatically sets the last selected OS from the menu as the default OS on the next boot. Note: GRUB_DEFAULT=saved
is required for this option to work correctly.
What does the GRUB_HIDDEN_TIMEOUT
option of the GRUB2 /etc/default/grub configuration file do?
Determines how long a screen without the GRUB2 menu will be displayed. Options:
- 0 - immediately boots to the default OS
- X - pauses and shows a blank screen for X seconds. If a user presses any key, the GRUB menu is displayed.
- (blank) - uses the value specified in the GRUB_TIMEOUT entry
What does the GRUB_HIDDEN_TIMEOUT_QUIET
option of the GRUB2 /etc/default/grub configuration file do?
Hides/displays a countdown timer. Options:
- true - does not display a countdown timer.
-
false - displays a countdown timer for the duration specified in the
GRUB_HIDDEN_TIMEOUT
entry.
What does the GRUB_TIMEOUT
option of the GRUB2 /etc/default/grub configuration file do?
Determines how long to wait for user interaction before booting into the default operating system. Options:
- X - sets the display duration in seconds.
-
-1 - causes the menu to display until the user makes a selection.
Note: The GRUB2 menu is hidden by default unless another OS is detected by the system. If there is no other OS, this line may be commented out unless the user changes it.
What does the GRUB_CMDLINE_LINUX
option of the GRUB2 /etc/default/grub configuration file do?
Adds entries to the end of the ‘linux’ command line (GRUB Legacy’s “kernel” line) for both normal and recovery modes. It is used to pass options to the kernel.
What does the GRUB_GFXMODE
option of the GRUB2 /etc/default/grub configuration file do?
Sets the resolution of the graphical menu. E.g., GRUB_GFXMODE=640x480
sets the resolution to 640x480.
You can append a color depth as well. E.g., GRUB_GFXMODE=1024x768x24
sets the resolution to 1024x768 with 24-bit colors.
Multiple resolutions may be specified if they are separated by commas. GRUB2 try each resolution in the order listed until it finds one that is supported by the system.
What does the GRUB_INIT_TUNE
option of the GRUB2 /etc/default/grub configuration file do?
Plays a single beep just prior to the GRUB2 menu display. Optional arguments include three numeric values in quotes separated by spaces: tempo, pitch, and duration.
What does the GRUB_BACKGROUND
option of the GRUB2 /etc/default/grub configuration file do?
Sets the background image during GRUB2 menu display. The full path should be used. E.g., GRUB_BACKGROUND=/usr/share/images/back.png
displays back.png as the background image.
What does the GRUB_DISABLE_OS_PROBER
option of the GRUB2 /etc/default/grub configuration file do?
Enables/disables the os-prober check of other partitions for operating systems, including Windows, Linux, etc., during execution of the update-grub command. If the os-prober is enabled, operating systems found will be placed in the GRUB2 menu. Options:
- true - disables the os-prober.
- false - enables the os-prober and will add found operating systems to the GRUB2 menu.
How do you tell which version of GRUB you are using?
Use the command grub-install -v
or grub2-install -v
to determin which version of GRUB you are using.
How are disks numbered in GRUB2?
First hard drive is “hd0,” first partition is “1,” so “hd0,1” in GRUB2 is equivalent to “hd0,0” in GRUB Legacy.