16

I'm new here so I apologize in advance if my question is not formally correct.

I have a dual boot system, on two different disks. Windows was pre-installed on the first drive (500 Gb), then I installed ubuntu 20.04 on the second 1 Tb drive following the answer in this discussion Dual Booting win 10 and Ubuntu 18.04 on two separate physical ssds (I find it very very useful and clear). Both disks are SSD. The system is full uefi. Since I wanted to completely isolate the two different operating systems I configured the second drive like this:

  • 650 Mb Efi partition (sdb1)
  • 20 Gb Ext4 @ / (sdb2)
  • 10 Gb Swap (sdb3)
  • remaining free space @ /home (sdb4)

During the ubuntu installation process I did not unplug the first drive (where Windows is) and I incredibly skipped (that's my fault, I know) the “workaround” steps to avoid the installation of ubuntu bootloader on the first drive (this situation is known as a bug as I read in the discussion linked before). So, even if I chose the “sdb1” partition (just created) in the “Device for boot loader installation” menu, probably that bug occurred or simply my choice was ignored. Now I have two questions, which represent for me two alternative ways to restore the situation:

1 – Can I move the ubuntu bootloader from the first drive, to Efi partition in the second drive? If yes, how can I do this? In this way I hope to isolate the two OS.

If not, the second question is:

2 – Since the ubuntu bootloader is now installed on the Efi partition of the first drive, can I delete the Efi partition of the second drive that I created during installation process? In fact I see that this partition is empty and unmounted, so basically unutilized.

1
  • I think both 1 and 2 are possible. However, I don't know. 1 seems particularly difficult. Either way you should backup everything.
    – user68186
    Commented Jun 14, 2020 at 12:02

2 Answers 2

17

Facing the very same problem with Ubuntu 18.04, I followed PrakashS's answer while making sure the new EFI partition was mounted at /boot/efi before installing grub into it.

I first created a new fat32 partition with GParted on the Ubuntu disk, with the boot flag. (GParted automatically adds the esp flag when checking boot.)

The instructions below use sdb1 for the new EFI parition to match the device name in your question.

  1. Find the UUID of sdb1:
    sudo blkid | grep /dev/sdb1

  2. In /etc/fstab, replace the UUID of the /boot/efi entry with that of sdb1:
    sudo nano /etc/fstab

    Ctrl+O then Return to save. Ctrl+X to exit.

  3. To enact the change, unmount Windows EFI from and mount Ubuntu EFI to /boot/efi:
    sudo umount /boot/efi && sudo mount /boot/efi

  4. Confirm that it's sdb1 that is mounted at /boot/efi:
    lsblk | grep /boot/efi

  5. Install grub on sdb (without part number):
    sudo grub-install /dev/sdb

  6. Generate initramfs image:
    sudo update-initramfs -u -k all

  7. Generate grub2 config file:
    sudo update-grub

  8. Reboot.

  9. Confirm that it's still sdb1 that is mounted at /boot/efi:
    lsblk | grep /boot/efi

4
  • You're a life saver! Worked like a charm.
    – Omid
    Commented Aug 19, 2021 at 13:31
  • this was a clear and accurate answer. Tried it with ubuntu 21.10 Commented Oct 29, 2021 at 11:06
  • Worked on Kubuntu 20.04 :) Commented Dec 10, 2021 at 10:44
  • A life saver! Worked on Ubuntu 22.04 LTS
    – R. Zhu
    Commented Jun 18, 2023 at 9:44
7

Follow this procedure to move the boot loader:

  1. Find the UUID of /dev/sdb1 using sudo blkid (copy it)
  2. Change the UUID of boot/efi entry in /etc/fstab with that of sdb1
  3. sudo grub-install /dev/sdb
  4. sudo update-initramfs -u -k all
  5. sudo update-grub
  6. Reboot

Check with lsblk whether /dev/sdb1 be mounted in /boot/efi.

3
  • 1
    I find the system does not update correctly with new UUID until I reboot. Normally you can run sudo mount -a to remount fstab and it uses new mounts. You need to be sure it installs to sdb's ESP.
    – oldfred
    Commented Jun 14, 2020 at 15:49
  • @mook765 So the soultion in my case could be: 1 – sudo umount /dev/sda2 2 – sudo mount /dev/sdb1 /boot/efi 3 - sudo grub-install 4 - reboot These are the steps I have to follow? thanks Commented Jun 14, 2020 at 16:27
  • I confirmed this procedure just before writing answer with my spare installation, with ESP created in usb drive . (reverted back successfully by the same procedure)
    – PrakashS
    Commented Jun 14, 2020 at 16:33

You must log in to answer this question.

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