2

I have been following this guide to produce a customized version of Ubuntu.

As of now, the structure of the CD is complete. I just have to generate a bootable ISO image with the command:

sudo grub-mkrescue -o live_cd.iso /path/to/cd/root

I got a perfectly working iso image which boots well in VirtualBox, under UEFI mde.

The problem is when I copy the iso to my USB flash drive (using dd command) it does not boot in my real machine under UEFI mode. I get this:

enter image description here

However, I can boot the flash drive fine in legacy bios mode.
I have installed grub-efi package as well.

Can anyone tell me what I'm doing wrong?
Thanks!

1

1 Answer 1

1
  1. mount Stick

    sudo mount -t vfat /dev/sdX /mnt

  2. Install another Grub2 to USB:

    sudo grub-install --no-floppy --force --root-directory=/mnt /dev/sdX

  3. Copy iso to stick

    cp -v ~/live-cd.iso /mnt

  4. Add following to /mnt/boot/grub/grub.cfg

    set default="0"
    set timeout=10
    
    insmod fat
    set iso_path=/live-cd.iso
    loopback loop (${usb})${iso_path}
    set root=(loop)
    set bootopts="boot=casper iso-scan/filename=${iso_path} noprompt"
    
    menuentry "Boot ISO from HDD/USB" {
    linux (loop)/casper/vmlinuz $bootopts
    initrd (loop)/casper/initrd.img
    }
    

Source: https://help.ubuntu.com/community/MakeALiveCD/DVD/BootableFlashFromHarddiskInstall#Appendix_2._How_to_Make_bootable_USB_flash

It may solve your problem

2
  • Thanks, but it isn't the optimal solution I'm seeking.
    – Naveen
    Aug 15, 2015 at 15:37
  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – Mitch
    Aug 15, 2015 at 18:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .