Finding Your Raspberry Pi Serial Number

bret.dk 1 dzień temu
Zdjęcie: Raspberry Pi Serial Number


How do I find my Raspberry Pi Serial Number?

You may need your Raspberry Pi serial number for a variety of reasons, though it recently came up for me when wanting to boot my Raspberry Pi 5 over the network. Luckily, there are a couple of easy methods to obtain your Raspberry Pi serial number should you need it!

Method 1: Raspberry Pi Boot Screen

The quickest and easiest way to find your Raspberry Pi serial number (assuming you have a display and HDMI cable available to see the output) is to simply boot your Raspberry Pi and find the serial number from the boot screen as circled in the example below.

Method 2: Within the Operating System

If you’re able to boot your Raspberry Pi with an existing boot device, then you can find your serial number in multiple places.

/proc/cpuinfo

The serial number is available within the OS if you run cat /proc/cpuinfo | grep Serial and then take the last 8 characters.

/sys/firmware/devicetree/base/serial-number

Another way to get the same data is to use cat /sys/firmware/devicetree/base/serial-number and take the final 8 characters from that output

If you want to forego the difficult counting part, you can add | tail -c 9 to the end of either of the above commands to only get the last 8 characters from the output. An example of this output can be found below.

Conclusion

Now you have your Raspberry Pi’s serial number, you can use it in cases such as PXE/network booting where the Pi will be looking for a folder on your TFTP server with a matching serial number. However you’re using it, I hope this steps help!

Idź do oryginalnego materiału