How to detect whether Linux runs in UEFI or BIOS mode inside the Linux?

How to detect whether Linux runs in UEFI or BIOS mode inside the Linux itself without needed to boot the the management console of the mother board?

asked Oct 13, 2015 by Eric Z Ma (44,280 points)

1 Answer

You can detect whether Linux runs in EFI mode by checking whether /sys/firmware/efi exist. In bash, you can test by

[ -d /sys/firmware/efi/ ]

This technique is used in the grub2-regen-cfg tool: http://www.systutorials.com/136638/how-to-regenerate-grub2-config-file-on-linux/

answered Oct 13, 2015 by Eric Z Ma (44,280 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...