I just bought a new Windows 10 machine and want to use my Ubuntu 22.04 on an external drive that I was using connected to my older Windows 10 machine with dual boot.
So in this case, I am not sure if I am making my new machine a dual boot like I did for my old or if there is a way to just get Grub on the new machine so when I plug my external drive in the USB, I can run Ubuntu, ie. I have a portable Ubuntu 22.04 that I can carry around.

- 739
- 1
- 11
- 33
-
You have to make sure you have an ESP - efi system partition on external drive. External drivers all boot from /EFI/Boot/bootx64.efi, but a full install need /EFI/ubuntu folder also for grub's files. UEFI entry will be just like the installer's entry or the UEFI:xxx where xxx is description/label of drive. If you want "ubuntu" entry then you let grub install to internal drive. But need to change UEFI to have Windows first or system will not boot without external drive. https://askubuntu.com/questions/16988/how-do-i-install-ubuntu-to-a-usb-key-without-using-startup-disk-creator – oldfred Nov 02 '22 at 13:49
1 Answers
Install GRUB on Windows to replace Windows Boot Manager and Boot External Ubuntu
UEFI should boot GRUB located on an external drive automatically.
I have tested this with an external install made like this: How to Create a Full Install of Ubuntu 22.04 to USB Device Step by Step You will need to use F9, F12, etc to select the USB drive.
You can also add the external drive to the UEFI boot menu.
To add the Full install USB drive to internal GRUB
Once GRUB has been installed to the internal drive you can plug in your external drive and run sudo update-grub
Ubuntu must be installed in the same BIOS or UEFI mode as Windows.
Note: Grub 2.06 turns off os-prober in /etc/default/grub. See: How can I add Windows 11 to grub menu?
To add Persistent Live install to the internal GRUB boot menu, (by hand)
Add the following menuentry to /etc/grub.d/40_custom and then run sudo update-grub
menuentry "Ubuntu USB" {
set root=(hd0,1)
set gfxpayload=keep
linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed maybe-ubiquity quiet splash ---
initrd /casper/initrd
}
or
menuentry "Ubuntu - flash drive" {
search --set=root --fs-uuid xxxx-xx-xx-xx-xx-xx-xx
set gfxpayload=keep
linux ($root)/casper/vmlinuz$casper_flavour file=/cdrom/preseed/ubuntu.seed quiet splash ---
initrd ($root)/casper/initrd$casper_flavour
}
where xxxx-xx-xx-xx-xx-xx-xx is the USB / partition UUID
If I recall right.

- 19,519
-
So I have GRUB on my Windows m2 ssd on my old machine not on the external drive. I should have mentioned this so I don't believe your answer would work here. – mLstudent33 Nov 02 '22 at 11:46
-
Can you adjust your machine's BIOS/UEFI so the Ubuntu USB boots first? I am used to F10 to select boot disk. However if you want GRUB to boot the Ubuntu USB, copy the USB's GRUB menuentry to the internal GRUB. Confirm that os-prober has added everything to grub.cfg – C.S.Cameron Nov 02 '22 at 13:28
-
I'm sorry , here's the edit: I don't do that. It's a Lenovo so I hold F12 down as I power on the machine then choose Ubuntu but it also show Linpus Lite and Windows on a grey screen with blue writing, then it goes to Grub where I can choose Ubuntu or Windows. So my Windows won't boot unless I have the USB plugged in. When I try to boot Windows without the USB, I get that grub command line where I only know how to type exit, after I plug in my USB, so it restarts. But if I have my USB plugged in and don't press F12 at boot, my Windows boots. – mLstudent33 Nov 26 '22 at 04:19
-
Here is a very similar situation to mine: https://askubuntu.com/questions/1336316/moving-grub-from-main-drive-to-an-external-drive but it sounds very complicated and comes with risks. So my current "solution" is to get another SSD and put make my new machine a dual boot on its own and then just copy my files over. Although my current USB Ubuntu has programs set up so it would be nice to be able to do this. – mLstudent33 Nov 26 '22 at 04:40
-
@mLstudent33: An easier method to install GRUB on an external drive is to create a Persistent drive using mkusb. Boot the Persistent drive, plug in any other drives you want on the boot menu and run
sudo update-grub
and then delete all but sdx2 and sdx3. You can then add Linux OS's and a grub.cfg file to boot what you wish. – C.S.Cameron Nov 26 '22 at 06:46