Install grub on usb drive Pc#
When the external hard drive is not plugged in, the PC would skip You can now reboot and without your intervention Ubuntu would automatically boot when external hard drive is plugged in. dev/sdX is the external hard drive with the grub bootloader. This boot entry would automatically be the first entry. Move it to the top of the boot entries listĬreate a boot entry: efibootmgr -c Į.g.: efibootmgr -c -L myubuntu -d /dev/sdX Navigate to /efi/ubuntu/shim圆4.efi or /efi/ubuntu/grub圆4 Select the FAT32 EFI partition on the external drive that contains the grub bootloader
Install grub on usb drive install#
In Windows download EasyUEFI, install it and run.Ĭhoose Linux or other OS and give it a name in the description box To make Ubuntu automatically boot when you insert the external and Windows to automatically boot when the external is not inserted you would have to create a custom boot entry for Ubuntu to point to the efi on the external drive: Creating a custom boot entry for Ubuntu to point to efi on the external HDįrom Windows EasyUEFI can add or remove boot entries.įrom Linux efibootmgr can add or remove boot entries. Make sure to comment out the fstab entry of the Windows esp so it doesn't conflict.Īt this point when you reboot and choose your external device from the EFI boot manager, it will boot to grub. UUID=xxxx-xxxx /boot/efi vfat umask=0077 0 1 Now we need to tell fstab to mount that efi partition on boot: cp /etc/fstab /etc/fstab.bakĪdd the below two lines to fstab replacing xxxx-xxxx with the UUID from step 11: #my modified fstab to mount external hard drive's esp Install grub to the external hard drive: grub-install /dev/sdXįind the UUID of the efi partition (aka 'vfat') and note it down: blkid Mount the efi partition from step 3: mount /dev/sdXY2 /boot/efi If it already exists, then skip to step 8. You are now in the external hard drive's linux filesystem.Ĭreate the directory where grub would install its files: mkdir -p /boot/efi Mount critical virtual filesystems: for i in /dev /dev/pts /proc /sys /run do sudo mount -B $i /mnt$i doneĬhroot into the Linux partition you mounted: sudo chroot /mnt
![install grub on usb drive install grub on usb drive](https://net2.com/wp-content/uploads/2019/08/word-image-13.jpeg)
Special mount the linux partition: sudo mount /dev/sdXY1 /mnt Replace XY1 and XY2 with your own partition names. Installing Grub to an external hard drive that has Ubuntu installedīoot into an Ubuntu live USB and connect the external hard drive.įrom the results of lsblk, identify the linux partition and also the efi partition of the external hard drive, It can also serve as backup grub in case the is problem with EFI of Windows. When you do this it allows you to boot your Ubuntu on any PC which supports UEFI by using the grub on the external without relying on the PC grub. This is how I installed grub unto my external hard drive (GPT) which had Ubuntu 17.04 installed. So using the already installed Grub as the only bootloader is not an option. Furthermore, if the external hard drive is not plugged in, Grub bootloader shows the Grub rescue panel only.
![install grub on usb drive install grub on usb drive](https://www.supergrubdisk.org/wp-content/uploads/2013/11/rescatux_wizard_yumi_step1c.png)
How can I make the external drive bootable so that when I want to switch from Windows to Linux I just power off the pc, plug in the USB, power on the pc and go? (without loosing the data I already stored on it and all the preferences)įor some reason Windows is terribly slow when loaded via the Grub bootloader available in the internal drive. Boot devices are ordered as follows: 1.Every time I want to switch OS I need to change bootloader manually in the startup menu which is tedious.External hard drive contains Ubuntu 15.10, possibly Grub, but is not bootable as a USB stick is.PC internal hard drive contains Windows OS, Windows bootloader and Grub from the old linux installation.The external hard drive is not bootable (as a usb stick for example) and this long sequence of operations needs to be repeated each time. When I want to run Linux, I have to plug in the external drive, go in the startup menu, and change bootloader from Windows' to Grub. As a result, I am in a weird situation: when I want to run Windows, I just power on the pc and go. However, when installing Ubuntu, for some reason, the bootloader Grub was not installed on the external drive, while at the same time, the "old" Grub bootloader was never erased from the PC internal hard drive.
![install grub on usb drive install grub on usb drive](https://unetbootin.github.io/screenshot2.jpg)
![install grub on usb drive install grub on usb drive](https://debian-handbook.info/browse/stable/images/inst-tasksel.png)
This option seems to be good for both the operating systems. Due to this bad experience, I decided to reinstall Ubuntu on an external hard drive separated from my main Windows machine. So, I've used Ubuntu for a month or two in dualboot with Windows 8, it looked and ran fine, however it broke down for some reason and I had to restore the entire PC.