2

Here is what I want.

I have dual boot laptop (Windows 10 (Primary) and Ubuntu (Secondary)). Now whenever I boot into Linux Ubuntu, next time windows takes a lot of Time (maybe a few seconds) to boot.

I want to make my Laptop Boot directly Windows 10 (Which I can do easily). But I want you guys help me in creating such a pen drive which will directly boot into dev/ssd2 i.e. Ubuntu.

So whenever I want to boot Linux Ubuntu I will just put that pen drive into Laptop and my computer will open UBUNTU.

1 Answers1

1

I have tried to nearly make it with below steps.

i don't find any benefit from this method but this method is targeted to achieve nearly the goal in your question.

i have tried it on my dummy system for doing practicals. Backup is highly recommended.

I used
1. windows10 bootable USB stick.
2. Ubuntu 18.04.1 bootable USB stick.
3. Empty USB stick of 32gb to install Ubuntu on it.

sda-120gb SSD
sdb-bootable Ubuntu installation USB stick
sdc-usb stick where i installed Ubuntu.

I have installed windows10 on my single ssd. (sda)
installed Ubuntu 18.04.1 on the same ssd. (device for boot loader sda)
installed Ubuntu 18.04.1 on the 32gb USB Stick. (device for boot loader sdc)

while installing Ubuntu on this stick, i have created 100mb efi partition on this stick and remaining space for ext4 /.

Important is, when installing Ubuntu on USB stick (sdc) i choose boot-loader for installation as sdc. which was this USB stick.

now grub is controlled by this stick. if i remove this stick, system will come up with grub prompt.

i have to type "exit" to boot to windows10.

if the stick is present it will give the options where i can select Ubuntu which is on my ssd. if i remove the stick and start the system, it will come up with grub prompt again where i have to type "exit" to boot to windows10.

enter image description here

Once i am Ok with the setup, i have edited the /etc/default/grub file on sdc so that when i insert this usb and start, system directly boots to Ubuntu on SSD without even showing grub.

what to do if i need the default dual boot system back?

remove the usb (sdc)
log on with live USB.
reinstall grub on the ssd where windows10 & Ubuntu are installed.

procedure:

  1. open GParted from live session and see what are the partition numbers of efi & ext4 /. mine are sda2 and sda5 respectively.

enter image description here

  1. sudo mount /dev/sda5 /mnt # mounting root partition.

  2. for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done # binding the required folders

  3. sudo mount /dev/sda2 /mnt/boot/efi

  4. sudo chroot /mnt

  5. update-grub

  6. grub-install /dev/sda

  7. update-grub

  8. exit and reboot.

PRATAP
  • 22,460
  • You can copy all of /EFI/ubuntu to your USB install twice. Second time to /EFI/Boot. In /EFI/Boot rename shimx64.efi to bootx64.efi. Grub's shim expects some files from /EFI/ubuntu. And UEFI only boots from /EFI/Boot/bootx64.efi. Then you can set flash drive as first in boot order & Windows second. Only if flash drive plugged in will it default boot Ubuntu, but will offer Windows also if it is not hibernated. – oldfred Sep 17 '18 at 16:17
  • @oldfred USB install means Ubuntu which is installed in that USB rite not the bootable USB. am I thinking rite? I will try it. – PRATAP Sep 17 '18 at 16:23
  • Full install where you have to partition in advance to include an ESP - efi system partition which is FAT32 with boot flag. The installer is FAT32 with boot flag already and uses the /EFI/Boot/bootx64.efi to boot installer. That version of grub boot is limited for the installer and is not quite the same as full install version. – oldfred Sep 17 '18 at 17:24
  • Hi, have you tried it yet or not? – PRATAP Sep 18 '18 at 16:08
  • No, I was busy with some professional assignments. Will follow your steps and revert by sunday. :) – Aniket Junnare Sep 18 '18 at 17:01