Get motherboard serial number linux

How do I find out my motherboard model?

I wish this was the accepted answer and that I could remember that forever. No more pausing during bios boot, no more opening the case, no need to install anything.

Lol, has more upvotes as the question and accepted answer combined! But, in the end, I think Hastur’s answer is the best (and it took 3 years to get that rock solid answer that doesn’t require 3rd party utilities!)

dmidecode -t 1 gave me the current Product Name. type 2 gave some serials which will not help that much. Im sure that types of dmi data differs across motherboards.

This is great. Till now I was accessing dmidecode’s output tables by their hex addresses, which I possibly singled out by guessing. This is way safer and clearer. For completeness, you can check what each type (t in the command above) stands to here. (well man already details it, as Vadim Kotov instructs, above)

There’s also some great graphical tools that show you not just your motherboard info, but all info about your computer.

Hardinfo image

  1. Hardinfo Search for the hardinfo package in the Software Center or run sudo apt-get install hardinfo from the command line. The motherboard make and model can be found on the Devices >DMI page.
  2. CPU-G — Linux alternative to the popular Windows application CPU-Z. Originally created by ftsamis, it has since been picked up by Atareao Team
sudo add-apt-repository ppa:atareao/atareao sudo apt update sudo apt install cpu-g 

CPU-G image

  • lshw-gtk – Graphical frontend for lshw command lshw-gtk image
  • PerlMonPerlmon image
  • Non-root user variant

    I would like to suggest a variant for the unprivileged users, since it’s not always possible to execute commands as root (some users simply cannot and however it is always a good practice to avoid running commands as root when it’s not needed) and or there is no intention or possibility to install new programs:

    cat /sys/devices/virtual/dmi/id/board_

    that it is a short version, shell expanded, of cat /sys/devices/virtual/dmi/id/board_vendor /sys/devices/virtual/dmi/id/board_name /sys/devices/virtual/dmi/id/board_version and gives as a spartan output respectively vendor, name and version:

    FUJITSU D3062-A1 S26361-D3062-A1 

    Note:
    Inside the path /sys/devices/virtual/dmi/id/ it’s possible to find some files with information about BIOS, board (motherboard), chassis. not all are readable by an unprivileged user due to a security or privacy concerns.

    Privileged user variant

    Of course, e.g, a sudo cat board_serial (that usually is readable only by root, -r——— ) or a sudo cat board_* can easily overcame this limit.

    . but, maybe, if privileges are available it’s more convenient to use dmidecode as suggested in other answers as well.

    Below is the version I prefer, due to the compactness of its output:

    sudo dmidecode -t 1 # or sudo dmidecode | grep -A4 '^Base' # output more short and compact 

    The previous command with -A3 will show only the first 3 lines and it is the short version for
    sudo dmidecode | grep -A4 ‘^Base Board Information’ that should be better to use if in a script.

    Base Board Information Manufacturer: FUJITSU Product Name: D3062-A1 Version: S26361-D3062-A1 Serial Number: MySerialNumber(1) 

    (1) if it is protected for unprivileged users, then maybe it’s better to avoid posting it 🙂

    Ps> The following works fine too sudo lshw | grep -A5 «Mot» (again «Mot» is the short for «Motherboard» and only «Mo» will not filter words as Model or Mobile. ), but I find it a little lazier than dmidecode to answer with its output (lshw 0.906s vs dmidecode 0.024s).

    @CodeBrauer It seems it depends from kernel > 2.6.x and not from distro, as you can read in this Fedora thread. ps> «Note that this dmi information may only be applicable to Intel-based PCs» Comment on another answer

    As non privileged user, to ignore the access error, it’s possible to use a more easy to remember command cat /sys/devices/virtual/dmi/id/board_* 2>/dev/null , redirecting the errors to the holy /dev/null . Of course (I’m lazy) it’s always possible to use the command without redirection in an alias or in a script.

    You can also use lshw . It is usually run with sudo as that allows it to probe your devices and accurately report back information. Just run

    and the first entries in the results will detail your system and the motherboard and the bios, like in the example below:

    *-core description: Motherboard product: Aspire 1700 vendor: acer physical id: 0 version: 0303 serial: None *-firmware description: BIOS vendor: acer physical id: 0 version: 3C13 date: 05/12/04 size: 109KiB capacity: 448KiB capabilities: isa pci pcmcia pnp upgrade shadowing escd cdboot bootselect socketedrom int5printscreen int9keyboard int14serial int17printer int10video acpi usb agp smartbattery biosbootspecification 

    lshw will give you a lot of other information as well; if you want any particular data in future you can run, for example, sudo lshw -class video to find out about your graphics card. For a listing of the hardware classes lshw analyses, enter sudo lshw -short . For more information on the program, enter man lshw in the terminal or visit the Ubuntu manpages.

    As Schweinsteiger has noted, dmidecode is also a useful tool for reporting on motherboard info.

    Источник

    How to Find Motherboard Model and Serial Number in Linux

    How to Find Motherboard Model and Serial Number in Linux

    If you ever wanted to update your BIOS or make any other hardware changes to your Linux system, you likely needed the motherboard information. There is a handy little command line tool called dmidecode that we have written about in the past. This program will dump a ton of information about the hardware on your system. It’s name is short for DMI decode because it can display all the information in the DMI Table (SMBIOS). In this case we are going to use specific switches to find the motherboard model and serial number in Linux system.

    dmidecode is a tool for dumping a computer’s DMI (some say SMBIOS ) table contents in a human-readable format. This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision.

    dmidecode man page

    To get your motherboard information simply use dmidecode with the —type option. The DMI type we are looking for is «Base Board» which is represented numerically using the number 2. Here is an example.

    Using dmidecode to find motherboard information on the Linux command line

    Of course you can use grep to find specific info. This is helpful if you are using it in an automated fashion like a bash script.

    [[email protected] ~]$ sudo dmidecode -t 2 | grep -i serial Serial Number: 401

    There is a lot this tool can do, this is barely scratching the surface. This tool is what you need to get any kind of hardware information from the command line. As we demonstrated, you can easily find the motherboard model and serial number in Linux using dmidecode.

    Источник

    Getting CPU or motherboard serial number?

    I’m trying to get the CPU serial or motherboard serial using C or Python for licensing purposes. Is it possible? I’m using Linux .

    Keep in mind the Intel «Processor Serial Number» feature was only ever implemented in the Pentium 3, and some Transmeta CPUs. It was never implemented in any AMD CPUs, or the Pentium 4 or later models.

    5 Answers 5

    Under Linux, you could use «lshw -quiet -xml» and parse its output. You’ll find plenty of system information here: cpuid, motherboard id and much more.

    +1 for this, just for the information of ronakin , call this using subprocess and you can then parse the output.

    You need to use the CPUID instruction.

    Most C compilers have some support for inline assembly, but you will need to know what you are doing.

    You can get the CPUID. Maybe linux command ‘dmidecode’ can help you. You can exec this command,or load the source code of «dmidecode». Next is the output of «dmidecode -t processor»:

    >dmidecode -t processor # dmidecode 2.7 SMBIOS 2.2 present. Handle 0x0004, DMI type 4, 32 bytes. Processor Information Socket Designation: Socket 478 Type: Central Processor Family: Pentium 4 Manufacturer: Intel ID: 27 0F 00 00 FF FB EB BF Signature: Type 0, Family 15, Model 2, Stepping 7 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Hyper-threading technology) TM (Thermal monitor supported) PBE (Pending break enabled) Version: Intel(R) Pentium(R) 4 CPU Voltage: 1.5 V External Clock: 133 MHz Max Speed: 3066 MHz Current Speed: 2800 MHz Status: Populated, Enabled Upgrade: ZIF Socket L1 Cache Handle: 0x0008 L2 Cache Handle: 0x0009 L3 Cache Handle: No L3 Cache 

    Источник

    angeloped / get_serial_number.py

    This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

    # wmic bios get serialnumber#Windows
    # hal-get-property —udi /org/freedesktop/Hal/devices/computer —key system.hardware.uuid#Linux
    # ioreg -l | grep IOPlatformSerialNumber#Mac OS X
    import os , sys
    def getMachine_addr ():
    os_type = sys . platform . lower ()
    if «win» in os_type :
    command = «wmic bios get serialnumber»
    elif «linux» in os_type :
    command = «hal-get-property —udi /org/freedesktop/Hal/devices/computer —key system.hardware.uuid»
    elif «darwin» in os_type :
    command = «ioreg -l | grep IOPlatformSerialNumber»
    return os . popen ( command ). read (). replace ( » \n » , «» ). replace ( » » , «» ). replace ( » » , «» )
    #output machine serial code: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX
    print ( getMachine_addr ())

    Источник

    Читайте также:  Рамки окна linux mint
    Оцените статью
    Adblock
    detector