Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Grub

Basic Commands

CommandDescription
helpList all available commands
help <command>Show help for a specific command
lsList all disks and partitions
ls (hdX,Y)Inspect filesystem on partition
setView/set environment variables
insmodLoad module (e.g., ext2, ntfs)
rebootReboot the system

Device & Filesystem

CommandDescription
ls -lDetailed device listing
cat (hdX,Y)/path/fileView file contents
loopbackMount ISO image files

Boot Commands

CommandDescription
linux/linux16/linuxefiLoad Linux kernel
initrdLoad initramfs image
chainloaderChainload another bootloader
bootBoot the loaded system

Environment Variables

VariablePurposeExample
rootSet root partitionset root=(hd0,gpt2)
prefixSet GRUB directory pathset prefix=(hd0,gpt1)/boot/grub
defaultDefault boot entryset default=0
timeoutTimeout in secondsset timeout=5

Practical Examples

# Typical Linux boot sequence
set root=(hd0,gpt2)
linux /vmlinuz root=/dev/sda2 ro
initrd /initramfs.img
boot

# Boot from ISO file
loopback loop /path/to/image.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/image.iso
initrd (loop)/casper/initrd
boot