Skip to content

Instantly share code, notes, and snippets.

@Tymek
Created September 1, 2025 08:41
Show Gist options
  • Select an option

  • Save Tymek/fa7978790cd70ec35fcf01cbac1b6821 to your computer and use it in GitHub Desktop.

Select an option

Save Tymek/fa7978790cd70ec35fcf01cbac1b6821 to your computer and use it in GitHub Desktop.
OS boot info
echo '=== Kernel ==='
uname -a || true
echo
echo '=== OS Release ==='
cat /etc/os-release 2>/dev/null || true
echo
echo '=== Boot Mode ==='
if [ -d /sys/firmware/efi ]; then echo 'UEFI (EFI variables present)'; else echo 'Legacy BIOS (no /sys/firmware/efi)'; fi
echo
echo '=== GRUB Version ==='
( grub-install --version || grub2-install --version || true ) 2>&1 | head -n 2
echo
echo '=== GRUB MKCONFIG Version ==='
( grub-mkconfig -V || grub2-mkconfig -V || true ) 2>&1 | head -n 2
echo
echo '=== Boot/EFI mounts ==='
findmnt -no SOURCE,TARGET,FSTYPE,OPTIONS /boot /boot/efi 2>/dev/null || true
echo
echo '=== /boot layout ==='
ls -la /boot 2>/dev/null || true
echo '--- /boot/efi ---'
ls -la /boot/efi 2>/dev/null || true
echo
echo '=== GRUB directories ==='
ls -la /boot/grub* 2>/dev/null || true
echo
echo '=== EFI Boot entries (efibootmgr) ==='
if [ -d /sys/firmware/efi ]; then efibootmgr -v 2>/dev/null | sed -n '1,120p' || true; else echo 'Not an EFI system'; fi
echo
echo '=== Installed GRUB packages ==='
if command -v dpkg >/dev/null 2>&1; then dpkg -l | grep -E '^ii\s+grub' || true; elif command -v rpm >/dev/null 2>&1; then rpm -qa | grep -i '^grub' || true; elif command -v pacman >/dev/null 2>&1; then pacman -Qs grub || true; fi
echo
echo '=== /etc/default/grub ==='
if [ -f /etc/default/grub ]; then sed -n '1,200p' /etc/default/grub; else echo 'Not found'; fi
echo
echo '=== grub.cfg preview ==='
for p in /boot/grub/grub.cfg /boot/grub2/grub.cfg; do if [ -f "$p" ]; then echo "--- $p (first 120 lines) ---"; sed -n '1,120p' "$p"; fi; done
echo
echo '=== Partition layout (lsblk) ==='
lsblk -f || true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment