[How To] Convert Zorin Grub EFI to MBR and reverse

There may be instances where a user must change their Zorin OS install from EFI to MBR (legacy) or MBR to EFI.
Often, this may be in order to ensure a consistent booting experience if more than one OS is installed. You want all installed OS's to preferably use the same Boot format.

To convert from MBR to EFI (Replace sdX with your actual drive I.D. like sda or nvme0n1...):

sudo grub-install --boot-directory=/boot --bootloader-id=ubuntu  --target=x86_64-efi --efi-directory=/boot/efi  /dev/sdX

To convert from EFI to MBR, you must boot on a LiveUSB. Once Booted, use Try Zorin, then open a terminal.
Run:
Replace sdX with actual root partition
sudo mount /dev/sdXn /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt

Install BIOS GRUB to MBR:
sudo grub-install --target=i386-pc /dev/sdX
Generate GRUB config:
sudo update-grub

8 Likes

Is there a difference what shall be set for sdX?
Once there is said it is the (whole) drive at MBR to EFI,
once only the root partition at EFI to MBR?

Yes. sdX is a placeholder; a stand in for the Actual Drive Identifier.
So if you are on a drive that is nvme, it would be ... --efi-directory=/boot/efi /dev/nvme0n1
Or if it is SDA:
... --efi-directory=/boot/efi /dev/sda

However, the entire drive must be entered both times and not just one partition? I wondered about "root partition".

Edit: I just see there is a "n" behind sdx. So this is only the root partition. Now everything is clear.

Perhaps better write at second case at mounting
"Replace sdXn with actual root partition."

1 Like

It is installed to the entire disk, so do not include a partition.

The n here is namespace
Partitions are noted on nvme with a p.
For example; nvme0n(namespace)1p(first partition).

Also should there be entered the same for sdX and sdXn? Both times the entire disk?

The same disk, yes. This means sdX only.

No partitions are specified as it applies to the entire disk.

The n in /dev/nvme0n1 is present for namespace not a partition, due to the naming convention of NVME drives.

Thank you for the explanation. Just wondered why there is the same Variable for entering different things:
"Replace sdX with your actual drive"
"Replace sdX with actual root partition"
That was confusing for me.

Oh!

Now I see what you are referring to and why you asked about root partition...
You are asking about:

THis instruction deals only with mounting your bare metal install drive and root for use when booted from a LiveUSB. It is a necessary step, but is not a step in the Grub Install Process of the entire Drive.

When installing Grub - you do not use sdXn, only sdX (or nvme... whatever.)

1 Like

Yes, this mounting was where I was referring to.
Now it's clear. For grub-install the entire drive should be entered into the command in both cases, and when mounting the drive only the root partition should be entered there.

1 Like

Is this still working for Zorin 18? I'm trying hard to install it on a MacBook2,1 with EFI32 and tried lots of apporaches, but sudo grub-install --target=i386-pc /dev/sda brought me some errors that this would not be possible.
Is there a recommended way to install Zorin18 to these apple EFI32 Machines, especially how to configure the partitions in the installer?

When I format the SSD as MBR, the installer says, "No EFI found. This system will likely not be able to boot successfully".

I could not find a solid advice for this except for using MBR, but I'm not sure whether the installer secretly re-partitions the SSD to GPT/EFI.

Yes, the guide still applies on Zorin OS 18.

However, you are trying to install Zorin OS 18 on a 32 bit architecture BIOS.
Zorin OS dropped 32bit support by the end of Zorin OS 16.

You might be able to use rEFInd to bypass this restriction - this assumes the CPU supports 64 bit architecture... if your computer is 32 bit architecture, then that also will not help you and you will need to install an OS or Distro that still offers 32bit support.

Ah, thanks for clarifying! I thought this would also apply for the EFI32 machines.

I need to investigate on putting refind onto the MacBook 2,1 - I read that this would be difficult, too.

The MacBook 2,1 has a 64 bit CPU but a 32bit EFi

Here is one more thing I tried, for the record:


When I try to install BIOS GRUB to MBR directly with
sudo grub-install --target=i386-pc /dev/sdX, I get an error "canonical path of "/cow" could not be retrieved.

What I tried next:

# Stop and remove any leftover volume groups
sudo vgchange -an
sudo vgremove -f vgzorin || true

# Remove any physical volumes
for d in $(sudo pvs --noheadings -o pv_name 2>/dev/null); do
sudo pvremove -ff -y "$d"
done

# Wipe all filesystem and partition signatures from the main disk
sudo wipefs -a /dev/sda

# Create a fresh, empty MBR partition table
sudo parted /dev/sda --script mklabel msdos



  • now start installer. choose "something else", create one ext4 as "/" + one swap partition
  • ignore all warnings
    Then go back to terminal:

STEP 1 — mount your installed system

sudo mount /dev/sda2 /mnt

If /mnt/boot/efi exists, ignore it for now — for BIOS boot it is not required.


STEP 2 — bind mount the live system’s hardware directories

This is what makes the chroot environment behave like a booted system:

sudo mount --bind /dev /mnt/dev
sudo mount --bind /sys /mnt/sys
sudo mount --bind /proc /mnt/proc

STEP 3 — chroot

sudo chroot /mnt

Your prompt will change — now you are “inside” your installed system.


STEP 4 — Install GRUB to the MBR (THIS is the correct command)

grub-install --target=i386-pc /dev/sda

Not: /dev/sda1

Always: the disk, not a partition.

:backhand_index_pointing_right: This will work now, because inside the chroot your system no longer lives on /cow.


STEP 5 — Generate configuration

update-grub

STEP 6 — Exit and unmount everything

exit
sudo umount /mnt/dev
sudo umount /mnt/sys
sudo umount /mnt/proc
sudo umount /mnt

RESULT for my approach was a softbricked machine. This procedure seemingly prevents the MacBook 2,1 from booting at all, even to the boot device chooser. For this specific machine, the EFI to MBR conversion does not seem to work because of the special EFI32 that is not included in Zorin anymore.