Linux Boot Flashcards
Boot Process in brief
BIOS/UEFI=>Boot sector on first hard drive (GRUB)=>Linux Kernel=>Initial RAM (hw drivers)=>Initialization system
When Initialization system starts it takes over mounting pc’s FS. At this point Initial RAM is no longer needed, and is removed.
Then, System starts services.
Boot logs and where are they generated
Boot logs are volatile and generated in ring buffer.
To look into ring buffer:
journalctl -k
dmesg
Legacy GRUB
BIOS=> 1. Stage 1: boot.img (MBR, first 512 bytes of the disk) 2. Stage 1.5: core.img 3. Stage 2: is where the actual GRUB partition is read: /boot/grub/ main files there grub.conf (RH) or menu.lst (Debian) device.map Example of grub.conf: boot=/dev/vda default=0 timeout=5 title CentOS ...<=title 0 title Windows... <= title 1
Legacy: install grub
grub-install [device] to find the located run: findmnt /boot=> example /dev/vda1 grub-install /dev/vda1 or grub-install '(hd0)'
GRUB2
UEFI=> 1. Stage 1: boot.img (MBR, first 512 bytes of the disk) GPT Header Partition Entry Array 2. Stage 1.5: core.img looks for ESP (efi system partintion) in /boot/efi this partition should be vfat or fat32 3. Stage 2: /boot/grub2/ main files: grubenv and themes /boot/grub2/grub.cfg
Modify GRUB2
RH commands start with grub2- Debian with grub- 1. View default boot entry for grub2 conf file: grub2-editenv list 2. vim /etc/default/grub: TIMEOUT= GRUB_DISABLE_SUBMENU=true GRUB_CMDLINE_LINUX= grub2-mkconfig in RH to re-read entries in /etc/default/grub and creates system grub conf file in /boot/grub2/grub.cfg
update-grub in Debian after changes in /etc/default/grub
List contents of initramfs file
lsinitrd
Create a new initramfs for kernels on the system
dracut
Location of dracut con file
/etc/dracut.conf
Omit booting of module in dracut
create file in /etc/dracut.conf.d/ dir
vim no-fcoe.conf
omit_dracutmodules+=”fcoe fcoe-uefi”
run dracut -f