- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- How to get Serial number in Linux w/o using dmidec...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2014 01:30 AM
02-12-2014 01:30 AM
How to get Serial number in Linux w/o using dmidecode
Hello Gurus,
My dmidecode is not helpfull to get the Serial number of my server.
Server details:
[root@server1 ~]# uname -a
Linux server1 2.6.18-348.1.1.el5 #1 SMP Fri Dec 14 05:26:02 EST 2012 i686 i686 i386 GNU/Linux
[root@server1 ~]#
[root@server1 ~]# cat /etc/redhat-rel*
Red Hat Enterprise Linux Server release 5.9 (Tikanga)
[root@server1 ~]#
[root@server1 ~]# rpm -qa | grep -i release
redhat-release-notes-5Server-46
redhat-release-5Server-5.9.0.2
[root@server1 ~]#
If I use dmidecode I gets the below o/p.
[root@server1 ~]# dmidecode -s system-serial-number
%..#&.....{a.y
[root@server1 ~]#
is there any other ways to get the serila number info?
Regards,
Sree
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2014 06:45 PM
02-12-2014 06:45 PM
Re: How to get Serial number in Linux w/o using dmidecode
If you run dmidecode without any options can you see the serial number and other text output OK?
I just ran
dmidecode -s system-serial-number
and
dmidecode | grep "Serial Number:"
They both show the serial number of the system
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2014 03:46 AM
02-14-2014 03:46 AM
Re: How to get Serial number in Linux w/o using dmidecode
Dear..
Install "lshw OR hardinfo" pkgs in your system.
This two utilies find serial number.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2014 09:21 PM - last edited on 03-30-2022 07:53 AM by Parvez_Admin
03-11-2014 09:21 PM - last edited on 03-30-2022 07:53 AM by Parvez_Admin
Re: How to get Serial number in Linux w/o using dmidecode
Hello,
Let me add another, not well-known tool - facter.
Here is an example from my own CentOS 6.5 server.
dmidecode you already said you do not want to use...
# dmidecode -s system-serial-numberConfidential Info Erased
# lshw |grep -m1 'serial:'
serial: Confidential Info Erased
# facter | grep serialnumber
serialnumber => Confidential Info Erased
Cheers,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2014 12:49 PM - last edited on 01-05-2024 02:29 AM by Sunitha_Mod
03-22-2014 12:49 PM - last edited on 01-05-2024 02:29 AM by Sunitha_Mod
Re: How to get Serial number in Linux w/o using dmidecode
Something that just came up yesterday... If you are using a newer version of the HP BIOS (in this case a DL360p with BIOS P71) you might get the following problem:
[root@USE406RK54 ~]# dmidecode -s system-serial-number
# SMBIOS implementations newer than version 2.7 are not
# fully supported by this version of dmidecode.
USE406RK54
[root@USE406RK54 ~]#
The interesting part of this is that you DO get the serial number, however you also get a bunch of text that basically screws up any string scripts that you might be using. Another way to get this information as the serial number only is the following:
/usr/sbin/dmidecode -t 1 | egrep 'Serial' | awk '{print $3}'
[root@USE406RK54 init.d]# /usr/sbin/dmidecode -t 1 | egrep 'Serial' | awk '{print $3}'
USE406RK54
[root@USE406RK54 init.d]#
This bad behaviour only started with BIOS P71 (just released recently, supporting the new SMBIOS 2.8.0 standard). The full output of the dmidecode -t 1 is:
[root@USE406RK54 init.d]# /usr/sbin/dmidecode -t 1
# dmidecode 2.11
SMBIOS 2.8 present.
# SMBIOS implementations newer than version 2.7 are not
# fully supported by this version of dmidecode.
Handle 0x0100, DMI type 1, 27 bytes
System Information
Manufacturer: HP
Product Name: ProLiant DL360p Gen8
Version: Not Specified
Serial Number: **Confidential info erased**
UUID: 35363636-3233-5355-4534-3036524B3534
Wake-up Type: Power Switch
SKU Number: 666532-B21
Family: ProLiant
[root@USE406RK54 init.d]#
--
Side notes:
dmidecode released with CentOS (or RHEL) 6.4 and earlier is version 2.11 which does not support the 2.8 version of SMBIOS. So you'll not *quite* get the answer you want when using the "dmidecode -s system-serial-number" version of this string. You need dmidecode version 2.12 or later to get the latest ROM BIOS reads from HP Gen8 Gear.
Personally I'm trying to see if there is a newer version of dmidecode out there for either centos 6.4 or 6.5 or on the updates that handles the newer SMBIOS 2.8.0 standard (its been published since April 2013, but only recently implemented by HP).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2014 07:46 AM
12-09-2014 07:46 AM
Re: How to get Serial number in Linux w/o using dmidecode
If dmidecode is replying with junk, then your system serial number is junk. I believe you need to go into the BIOS/UEFI and change it. Look on the case of your machine and get its true serial number, then reboot, go into your BIOS, and modify it.
We had a number of serial numbers change mysteriously at a job I worked at. We never figured out how that happened.
In the meantime, you can also find the system serial number at /sys/devices/virtual/dmi/id/product_serial. ...Requires root to read, but many of the files in /sys/devices/virtual/dmi/id/ are readable by any user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2015 07:41 AM - last edited on 09-29-2020 05:18 AM by Parvez_Admin
01-15-2015 07:41 AM - last edited on 09-29-2020 05:18 AM by Parvez_Admin
Re: How to get Serial number in Linux w/o using dmidecode
As "GreyGnome" noted if the "dmidecode" command not providing correct information then it would be that the serial number is not properly set in the BIOS of the system.
I had written a script to view hardware information on a linux system.... If anyone interested can look into this:
How To Find Hardware Details In Linux [Admin: The link is no longer valid> Broken Link removed]
Thanks,
Mssm
SimplyLinuxFAQ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2017 06:56 AM
10-12-2017 06:56 AM
Re: How to get Serial number in Linux w/o using dmidecode
#!/bin/bash
echo "System Serial Number:"
dmidecode -s system-serial-number
echo "Serial Numbers:"
dmidecode | grep "Serial Number"
# Save this in /usr/local/bin and either chmod u+x or chmod 777. Name it something like sndmidecode. Enjoy