Skip to content

Instantly share code, notes, and snippets.

@rennex
Created February 20, 2022 01:39
Show Gist options
  • Save rennex/fd12bfa3f85f4008f909315c8ef3a191 to your computer and use it in GitHub Desktop.
Save rennex/fd12bfa3f85f4008f909315c8ef3a191 to your computer and use it in GitHub Desktop.
Grub2 entry to boot Ubuntu live ISO from 2nd GPT partition
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Ubuntu 20.04 ISO" {
set root=(hd0,gpt2)
set isofile="/ubuntu-20.04.3-desktop-amd64.iso"
loopback loop $isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile persistent persistent-path=/ub2004-1/ fsck.mode=skip quiet splash --
initrd (loop)/casper/initrd
}
# btw, this file is /etc/grub.d/40_iso - run update-grub to install it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment