Book of Eopi
  • 😍About the Author
  • 🤖ChatGPT for Cybersecurity
  • 📘CERTIFICATIONS
    • Certified Ethical Hacker (C|EH)(Practical)
      • Reconnaissance (Footprinting)
      • Scanning Networks
      • Vulnerability Analysis
      • System Hacking
      • Sniffing
      • SQL Injection
      • Remote code execution
      • Hacking Web Applications & Servers
        • Local and remote file inclusion
        • File upload bypass
        • Cross-site scripting
        • Cross-site request forgery
        • Server-side request forgery
      • Exploitation
        • Working with exploits
        • Password cracking
        • Metasploit
        • Buffer overflow
      • Cloud Computing
      • Cryptography
      • Mobile Pentesting Resources
      • Learning resources
  • 🏁My Hacking Materials
    • My Most Frequently Used Hacking Commands
    • RickdiculouslyEasy: 1 VulnHub WriteUp
    • Corrosion: 2 VulnHub WriteUp
    • Hackable: 3 VulnHub WriteUp
    • Empire: LupinOne Vulnhub WriteUp
  • 🐧101 Labs for Linux
    • 💻Hardware and System Configuration
      • LAB 1 - Boot Sequence
  • 🔧Mod Nintendo Switch Game
    • 🔹Pokémon Brilliant Diamond and Shining Pearl
      • 🟥Install mods on Nintendo Switch
      • 🟦Install mods on Yuzu/Ryujinx Emulator
      • 🔠Custom font for Pokémon BDSP
  • 📖SHARE TÀI LIỆU NVSP
    • 1️⃣HỌC PHẦN 1
    • 2️⃣HỌC PHẦN 2
    • 3️⃣HỌC PHẦN 3
    • 4️⃣HỌC PHẦN 4
    • 5️⃣HỌC PHẦN 5 (chưa hoàn thiện)
    • 6️⃣HỌC PHẦN 6
  • ⚔️Tổng Hợp Võ Lâm 2
    • 💰Server JX2 2014 - Bản Kinh Doanh
    • 👑Server JX2 2014 - Phiên bản Offline
    • 👑Server JX2 2017 - Phiên Bản Offline
    • 👑Server JX2 2021 - Phiên Bản Offline
Powered by GitBook
On this page
  • Lab Purpose:
  • Lab Tool:
  • Lab Topology:
  • Lab Walkthrough:
  • Notes:
  1. 101 Labs for Linux
  2. Hardware and System Configuration

LAB 1 - Boot Sequence

Learn how to manage boot options and understand the boot sequence.

Lab Purpose:

In this lab, you will practice issuing commands to the boot loader, and gain a deeper understanding of the Linux boot process, from BIOS/UEFI to completion.

Lab Tool:

Ubuntu 18.04 (or another distro of your choice)

Lab Topology:

A single Linux machine, or virtual machine

Lab Walkthrough:

Task 1:

Open the Terminal and run:

sudo sed -i.bak -e ‘s/GRUB_TIMEOUT=0/GRUB_TIMEOUT=10/’ -e ‘s/GRUB_ TIMEOUT_STYLE=hidden/GRUB_TIMEOUT_STYLE=menu/’ -e ‘s/GRUB_CMDLINE_ LINUX_DEFAULT=”quiet splash”/GRUB_CMDLINE_LINUX_DEFAULT=””/’ /etc/ default/grub
sudo update-grub

What you’re doing here is modifying the GRUB bootloader so that you can see the boot menu and various logs.

Run dmesg | grep ATA—you are looking for a line indicating your hard disk, beginning with something like ata2.00 or ata3.00. Make a note of this number for later.

Finally, reboot your computer or VM.

Task 2:

Upon boot, you should be greeted with a GRUB menu. Hit ‘c’ to enter the GRUB prompt. Here, you can run various bootloader commands. Use ls to explore your partitions; the format looks a bit different, for example, (hd0,msdos1). There are also commands like lsmod, lspci, and parttool. Do these look familiar? Run help for a full list.

Then, hit ESC to return to the boot menu.

Task 3:

Back at the boot menu, hit ‘e’ to enter a screen where you can modify the boot commands. Depending on your implementation, there may be a lot here, but you are looking for a line beginning with “linux”. This is the line that loads the Linux kernel, and is the most commonly modified line for editing boot options.

At the end of that line, append libata.force=[number]:disable, where [number] is the number you noted above, such as 3.00.

Now, hit Ctrl+X to boot your computer.

Task 4:

After a couple of minutes, you may notice that something has gone wrong! You have disabled your primary hard disk, causing Linux to be unable to boot. It may have looked like it was booting initially, though. That’s because the next step of the boot process is to load the initial RAM disk (initrd), prior to loading the kernel. The initrd was successful whereas the kernel step failed, which is why you should have ended up at a (initramfs) prompt.

In short, the Linux boot process goes like this:

  1. BIOS/UEFI enumerates hardware and loads code from the configured boot device (not Linux-specific).

  2. GRUB bootloader loads, parses boot commands and options.

  3. Initrd is loaded, bootstraps various filesystems and modules, and then loads the kernel.

  4. The init process is launched, which in turn executes all startup processes as configured within Linux.

Type reboot to reboot your computer/VM and return it to normalcy.

If you’d like to undo the GRUB changes made in step 1, just run:

sudo mv /etc/default/grub{.bak,}
sudo update-grub

Notes:

The reason an initial RAM disk is used is because Linux is a generic operating system meant to run on a wide variety of hardware and disk configurations. Having to enable checks for all of these configurations in the kernel directly would make the kernel much larger than necessary. Thus, a temporary filesystem is used to do all of the special case handling, and then load the correct modules along with the kernel.

PreviousHardware and System ConfigurationNextPokémon Brilliant Diamond and Shining Pearl

Last updated 2 years ago

🐧
💻