I have installed Ubuntu 18.04 (Bionic Beaver) on my PC in dual boot with Windows 10. I need to check if Ubuntu is booting in UEFI mode or legacy mode. I found a few sources online to check this, but I'm getting ambiguous results.
To be specific, this page, section "Identifying if an Ubuntu has been installed in UEFI mode" gives three ways to check this.
- Its /etc/fstab file contains an UEFI partition (mount point: /boot/efi)
- It uses the grub-efi bootloader (not grub-pc)
- From the installed Ubuntu, open a terminal (Ctrl+Alt+T) then type the following command: [ -d /sys/firmware/efi ] && echo "Installed in UEFI mode" || echo "Installed in Legacy mode"
I tried the 1st and 3rd ways.
My fstab file contains the below entry:
UUID=xxx /boot/efi ntfs defaults 0 1
So, that means Ubuntu has booted in UEFI mode.
But running the command given in the third method
[ -d /sys/firmware/efi ] && echo "Installed in UEFI mode" || echo "Installed in Legacy mode"
Installed in Legacy mode.
Which is correct? Which is a reliable method for Ubuntu 18.04?