A boot loader is a small piece of code that runs before any operating system is loaded. It is responsible for loading and starting the OS. Each operating system typically has its own boot loader.
- bootmgr: The OS loader in Windows Vista and later. Found in the System Reserved Partition or the Windows installation drive.
- Boot Configuration Database (BCD): Builds the OS selection menu in Windows Vista and later. Located at
\boot\BCD. - winload.exe: Loads Windows in Vista and later. Located at
%SystemRoot%\system32\winload.exe. - winresume.exe: Resumes Windows from hibernation. Located at
%SystemRoot%\system32\winresume.exe. - ntldr: OS loader in Windows XP and earlier. Located at
C:\ntldr. - boot.ini: Builds the OS selection menu in Windows XP and earlier. Located at
C:\boot.ini.
Windows 7 and 8 create a special "System Reserved" partition when installed on a clean disk. This partition is hidden and consumes:
- 100MB on Windows 7
- 350MB on Windows 8
- Safe Mode: Loads minimal drivers (keyboard, monitor, mouse, storage, etc.).
- Safe Mode with Networking: Adds network support.
- Safe Mode with Command Prompt: Starts Safe Mode but opens with a command prompt.
- Enable Boot Logging: Logs the boot process for troubleshooting.
- Enable VGA Mode: Starts Windows XP with a basic VGA driver.
- Last Known Good Configuration: Uses the last successful boot settings.
- Start Windows Normally: Boots without advanced startup options.
- Reboot: Restarts the system.
- EasyBCD 2.2: A tool for modifying the Windows boot loader (Vista and later).
- Press
Win + R, typediskmgmt.msc, and press Enter. - Locate the EFI partition.
- Right-click it and select Change Drive Letter and Paths.
- Click Add, assign a drive letter (e.g.,
Z:), and click OK. - Access it via File Explorer as
Z:\.
diskpartlist diskselect disk X # Replace X with the correct disk numberlist partitionselect partition Y # Replace Y with the EFI partitionassign letter=Zexitmountvol Z: /Scd /d Z:\EFIdirUsing diskpart:
diskpartselect volume Zremove letter=ZexitOr using mountvol:
mountvol Z: /Dbcdedit /enum # View current boot configurationbcdedit /set {current} safeboot minimal # Enable Safe Mode bcdedit /set {current} safeboot network # Enable Safe Mode with Networking bcdedit /delete {ID} # Delete a boot entry bootrec /fixmbr # Repair Master Boot Record (MBR) bootrec /fixboot # Fix the boot sector bootrec /scanos # Scan for installed operating systems bootrec /rebuildbcd # Rebuild the boot configuration data sudo update-grub # Update GRUB boot configuration sudo grub-install /dev/sda # Install GRUB to the primary disk cat /boot/grub/grub.cfg # View GRUB configuration This guide provides an overview of boot loaders, boot options, and key commands for Windows and Linux systems. It serves as a reference for troubleshooting and managing boot processes effectively. 🚀