From various online documentation pages:
… grub-mkrescue can be used to generate a rescue image with the GRUB bootloader. …
… Generates a bootable CD/USB/floppy image. …
… Make GRUB CD−ROM, disk, pendrive and floppy bootable image. …
OK, so as a rescue image, and one that claims to be bootable, one expects it to at least be … bootable.
Here is what I tried:
- used a live CD to do a fresh HDD install. During install I did manual disc partitioning to insure a root (/) partition (12GiB) and a boot (/boot/efi) partition (1GiB) only, leaving a large chunk of the disc not allocated.
- Manually create a third data partition in the free space on the hard drive.
- copied the first 14GiB of the hard drive to a fresh USB stick (A). Incidentally, this one does boot successfully (after manually fixing the GPT).
- Restart computer and boot into the hard drive install
- Insert the USB stick A (used in step 4).
- mount the USB A root partition at some
rootfs/etc/fstabto see where to mount the USB A boot partition: ````/boot/efi```; do this mount.
- mount the third HDD partition at some
- issue mkrescue command
$ sudo grub2-mkrescue -o data/image.iso rootfs/
- insert a fresh USB stick (B) into
/dev/sdaand write it.
$ sudo dd bs=16M if=data/image.iso of=/dev/sda status=progress oflag=sync
- try to boot an identical computer (without hard storage) from USB stick B.
This resulted in failure too boot.
Assuming this is standard ‘user error’, do I have the wrong expectation and understanding of what grub2-mkrescue should do, or else what am I missing?
BTW, I’ve also tried to issue
$ grub2-mkrescue -o data/image.iso
once booted from the installed HDD, as per man pages. This also resulted in an image that once written to USB does not boot.