SM1: Open-source Operating Systems ASIX/DAW/DAM-1 Task A6: The Linux Boot Process
6-12-23

TASK A6: The Linux Boot Process

GENERAL CONDITIONS


a) Deadline ASIX1: On 14-12-23 teacher will check that your operating system is working properly   

   Deadline DAW1: On 19-12-23 teacher will check that your operating system is working properly

b) Teacher will check on your computer:
    - Part 1 -> question  3
    - Part 2 -> questions 1 to 5
 


DOCUMENTATION

1- Bootstrat or boot  process. MBR. Boot Loader. GRUB.

It is the process of loading an operating system into memory and starting it running without any outside help or assistance. If you are ruunig Linux, the following steps are taken in order to start the operating system:

1
st step) When  you turn on the computer, the CPU begins run a set of programs installed on a special chip on the motherboard called BIOS.

2nd step)
When the first step finishes, instructions contained in  the BIOS make the  CPU load and start a very small program  called  Boot Loader, which is responsible for starting the operating system.  Linux works with a  Boot Loader called GRUB.

3rd step)
GRUB shows a menu to boot the operating system of your election (Windows, Linux.....) or different versions of  Linux.

4th step)
  Afterwards, GRUB will be responsible to boot the selected operating system and to transfer the control  of your computer to the selected operating system.


2- Configuring the GRUB menu.


a) You can change  any aspect of the GRUB menu by:
    - Editing the /etc/default/grub configurations file.
    - Renaming and changing permissions of special scripts located in
/etc/grub.d.

b)
Whenever you change the GRUB cofiguration you must run the command: sudo update-grub. If you do not run this command, GRUB  does not change its configuration and it will still work with the old configuration. 

2.1- /etc/default/grub
Changing the values of variables in the /etc/default/grub file allows you to modify many aspects of how the system boots and how GRUB displays its menu. Some of the most important variables are the following:

a) GRUB_DEFAULT: It specifies the ordinal  number of the default menu entry. Menu entries are numbered starting with 0 (0 specifies the first menu entry).
b) GRUB_TIMEOUT: It specifies the number of seconds GRUB waits before booting the operating system by default.
c) GRUB_DISABLE_RECOVERY: It specifies whether or not update-grub   generates recovery-mode menu entries. Commented out  by default. Default value is false, which means that entries are generated.
d) GRUB_DISABLE_SUBMENU: It disables ("y") or enables (with #) submenus. This option is not available by default and must be added manually at the end of the file.

IMPORTANT ---> GRUB
does not evaluate a line that begin with a hasmark (#). These lines are comments.

2.2- /etc/grub.d
The files in this folder are read during execution of  the update-grub utility. The order of the entries in the GRUB menu is based on the order of the file names. The order the files are run determines the menu order in GRUB. Some of the most important files are the following:
a) 00_header: It is the script that loads GRUB settings from /etc/default/grub, including timeout, default boot entry, and others.
b) 05_debian_theme: Sets the background and text colors themes.
c) 10_linux: It  loads the menu entries for the installed distribution. Creates a menu entry for each kernel in /boot. A kernel is specified by a file named vmlinuz-*.
d) 20_linux_xen: It loads xen linux kernels which are a special kind of virtual kernels.
e) 30_os-prober: It  is the script that will scan the hard disks for other operating systems (Windows, Linux on other partitions,....) and add them to the boot menu.

IMPORTANT NOTES:
a) Each of these files must be executable if you want update-grub to process it. If you do not want update-grub to process one of the files, remove the execute bits from the file running sudo chmod -x <filename> where <filename> should be changed with the real filename you want to change.
b) All executable files are processed in order according to their initial number.

2.3- update-grub
A utility for updating /boot/grub/grub.cfg according to the contents of the /etc/default/grub file and files in the /etc/grub.d directory.



PRACTICAL EXERCISE
 

PART 1- INSTALLING DEBIAN LINUX, WINDOWS SERVER AND THE GRUB BOOT LOADER ON A COMPUTER

1
- Create a new virtual machine with te following specifications:

2- Create a new virtual machine with the following specifications:
3- Check and show your  installation (with the help of the following video from 17:40 to 22:52 you will be able to check if everything works fine): PART  2 - Basic configuration of GRUB Boot Loader
1- Configure GRUB for waiting 15 seconds before booting the operating system by default if no key is pressed. Check and show the new configuration
2-
Remove the Advanced options for Debian GNU/Linux submenu and the Debian GNU/Linux 12.1 recovery mode option. Check and show the new configuration.
3- Make Windows Server the default menu entry Check and show the new configuration.
4- Disable the Windows Server menu entry Check and show the new configuration.
5- Restore GRUB to the initial conditions:
    - Defaut timeout = 5 seconds
    - Enable submenus
    - Enable recovery mode
    - Debian the first and default menu entry
    - Enable Windows Server.
Check and show the new configuration.