KandZ – Tuts

We like to help…!

Linux CLI HowTo 0 ๐Ÿง Linux Boot Process


0 – HowTos Linux Boot Process

โœ… How to Check if Your Computer Uses BIOS or UEFI

Why: Knowing this helps you understand how your computer boots and what files are needed.

Steps:

  1. Open a terminal (press Ctrl+Alt+T)
  2. Run:
ls -la /sys/firmware/efi/

If you see output, you have UEFI. If not, you likely have BIOS.

Alternative:

sudo dmesg | grep -i efi

๐Ÿ“‚ How to Find Your Boot Partition (UEFI Only)

Why: This is where the boot files live in modern computers.

Steps:

  1. Look for the /boot/efi folder:
ls -la /boot/efi/
  1. If it exists, that’s your EFI System Partition.

๐Ÿ“ How to See What Operating Systems Are Installed

Why: To see all your boot options and understand what’s on your computer.

Steps:

  1. At startup, when GRUB menu appears:
  • Don’t press anything yet
  • You’ll see a list like “Ubuntu”, “Windows”, etc.
  1. If you want to see it in terminal:
cat /boot/grub/grub.cfg | grep -i menuentry

๐Ÿ› ๏ธ How to Change Default Boot Option

Why: To make your preferred OS boot automatically.

Steps:

  1. Edit GRUB settings:
sudo nano /etc/default/grub
  1. Find line GRUB_DEFAULT= and change the number or name (e.g., GRUB_DEFAULT="Ubuntu").
  2. Update GRUB:
sudo update-grub

๐Ÿ“ฆ How to Check What Kernel Version You’re Running

Why: Shows which Linux version you have installed.

Steps:

  1. In terminal:
uname -r

Example output might be: 5.4.0-72-generic

๐Ÿ”ง How to See What Files Are in Your Initramfs

Why: To understand what drivers and tools are loaded early in the boot.

Steps:

  1. List contents:
sudo lsinitrd | head -20
  1. Or view full content:
sudo lsinitrd | less

๐Ÿ” How to See What Services Are Starting at Boot

Why: Understand what programs run when your system starts.

Steps:

  1. Check services that start at boot:
systemctl list-unit-files --state=enabled | head -20

๐Ÿ“‹ How to Find Your Root Filesystem Location

Why: This tells where the main Linux folder lives on your hard drive.

Steps:

  1. Check fstab file:
cat /etc/fstab

Look for lines with /dev/sda1 or similar device names.


โ— How to Boot from a Different Kernel if Current One Fails

Why: If your current kernel breaks, you can try an older one.

Steps:

  1. At GRUB menu, press e (edit)
  2. Find the line starting with linux and add recovery at the end:
linux ... recovery
  1. Press Ctrl+X to boot

๐Ÿ”„ How to Fix Bootloader Issues

Why: If you can’t boot into your OS anymore.

Steps:

  1. Boot from a live USB
  2. Mount your root partition:
sudo mount /dev/sda1 /mnt
  1. Reinstall GRUB:
sudo grub-install --root-directory=/mnt /dev/sda

๐Ÿ“ Key Files to Remember

File/DirectoryPurpose
/boot/grub/grub.cfgWhere GRUB finds all OS options
/boot/vmlinuzThe Linux kernel image
/boot/initrd.img or /boot/initramfs.imgTemporary root filesystem
/etc/fstabTells where the real hard drive folders are
/boot/efiEFI partition needed for UEFI systems

๐Ÿงช How to Make a Boot Menu Change

  1. Open terminal
  2. Edit GRUB config:
sudo nano /etc/default/grub
  1. Change GRUB_TIMEOUT=5 to GRUB_TIMEOUT=10
  2. Save and exit (Ctrl+O, then Ctrl+X)
  3. Update GRUB:
sudo update-grub

Now when you restart, the boot menu will wait 10 seconds instead of 5

Leave a Reply