How to check if Ubuntu has booted in UEFI mode?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












3















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.




  1. Its /etc/fstab file contains an UEFI partition (mount point: /boot/efi)

  2. It uses the grub-efi bootloader (not grub-pc)

  3. 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"


prints Installed in Legacy mode.



Which is correct? Which is a reliable method for Ubuntu 18.04?










share|improve this question




























    3















    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.




    1. Its /etc/fstab file contains an UEFI partition (mount point: /boot/efi)

    2. It uses the grub-efi bootloader (not grub-pc)

    3. 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"


    prints Installed in Legacy mode.



    Which is correct? Which is a reliable method for Ubuntu 18.04?










    share|improve this question


























      3












      3








      3








      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.




      1. Its /etc/fstab file contains an UEFI partition (mount point: /boot/efi)

      2. It uses the grub-efi bootloader (not grub-pc)

      3. 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"


      prints Installed in Legacy mode.



      Which is correct? Which is a reliable method for Ubuntu 18.04?










      share|improve this question
















      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.




      1. Its /etc/fstab file contains an UEFI partition (mount point: /boot/efi)

      2. It uses the grub-efi bootloader (not grub-pc)

      3. 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"


      prints Installed in Legacy mode.



      Which is correct? Which is a reliable method for Ubuntu 18.04?







      boot dual-boot 18.04 uefi






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 19 at 12:49









      Codito ergo sum

      1,5023825




      1,5023825










      asked Jan 19 at 4:31









      Nagabhushan S NNagabhushan S N

      1338




      1338




















          2 Answers
          2






          active

          oldest

          votes


















          5














          You can use the following command line,



          test -d /sys/firmware/efi && echo efi || echo bios


          or longer but easier to understand



          if test -d /sys/firmware/efi;then echo efi;else echo bios;fi


          See the following link,



          help.ubuntu.com/community/Installation/FromUSBStick#Test_if_running_in_UEFI_mode




          Edit: Comment about /boot/efi



          /boot/efi is a persistent directory (that survives shutdown and reboot), while /sys/firmware/efi, actually the content of the /sys file system is created every time the computer is booted.



          The existence of /boot/efi, a directory in an EFI system partition, can make it possible to boot in UEFI mode, but it does not make it impossible to boot in BIOS mode. So it does not tell you in which mode the computer is booted. It is possible to have installed Ubuntu and other linux systems that can boot both in UEFI and BIOS mode.






          share|improve this answer

























          • Yes. Both answers are almost same. This one is easier for newbies. Since that was the first answer, I accepted that. Also, both of the answers didn't answer my question completely. What is the difference between the two methods and why they give different outputs?

            – Nagabhushan S N
            Jan 20 at 7:20











          • @NagabhushanSN, /boot/efi is a persistent directory (that survives shutdown and reboot), while /sys/firmware/efi, actually the content of /sys file system is created every time the computer is booted. -- The existence of /boot/efi, an EFI system partition, can make it possible to boot in UEFI mode, but it does not make it impossible to boot in BIOS mode. So it does not tell you in which mode the computer is booted. It is possible to have installed Ubuntu and other linux systems that can boot both in UEFI and BIOS mode.

            – sudodus
            Jan 20 at 11:42












          • Great! This was what I was looking for. Please update your answer, I'll accept it :)

            – Nagabhushan S N
            Jan 20 at 12:51



















          4














          The easiest way to find out if you are running UEFI or BIOS is to look for a folder /sys/firmware/efi.



          The folder will be missing if your system is using BIOS.



          Execute:



          $ ls /sys/firmware/efi


          Example of UEFI boot output :enter image description here






          share|improve this answer

























          • This directory is not present. But fstab file has boot/efi mount-point. Ambiguous right?

            – Nagabhushan S N
            Jan 19 at 4:53






          • 4





            You boot in BIOS mode

            – Carlos Dagorret
            Jan 19 at 4:54










          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1111045%2fhow-to-check-if-ubuntu-has-booted-in-uefi-mode%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          5














          You can use the following command line,



          test -d /sys/firmware/efi && echo efi || echo bios


          or longer but easier to understand



          if test -d /sys/firmware/efi;then echo efi;else echo bios;fi


          See the following link,



          help.ubuntu.com/community/Installation/FromUSBStick#Test_if_running_in_UEFI_mode




          Edit: Comment about /boot/efi



          /boot/efi is a persistent directory (that survives shutdown and reboot), while /sys/firmware/efi, actually the content of the /sys file system is created every time the computer is booted.



          The existence of /boot/efi, a directory in an EFI system partition, can make it possible to boot in UEFI mode, but it does not make it impossible to boot in BIOS mode. So it does not tell you in which mode the computer is booted. It is possible to have installed Ubuntu and other linux systems that can boot both in UEFI and BIOS mode.






          share|improve this answer

























          • Yes. Both answers are almost same. This one is easier for newbies. Since that was the first answer, I accepted that. Also, both of the answers didn't answer my question completely. What is the difference between the two methods and why they give different outputs?

            – Nagabhushan S N
            Jan 20 at 7:20











          • @NagabhushanSN, /boot/efi is a persistent directory (that survives shutdown and reboot), while /sys/firmware/efi, actually the content of /sys file system is created every time the computer is booted. -- The existence of /boot/efi, an EFI system partition, can make it possible to boot in UEFI mode, but it does not make it impossible to boot in BIOS mode. So it does not tell you in which mode the computer is booted. It is possible to have installed Ubuntu and other linux systems that can boot both in UEFI and BIOS mode.

            – sudodus
            Jan 20 at 11:42












          • Great! This was what I was looking for. Please update your answer, I'll accept it :)

            – Nagabhushan S N
            Jan 20 at 12:51
















          5














          You can use the following command line,



          test -d /sys/firmware/efi && echo efi || echo bios


          or longer but easier to understand



          if test -d /sys/firmware/efi;then echo efi;else echo bios;fi


          See the following link,



          help.ubuntu.com/community/Installation/FromUSBStick#Test_if_running_in_UEFI_mode




          Edit: Comment about /boot/efi



          /boot/efi is a persistent directory (that survives shutdown and reboot), while /sys/firmware/efi, actually the content of the /sys file system is created every time the computer is booted.



          The existence of /boot/efi, a directory in an EFI system partition, can make it possible to boot in UEFI mode, but it does not make it impossible to boot in BIOS mode. So it does not tell you in which mode the computer is booted. It is possible to have installed Ubuntu and other linux systems that can boot both in UEFI and BIOS mode.






          share|improve this answer

























          • Yes. Both answers are almost same. This one is easier for newbies. Since that was the first answer, I accepted that. Also, both of the answers didn't answer my question completely. What is the difference between the two methods and why they give different outputs?

            – Nagabhushan S N
            Jan 20 at 7:20











          • @NagabhushanSN, /boot/efi is a persistent directory (that survives shutdown and reboot), while /sys/firmware/efi, actually the content of /sys file system is created every time the computer is booted. -- The existence of /boot/efi, an EFI system partition, can make it possible to boot in UEFI mode, but it does not make it impossible to boot in BIOS mode. So it does not tell you in which mode the computer is booted. It is possible to have installed Ubuntu and other linux systems that can boot both in UEFI and BIOS mode.

            – sudodus
            Jan 20 at 11:42












          • Great! This was what I was looking for. Please update your answer, I'll accept it :)

            – Nagabhushan S N
            Jan 20 at 12:51














          5












          5








          5







          You can use the following command line,



          test -d /sys/firmware/efi && echo efi || echo bios


          or longer but easier to understand



          if test -d /sys/firmware/efi;then echo efi;else echo bios;fi


          See the following link,



          help.ubuntu.com/community/Installation/FromUSBStick#Test_if_running_in_UEFI_mode




          Edit: Comment about /boot/efi



          /boot/efi is a persistent directory (that survives shutdown and reboot), while /sys/firmware/efi, actually the content of the /sys file system is created every time the computer is booted.



          The existence of /boot/efi, a directory in an EFI system partition, can make it possible to boot in UEFI mode, but it does not make it impossible to boot in BIOS mode. So it does not tell you in which mode the computer is booted. It is possible to have installed Ubuntu and other linux systems that can boot both in UEFI and BIOS mode.






          share|improve this answer















          You can use the following command line,



          test -d /sys/firmware/efi && echo efi || echo bios


          or longer but easier to understand



          if test -d /sys/firmware/efi;then echo efi;else echo bios;fi


          See the following link,



          help.ubuntu.com/community/Installation/FromUSBStick#Test_if_running_in_UEFI_mode




          Edit: Comment about /boot/efi



          /boot/efi is a persistent directory (that survives shutdown and reboot), while /sys/firmware/efi, actually the content of the /sys file system is created every time the computer is booted.



          The existence of /boot/efi, a directory in an EFI system partition, can make it possible to boot in UEFI mode, but it does not make it impossible to boot in BIOS mode. So it does not tell you in which mode the computer is booted. It is possible to have installed Ubuntu and other linux systems that can boot both in UEFI and BIOS mode.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 20 at 14:08

























          answered Jan 19 at 5:52









          sudodussudodus

          23.9k32875




          23.9k32875












          • Yes. Both answers are almost same. This one is easier for newbies. Since that was the first answer, I accepted that. Also, both of the answers didn't answer my question completely. What is the difference between the two methods and why they give different outputs?

            – Nagabhushan S N
            Jan 20 at 7:20











          • @NagabhushanSN, /boot/efi is a persistent directory (that survives shutdown and reboot), while /sys/firmware/efi, actually the content of /sys file system is created every time the computer is booted. -- The existence of /boot/efi, an EFI system partition, can make it possible to boot in UEFI mode, but it does not make it impossible to boot in BIOS mode. So it does not tell you in which mode the computer is booted. It is possible to have installed Ubuntu and other linux systems that can boot both in UEFI and BIOS mode.

            – sudodus
            Jan 20 at 11:42












          • Great! This was what I was looking for. Please update your answer, I'll accept it :)

            – Nagabhushan S N
            Jan 20 at 12:51


















          • Yes. Both answers are almost same. This one is easier for newbies. Since that was the first answer, I accepted that. Also, both of the answers didn't answer my question completely. What is the difference between the two methods and why they give different outputs?

            – Nagabhushan S N
            Jan 20 at 7:20











          • @NagabhushanSN, /boot/efi is a persistent directory (that survives shutdown and reboot), while /sys/firmware/efi, actually the content of /sys file system is created every time the computer is booted. -- The existence of /boot/efi, an EFI system partition, can make it possible to boot in UEFI mode, but it does not make it impossible to boot in BIOS mode. So it does not tell you in which mode the computer is booted. It is possible to have installed Ubuntu and other linux systems that can boot both in UEFI and BIOS mode.

            – sudodus
            Jan 20 at 11:42












          • Great! This was what I was looking for. Please update your answer, I'll accept it :)

            – Nagabhushan S N
            Jan 20 at 12:51

















          Yes. Both answers are almost same. This one is easier for newbies. Since that was the first answer, I accepted that. Also, both of the answers didn't answer my question completely. What is the difference between the two methods and why they give different outputs?

          – Nagabhushan S N
          Jan 20 at 7:20





          Yes. Both answers are almost same. This one is easier for newbies. Since that was the first answer, I accepted that. Also, both of the answers didn't answer my question completely. What is the difference between the two methods and why they give different outputs?

          – Nagabhushan S N
          Jan 20 at 7:20













          @NagabhushanSN, /boot/efi is a persistent directory (that survives shutdown and reboot), while /sys/firmware/efi, actually the content of /sys file system is created every time the computer is booted. -- The existence of /boot/efi, an EFI system partition, can make it possible to boot in UEFI mode, but it does not make it impossible to boot in BIOS mode. So it does not tell you in which mode the computer is booted. It is possible to have installed Ubuntu and other linux systems that can boot both in UEFI and BIOS mode.

          – sudodus
          Jan 20 at 11:42






          @NagabhushanSN, /boot/efi is a persistent directory (that survives shutdown and reboot), while /sys/firmware/efi, actually the content of /sys file system is created every time the computer is booted. -- The existence of /boot/efi, an EFI system partition, can make it possible to boot in UEFI mode, but it does not make it impossible to boot in BIOS mode. So it does not tell you in which mode the computer is booted. It is possible to have installed Ubuntu and other linux systems that can boot both in UEFI and BIOS mode.

          – sudodus
          Jan 20 at 11:42














          Great! This was what I was looking for. Please update your answer, I'll accept it :)

          – Nagabhushan S N
          Jan 20 at 12:51






          Great! This was what I was looking for. Please update your answer, I'll accept it :)

          – Nagabhushan S N
          Jan 20 at 12:51














          4














          The easiest way to find out if you are running UEFI or BIOS is to look for a folder /sys/firmware/efi.



          The folder will be missing if your system is using BIOS.



          Execute:



          $ ls /sys/firmware/efi


          Example of UEFI boot output :enter image description here






          share|improve this answer

























          • This directory is not present. But fstab file has boot/efi mount-point. Ambiguous right?

            – Nagabhushan S N
            Jan 19 at 4:53






          • 4





            You boot in BIOS mode

            – Carlos Dagorret
            Jan 19 at 4:54















          4














          The easiest way to find out if you are running UEFI or BIOS is to look for a folder /sys/firmware/efi.



          The folder will be missing if your system is using BIOS.



          Execute:



          $ ls /sys/firmware/efi


          Example of UEFI boot output :enter image description here






          share|improve this answer

























          • This directory is not present. But fstab file has boot/efi mount-point. Ambiguous right?

            – Nagabhushan S N
            Jan 19 at 4:53






          • 4





            You boot in BIOS mode

            – Carlos Dagorret
            Jan 19 at 4:54













          4












          4








          4







          The easiest way to find out if you are running UEFI or BIOS is to look for a folder /sys/firmware/efi.



          The folder will be missing if your system is using BIOS.



          Execute:



          $ ls /sys/firmware/efi


          Example of UEFI boot output :enter image description here






          share|improve this answer















          The easiest way to find out if you are running UEFI or BIOS is to look for a folder /sys/firmware/efi.



          The folder will be missing if your system is using BIOS.



          Execute:



          $ ls /sys/firmware/efi


          Example of UEFI boot output :enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 19 at 4:57

























          answered Jan 19 at 4:49









          Carlos DagorretCarlos Dagorret

          505213




          505213












          • This directory is not present. But fstab file has boot/efi mount-point. Ambiguous right?

            – Nagabhushan S N
            Jan 19 at 4:53






          • 4





            You boot in BIOS mode

            – Carlos Dagorret
            Jan 19 at 4:54

















          • This directory is not present. But fstab file has boot/efi mount-point. Ambiguous right?

            – Nagabhushan S N
            Jan 19 at 4:53






          • 4





            You boot in BIOS mode

            – Carlos Dagorret
            Jan 19 at 4:54
















          This directory is not present. But fstab file has boot/efi mount-point. Ambiguous right?

          – Nagabhushan S N
          Jan 19 at 4:53





          This directory is not present. But fstab file has boot/efi mount-point. Ambiguous right?

          – Nagabhushan S N
          Jan 19 at 4:53




          4




          4





          You boot in BIOS mode

          – Carlos Dagorret
          Jan 19 at 4:54





          You boot in BIOS mode

          – Carlos Dagorret
          Jan 19 at 4:54

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1111045%2fhow-to-check-if-ubuntu-has-booted-in-uefi-mode%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown






          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay