grub-mkrescue
Create bootable image from GRUB files
TLDR
Create a bootable ISO from the current directory and save it as grub.iso
Create an ISO using GRUB files from a custom directory
Use compression for GRUB files when building the image, setting no disables compression
Disable the GRUB command-line interface in the generated image
Preload specific GRUB modules into the image
Pass additional options directly to xorriso
Display help
Display version
SYNOPSIS
grub-mkrescue [OPTION...] [ISO_IMAGES...]
PARAMETERS
-d, --directory=DIR
Use GRUB images and modules under DIR (default: /usr/lib/grub/<platform>)
-o, --output=FILE
Set output ISO filename (default: boot.img)
--modules=MODULES
Pre-load MODULES (comma-separated, repeatable)
--locales=LOCALES
Include LOCALES (comma-separated, repeatable)
--fonts=FONTS
Include FONTS (comma-separated, repeatable)
--themes=THEMES
Include THEMES (comma-separated, repeatable)
--compress[=no|gz|xz]
Compress GRUB files (default: no)
--xorriso=COMMAND
Use alternative xorriso or mkisofs command
--romfs-dir=DIR
Use DIR as ROMFS for El Torito boot images
--disk-modules
Explicitly include disk modules (e.g., ahci, pata)
--device-map=FILE
Use FILE as GRUB device map (default: /dev/null)
--help
Display help and exit
--version
Print version information and exit
DESCRIPTION
grub-mkrescue is a utility from the GRUB 2 bootloader suite designed to generate bootable ISO9660 images for rescue and recovery operations. It produces an El Torito-compliant CD-ROM image embedding the GRUB command-line rescue shell, along with optional filesystem images like other ISOs. This enables booting into GRUB to inspect filesystems, load modules, or chainload embedded images without a full OS install.
The tool assembles GRUB core images, modules, fonts, and themes from a specified directory (default: /usr/lib/grub/<platform>). It supports customization via preloading modules for specific hardware (e.g., disk drivers), languages, and compression to reduce image size. Internally, it relies on xorriso for ISO creation, allowing overrides.
Common use cases include creating standalone rescue CDs for system troubleshooting, embedding live OS ISOs for multi-boot media, or preparing images for USB drives (via dd). For example, it facilitates accessing /boot/grub/grub.cfg or repairing bootloaders on failing systems. Output images are directly burnable to CD or writable to USB, providing a portable GRUB environment with extensive module support for filesystems (ext4, NTFS, etc.), disks, and networks.
grub-mkrescue shines in minimal environments, requiring no running GRUB instance, and integrates seamlessly with GRUB's modular architecture for flexibility across architectures like x86, EFI, and ARM.
CAVEATS
Requires xorriso package; embedded ISOs must be filesystem images; large outputs may need sufficient RAM/disk space; platform-specific (e.g., i386-pc, x86_64-efi). Not for direct USB boot—use dd.
BASIC USAGE
grub-mkrescue -o rescue.iso
Generates minimal GRUB rescue ISO.
EMBED IMAGES
grub-mkrescue debian-live.iso -o multi-rescue.iso
Embeds Debian ISO into GRUB-bootable rescue image.
WITH MODULES
grub-mkrescue --modules="ext2 ntfs" -o custom.iso
Preloads filesystem modules for broad compatibility.
HISTORY
Introduced in GRUB 2.02 (2012) as evolution of GRUB2's image tools (development since 2005); enhanced in later versions for EFI/multi-arch support and compression options.
SEE ALSO
grub-install(8), grub-mkimage(1), grub-mkconfig(8), xorriso(1)


