hardware inventory -- what's in my machine?

Sometimes I don't remember what's in each of my machines. Here's what I use to figure this out: - taking the machine apart (often inconvenient) - dmesg(8) shows the kernel log. If nothing has flooded the log it will still have the messages from the booting. You can see entries from the kernel's discovery of most resources. Downside: it is long and arcane. Upside: you might find some surprises (eg. warnings). - dmidecode(8) "DMI table decoder". The output is a little arcane but useful. The man page says that it can be unreliable. - (new to me) lshw(1) "list hardware". The output seems easier to read that dmidecode's. It uses a variety of sources. It can output in a bunch of formats (but I've ignored that). - /proc/cpuinfo will tell you about the CPU. Apparently lscpu(1) shows pretty much the same thing (I've never noticed it before). - /proc/meminfo will tell you how much RAM you have (MemTotal is roughly the physical RAM, after some overhead has been removed). - /var/log/Xorg.0.log: shows what devices and capabilities X has found. Hard to read but sometimes it's what you need. - lsusb(8): list USB devices (including hubs). - lspci(8): list PCI devices and buses - sdparm(8)/hdparm(8): show (or set!) parameters of disk drive. hdparm seems to be mostly obsolete. This will tell you stuff: sudo sdparm -i /dev/sda - smartctl(8) "SMART Monitoring Tools". SMART == Self-Monitoring, Analysis and Reporting Technology. This is about disk drive issues. This command will pour out a lot of information: sudo smartctl -x /dev/sda

On Sun, 16 Aug 2015 16:20:03 -0400 (EDT) "D. Hugh Redelmeier" <hugh@mimosa.com> wrote:
Sometimes I don't remember what's in each of my machines.
Here's what I use to figure this out:
Hugh, I have installation instructions written up for each of my machines, which I post on my website. Among other things, I list the hardware contained in each machine. -- Howard Gibson hgibson@eol.ca howard.gibson@teledyneoptech.com jhowardgibson@gmail.com http://home.eol.ca/~hgibson

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 To which I would add lsblk - list the block devices, their sizes and mount points (not in all distros) blkid - list the UUIDs of the block devices - --Bob On 16/08/15 04:20 PM, D. Hugh Redelmeier wrote:
Sometimes I don't remember what's in each of my machines.
Here's what I use to figure this out:
- taking the machine apart (often inconvenient)
- dmesg(8) shows the kernel log. If nothing has flooded the log it will still have the messages from the booting. You can see entries from the kernel's discovery of most resources. Downside: it is long and arcane. Upside: you might find some surprises (eg. warnings).
- dmidecode(8) "DMI table decoder". The output is a little arcane but useful. The man page says that it can be unreliable.
- (new to me) lshw(1) "list hardware". The output seems easier to read that dmidecode's. It uses a variety of sources. It can output in a bunch of formats (but I've ignored that).
- /proc/cpuinfo will tell you about the CPU. Apparently lscpu(1) shows pretty much the same thing (I've never noticed it before).
- /proc/meminfo will tell you how much RAM you have (MemTotal is roughly the physical RAM, after some overhead has been removed).
- /var/log/Xorg.0.log: shows what devices and capabilities X has found. Hard to read but sometimes it's what you need.
- lsusb(8): list USB devices (including hubs).
- lspci(8): list PCI devices and buses
- sdparm(8)/hdparm(8): show (or set!) parameters of disk drive. hdparm seems to be mostly obsolete. This will tell you stuff: sudo sdparm -i /dev/sda
- smartctl(8) "SMART Monitoring Tools". SMART == Self-Monitoring, Analysis and Reporting Technology. This is about disk drive issues. This command will pour out a lot of information: sudo smartctl -x /dev/sda
Bob Jonkman <bjonkman@sobac.com> Phone: +1-519-635-9413 SOBAC Microcomputer Services http://sobac.com/sobac/ Software --- Office & Business Automation --- Consulting GnuPG Fngrprnt:04F7 742B 8F54 C40A E115 26C2 B912 89B0 D2CC E5EA -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) Comment: Ensure confidentiality, authenticity, non-repudiability iEYEARECAAYFAlXRHH8ACgkQuRKJsNLM5eobQwCg/SzGx6TJ1X9NloP7Nt4euwZ9 7MgAniEIL75qCrp9L9wIHeOVSo3ZAgYe =wepG -----END PGP SIGNATURE-----

| From: Bob Jonkman <bjonkman@sobac.com> | lsblk - list the block devices, their sizes and mount points (not in | all distros) Good one. | blkid - list the UUIDs of the block devices Yeah. Necessary, if confusing and messy. I have my own hack, a script that merges the output of fdisk, df, and e2label. It isn't as useful now that GPT / GUID partitioning is taking over.

- dmidecode(8) "DMI table decoder". The output is a little arcane but useful. The man page says that it can be unreliable.
http://www.thegeekstuff.com/2008/11/how-to-get-hardware-information-on-linux...
- (new to me) lshw(1) "list hardware". The output seems easier to read that dmidecode's. It uses a variety of sources. It can output in a bunch of formats (but I've ignored that).
lshw -html > hwinfo.html then double click the hwinfo.html file, you will be pleasantly surprised :)
- /proc/cpuinfo will tell you about the CPU. Apparently lscpu(1) shows pretty much the same thing (I've never noticed it before).
lscpu gathers CPU architecture information from sysfs and /proc/cpuinfo
- /var/log/Xorg.0.log: shows what devices and capabilities X has found. Hard to read but sometimes it's what you need.
xdpyinfo I found was easier on the eyes..
- lsusb(8): list USB devices (including hubs).
lsusb -tv ( the flags enable a tree lsiting which can help )
- lspci(8): list PCI devices and buses
lspci -tv ( again displays a tree which can be useful ) and this am yet to use for any real work but is highly interesting: sudo dd if=/dev/mem bs=1k skip=768 count=256 2>/dev/null | strings -n 8 # Read BIOS ( Seriously try it :) Aruna
participants (5)
-
Aruna Hewapathirane
-
Bob Jonkman
-
D. Hugh Redelmeier
-
Howard Gibson
-
Tim Sattarov