Skip to content
Search

Dmidecode

lastmod 2023-07-03created 2017-08-1714 edits

Information

It displays the following information.

  • BIOS Information: BIOS settings status.
  • System Information: System information. Prints information such as the mainboard model and manufacturer.
  • Base Board Information: Shows the mainboard manufacturer, BIOS, S/N, etc.
  • Chassis Information: System structure information.
  • Processor Information: System processor information.
  • Cache Information: Information about the processor cache.
  • Memory Controller Information: Memory controller information.
  • Memory Module Information: Memory module information.
  • Port Connector Information: System port information.
  • System Slot Information: Expansion slot information.
  • BIOS Language Information: BIOS language information.
  • Physical Memory Array: Physical (hardware) memory information.
  • Memory Device: Memory module information.

How to use

  • dmidecode -t bios: BIOS information
  • dmidecode -t system: System information
  • dmidecode -t baseboard: Mainboard information
  • dmidecode -t chassis: Structure information
  • dmidecode -t processor: Processor information
  • dmidecode -t memory: Memory information
  • dmidecode -t cache: Cache information
  • dmidecode -t connector: Port information
  • dmidecode -t slot: Slot information
  • dmidecode -s baseboard-manufacturer: Show the mainboard manufacturer
  • dmidecode -s baseboard-product-name: Show the mainboard model name

System UUID

#!/bin/bash

cat /var/lib/dbus/machine-id && exit
# Provided by dbus, hence available on all systemd systems.
# Any user can read it and it is persistent accross boots.
# It is unique per installation, and works well in VMs.
# Not all systems (i.e. stage3 gentoo/handbook install)
# have dbus installed by default.

cat /sys/class/dmi/id/product_uuid && exit
# Which should be the same as
#     dmidecode -s system-uuid
# Requires root
# Persistent accross re-installs
# Depends on x86 hardware
# Not available on all kernels, may be module dependent.

# Lennert Poettering has a good analysis
# http://0pointer.de/blog/projects/ids.html

# FreeBSD has
sysctl kern.hostuuid
# Which is persistent accross reboots

Depending on your kernel, the DMI information may be available via sysfs. Try those:

# cat /sys/class/dmi/id/board_serial
xxxxxxxxxxxxxxx
# cat /sys/class/dmi/id/product_uuid
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

or using a tool

# dmidecode -s baseboard-serial-number
...
# dmidecode -s system-uuid
...

dbus is installed. Therefore it is simply cat /var/lib/dbus/machine-id

Disk UUID: /etc/fstab and /dev/disk/by-uuid

Product UUID

When reading the /sys/class/dmi/id/product_uuid file in C, EOF may not appear and reading may continue as below. So you should check the string for things like whitespace or NULLCHAR.

xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n\0\0\0\0\0\0\0\0\0\0 ...

See also

Favorite site

References


  1. 0pointer.de_-_On_IDs.pdf ↩

author Zer0 sitemap