2

I am trying to boot to an USB stick from Grub, and I have found a few sites that explain how to do it, but when I follow those instructions it does not seem to work. I think those guides may simply be outdated. I did find https://askubuntu.com/a/436735, but that one seems to cover only how to add an entry to grub when it already has a working system running on it.

https://blog.viktorpetersson.com/2014/07/29/how-to-boot-from-usb-with-grub2.html tells me to run the following from the grub shell:

grub> linux (hd1,msdos1)/install/vmlinuz root=/dev/sdb1
grub> initrd (hd1,msdos1)/install/initrd.gz
grub> boot

But the stick only contains /efi/boot/bootx64.efi and /efi/boot/grubx64.efi. I found this by setting set root=(hd1,msdos2) (which is the usb stick) and then tabbing through on find /. So my question is: how can I make grub boot from this USB stick?

PS: on this computer, booting to usb from the BIOS does not seem to work.

  • 1
    UEFI or BIOS. And once you start booting in one mode, you cannot change, or grub only can boot other systems installed in same boot mode. And is USB flash drive a full install or a live installer. Full install has files as links to specific kernel in / so your instructions above will boot install. But live installer does not. Grub in live installer is for UEFI boot, and live installer uses syslinux for BIOS boot. Some more info: help.ubuntu.com/community/Installation/… – oldfred Mar 21 '19 at 14:44
  • You can also see the methods described at the following links, help.ubuntu.com/community/Installation/iso2usb#Do_it_yourself and help.ubuntu.com/community/Installation/UEFI-and-BIOS. – sudodus Mar 21 '19 at 16:03
  • I have been testing the answer below for about a week without problem. If you want to boot Full install USB from the internal grub, I can edit my answer. – C.S.Cameron Mar 22 '19 at 7:51
1

Boot ISO File on USB from grub

You can boot an ISO on USB by using your desktop grub to loop mount it. Add the following menuentry, (or similar), to /etc/grub.d/40_custom:

menuentry "Ubuntu-18.04.1-desktop-amd64.iso" {
    set root=(hdx,1)
        loopback loop /Ubuntu-18.04.1-desktop-amd64.iso
        linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/Ubuntu-18.04.1-desktop-amd64.iso splash --
        initrd (loop)/casper/initrd.lz
    }

Were x is the USB drive number.

Then in Terminal run:

sudo update-grub

You can add a ext4 persistent partition labeled casper-rw if you want persistence, then add a space and the word "persistent" to grub.cfg after "splash --"

Boot Full Install USB from Desktop grub

You can also boot a Full install USB using your desktop's grub.

Copy your preferred menuentry from your USB's grub.cfg to /etc/grub.d/40_custom on your internal drive.

Then in Terminal run:

sudo update-grub
| improve this answer | |
  • Apologies for the late reply. Would this solution be possible at all if my existing installation is broken and does not boot from GRUB? Is there any way to do this from just the GRUB command line? – Joeytje50 Mar 26 '19 at 12:14
  • @Joeytje50 : You can edit grub.cfg directly adding the menu entry above. I'm not sure it will work any better than the USB grub, but it is easy to try. – C.S.Cameron Mar 26 '19 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.