How to Check the Bios Version or Name in Linux Through a Command Prompt

How to check the BIOS version or name in Linux through a command prompt?

BIOS version is exposed through the SMBIOS tables. On Linux, we can access this with dmidecode (which requires root privileges to run).

To show only BIOS information, use -t bios to specify that we only want to see entries of the type BIOS, and -q to silence unnecessary output.

# dmidecode -t bios -q
BIOS Information
Vendor: Phoenix Technologies LTD
Version: 6.00
Release Date: 02/22/2012
Address: 0xE72C0
Runtime Size: 101696 bytes
ROM Size: 64 kB
Characteristics:
ISA is supported
PCI is supported
...
BIOS Revision: 4.6
Firmware Revision: 0.0

To get just the BIOS version information, use -s to specify certain strings:

# dmidecode -s bios-vendor
Phoenix Technologies LTD
# dmidecode -s bios-version
6.00
# dmidecode -s bios-release-date
02/22/2012

Cannot boot into system after Bios update

Okay, I've solved it and I guess I'll leave a comment here if anyone has similar issue.

So I re-did the entire "System76 Repair the Bootloader" guide and it worked - the Linux Boot Manager was created, after reboot it appeared in UEFI and everything works now. The only thing that I could have missed in earlier tries is the sudo vgchange -ay in the Encrypted Disk section of the instruction (the first time I did it, I forgot to mount the esp after mounting encrypted root partition and then in further tries I just forgot about the command).

So to sum up - following this guide (if you have encrypted disk): Encrypted Disk section -> sudo mount <your esp partition> /mnt/boot/efi -> rest of the commands in systemd-boot section (so starting at for i in dev dev/pts proc sys run; do sudo mount -B /$i /mnt/$i; done).

How can I get hardware ids/serial numbers through command prompt?

The BIOS serial number often is not set.

This should always give you unique hardware information with a similar command:

wmic csproduct get uuid

You could also combine this info with more information to be sure it is unique. Some examples:

wmic csproduct get uuid,name
wmic bios get name,version

Extract the Linux serial number without sudo

dmidecode reads this information from physical memory, using /dev/mem, which requires root.

The same information is also provided by the Linux kernel via sysfs in a virtual directory, /sys/devices/virtual/dmi/id.

Unfortunately, someone decided that all information in that virtual directory is open to anyone for reading, just not the serial numbers:

$ ls -l /sys/devices/virtual/dmi/id

-r--r--r-- 1 root root 4096 Nov 25 17:12 bios_date
-r--r--r-- 1 root root 4096 Nov 14 14:59 bios_vendor
-r--r--r-- 1 root root 4096 Nov 25 17:12 bios_version
-r--r--r-- 1 root root 4096 Nov 25 17:12 board_asset_tag
-r--r--r-- 1 root root 4096 Nov 25 17:12 board_name
-r-------- 1 root root 4096 Nov 25 17:12 board_serial
-r--r--r-- 1 root root 4096 Nov 14 14:59 board_vendor
-r--r--r-- 1 root root 4096 Nov 25 17:12 board_version
-r--r--r-- 1 root root 4096 Nov 25 17:12 chassis_asset_tag
-r-------- 1 root root 4096 Nov 25 17:12 chassis_serial
-r--r--r-- 1 root root 4096 Nov 25 17:12 chassis_type
-r--r--r-- 1 root root 4096 Nov 25 17:12 chassis_vendor
-r--r--r-- 1 root root 4096 Nov 25 17:12 chassis_version
-r--r--r-- 1 root root 4096 Nov 25 17:12 modalias
drwxr-xr-x 2 root root 0 Nov 25 17:12 power
-r--r--r-- 1 root root 4096 Nov 14 14:59 product_name
-r-------- 1 root root 4096 Nov 25 17:12 product_serial
-r-------- 1 root root 4096 Nov 14 14:59 product_uuid
-r--r--r-- 1 root root 4096 Nov 14 14:59 product_version
lrwxrwxrwx 1 root root 0 Nov 14 14:59 subsystem -> ../../../../class/dmi
-r--r--r-- 1 root root 4096 Nov 14 14:59 sys_vendor
-rw-r--r-- 1 root root 4096 Nov 14 14:59 uevent

If you can install package hal (not installed by default on recent Ubuntu versions), this command will work for you as non-root:

 lshal | grep system.hardware.serial

system.hardware.serial = '<serial_number>' (string)

This works because package hal installs the hald daemon, which runs as root and collects this data, making it possible for lshal to read it as non-root.



Related Topics



Leave a reply



Submit