MrGreg
Posts: 66
Joined: Sun Jun 10, 2012 7:25 pm

Internal serial number or MAC from Raspbian?

Wed May 11, 2016 9:01 pm

I need to find the internal serial number or MAC from Raspbian.
I do not have the physical RPi to do a cat /proc/cpuinfo.
I do still have the SD card with the raspbian install that was the operating system for the RPi in question.
So...
Is the Serial number or MAC, or any other unique identifier for the RPI stored in Raspbian?
If so where and how would I find it?

Any information on this folks...

User avatar
rpdom
Posts: 14701
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Internal serial number or MAC from Raspbian?

Wed May 11, 2016 9:15 pm

No. The serial number is internal to the Pi and not stored on the SD card.

Well, perhaps the MAC address may be stored in a DHCP lease file, wherever dhcpcd stores those. It used to be /var/lib/dhcp/dhclient.eth0.leases.

Hmm, thinking about it, the serial number may well get logged into /var/log/dmesg. Yes, "grep serial /var/lib/dmesg" on one of my Pis gives the Kernel command line, which is /boot/cmdline.txt and some extra bits, including "bcm2708.serial=0x12345678 smsc95xx.macaddr=B8:27:EB:34:56:78"

MrGreg
Posts: 66
Joined: Sun Jun 10, 2012 7:25 pm

Re: Internal serial number or MAC from Raspbian?

Wed May 11, 2016 9:29 pm

Cheers !
I'll have a rummage around in there

Thanks

rayjoh
Posts: 26
Joined: Thu May 23, 2013 11:48 am

Re: Internal serial number or MAC from Raspbian?

Thu May 12, 2016 5:27 pm

You can find the serial number in /proc/cpuinfo. The six last digits is reused in MAC address.

Code: Select all

grep Serial /proc/cpuinfo
-- Raymond

User avatar
B.Goode
Posts: 8024
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Internal serial number or MAC from Raspbian?

Thu May 12, 2016 6:06 pm

rayjoh wrote:You can find the serial number in /proc/cpuinfo. The six last digits is reused in MAC address.

Code: Select all

grep Serial /proc/cpuinfo
But @MrGreg is ahead of you: he wrote in his original post -
I do not have the physical RPi to do a cat /proc/cpuinfo.

User avatar
DougieLawson
Posts: 35518
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Internal serial number or MAC from Raspbian?

Fri May 13, 2016 8:25 pm

rpdom wrote: Hmm, thinking about it, the serial number may well get logged into /var/log/dmesg. Yes, "grep serial /var/lib/dmesg" on one of my Pis gives the Kernel command line, which is /boot/cmdline.txt and some extra bits, including "bcm2708.serial=0x12345678 smsc95xx.macaddr=B8:27:EB:34:56:78"
That worked on an SDCard I had booted on a RPi on 5th May.

I did it with
mount /dev/sda2 /mnt
cd /mnt/var/log
grep -i 'smsc95' syslog
you'd have to use mount /dev/sda6 /mnt if it was a NOOBS card.

Code: Select all

May  5 10:07:53 raspberrypi kernel: [    0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708.boardrev=0xe bcm2708.serial=0x62144670 smsc95xx.macaddr=B8:27:EB:14:46:70 bcm2708_fb.fbswap=1 bcm2708.uart_clock=3000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
May  5 10:07:53 raspberrypi kernel: [    1.384563] usbcore: registered new interface driver smsc95xx
May  5 10:07:53 raspberrypi kernel: [    2.822200] smsc95xx v1.0.4
May  5 10:07:53 raspberrypi kernel: [    2.892826] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-20980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:14:46:70
May  5 10:07:55 raspberrypi kernel: [   17.125562] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May  5 10:07:56 raspberrypi kernel: [   18.618498] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
Note: Having anything remotely humorous in your signature is completely banned on this forum. Wear a tinfoil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

MrGreg
Posts: 66
Joined: Sun Jun 10, 2012 7:25 pm

Re: Internal serial number or MAC from Raspbian?

Mon May 16, 2016 9:12 pm

Got it, thanks

( Gosh! There is a whole lot of stuff in that log)

Much appreciated

MrGreg

Return to “General discussion”