A little background:

I am planning to do some experimentation with diskless computers and net-boot.

The issue I found is that if I have four machines that boot from the same image, I need a way to identify that this machine is app-1, not app-4.

So after thinking where I could store this kind of information on a diskless machine I realized Windows is storing its CD-KEY in BIOS and OEMs are storing some custom data there too.

So my goal would be to store a simple string inside BIOS memory. I know I can retrieve that on Linux using dmidecode, but I have not found any dmiencode commands.

How can I store a custom string inside the BIOS, so that I could later retrieve it using dmidecode or some other tool?

Also, how are professionals handling storing machine-specific data in a diskless server environment?

  • 8
    Windows is not storing its serial number in the BIOS. Only OEMs do that.
    – Daniel B
    Mar 24 at 10:04
  • 27
    You could always identify a machine by its MAC address Mar 24 at 10:09
  • 1
    While it's only possible to edit the BIOS if the image's encryption has been cracked (unlocked BIOS' allow full access since a substantial amount of settings are hidden, and while you can find unlocked BIOS images for some motherboards, they're relatively rare), it's impossible to do so with UEFI images, as they're digitally signed (this is why you can't get an unlocked UEFI firmware image for a motherboard since the Step 1 of the UEFI flash process is to verify the image's digital signature, and if it doesn't match, the installer won't allow booting to the firmware update process)
    – JW0914
    Mar 24 at 13:10
  • 8
    If all you care about is the hostname, I suggest using the MAC address and then having the DHCP server set the ‘hostname’ option. Most major Linux distros will honor the DHCP hostname by default if you have not explicitly set a host name some other way on the system. Mar 24 at 20:45
  • 5
    Boot servers typically use the MAC address for such discriminations. Some bios allow custom inventory tags to be added in the setup menu and provide support contract asset tags which are also unique.
    – eckes
    Mar 25 at 10:45

4 Answers 4


If your computers are using Unified Extensible Firmware Interface (UEFI), then you could use what is called "UEFI variables".

From Arch Linux Unified Extensible Firmware Interface - UEFI variables:

UEFI defines variables through which an operating system can interact with the firmware. UEFI boot variables are used by the boot loader and used by the OS only for early system start-up. UEFI runtime variables allow an OS to manage certain settings of the firmware like the UEFI boot manager or managing the keys for UEFI Secure Boot protocol etc. You can get the list using:

$ efivar --list

Further information is sparse, for example the Ubunti manpage efivar.

You might also find interesting the article Sending data from UEFI to OS through UEFI variables.

  • 5
    UEFI variables don't get stored in firmware per se, but rather a non-volatile memory called NVRAM (although nowadays it's usually flash, not CMOS RAM).
    – forest
    Mar 24 at 22:34
  • 1
    @user3840170 Yeah, it's a nitpick. I just wanted to post that there so that someone else reading this in the future won't be under the impression that the BIOS firmware itself can be modified by writing to UEFI variables.
    – forest
    Mar 25 at 18:44
  • For reference: The command to actually write EFI variables to NVRAM is sbkeysync from the sbsigntool package (this is true at least in Ubuntu, but likely true in all distros).
    – Juergen
    May 15 at 18:27

I know this isn’t a direct answer to your question, but this has all the hallmarks of an XY problem.

The usual approach to this is not storing anything locally on the machine at all.

If you have a need to uniquely identify the computers, you set up DHCP reservations for each computer with an associated DNS name and IP address. If need be, you can have a startup/init-script on the machine query DNS for its own name and set the internal hostname accordingly.

Replacing a machine is as simple as updating the DHCP reservation. There isn’t any need to mess with the BIOS/UEFI at all. (Except to set it to boot from LAN, obviously.)

  • 3
    I think you are correct, Originally I wanted to put the hostname in BIOS and then fetch everything else based on the hostname, and @harrymc answer technically is the most correct answer for my question since it allows exactly that, but after reading all the answers I do think that its better to use MAC as identifier and indeed use DHCP to provide the configuration based on MAC rather than storing anything on the machine itself.
    – HubertNNN
    Mar 24 at 14:42
  • As an option you could also use USB drives to store custom configuration files. The drive can be mounted in read only mode to decrease chances of filesystem corruption.
    – VL-80
    Mar 24 at 18:48
  • 2
    @HubertNNN - Since you want to do some experimentation with diskless computers and net-boot I srly recommend iPXE. It's far more flexible, has many more features than normal PXE stacks (eg. Syslinux menus at NetBoot level) and can simply be chain-loaded from existing PXE stacks. - Enabled me ~a decade ago to install Win7 on a diskless client with FreeNAS as the iSCSI server and boot plenty of other stuff from my TFTP server (GRML live Linux, Gparted, low level BIOS flasher, etc.).
    – Limer
    Mar 26 at 18:50

Pre-UEFI systems may be able to store a persistent identifier in their firmware NVRAM (not on any hard disk) by way of the DMI/SMBIOS Asset Tag and Property Tag. You may try setting them using the smbios-sys-info program from the smbios-utils package.

smbios-sys-info --asset-tag --set=12345
smbios-sys-info --property-tag --set=12345

However, when I tried this myself on two of my laptops (a Toshiba from 2005 and a Lenovo from 2010), on both the latter showed an exception traceback, while the former crashed with a segmentation fault. The only time I remember setting those tags successfully was with an even older Dell laptop (from 2002, which I no longer have); probably not surprising, given that the libsmbios library carries a Dell copyright. Make of that what you will.

  • 1
    Manufacturers often provide(d) their own utility that creates/contains a bootable DOS disk with an executable for setting these values. Presumably it'd use the same interfaces as something like smbios-sys-info does except, of course, the manufacturer knows best how to talk to their own hardware. Mar 27 at 10:30

The BIOS software is typically proprietary and depends on the manufacturer of the hardware you're using and if they have released a tool.

It's unlikely that you would be able to make a new property, however, it’s possible you might be able to reuse an existing property and set your own value.

For example, Lenovo has a tool that lets you set new values for machine type, serial number, and system brand ID.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.