LAB-HW-01 - Exploring System Hardware
Exploring System Hardware
Identify and inspect physical hardware components (CPU, Memory, PCI bus, USB devices) attached to the Linux system without ever opening the server chassis.
- Identify and inspect physical hardware components (CPU, Memory, PCI bus, USB devices) attached to the Linux system without ever opening the server chassis.
- Repeat the workflow without copy-paste or step-by-step prompting.
- Use read-only discovery commands unless the lab explicitly tells you to change hardware or firmware state.
Part A: The Field Guide
🎯 What & Why
You just SSH’d into a remote server 2,000 miles away. You have no idea what it is. Is it a massive 64-core database server, or a tiny Raspberry Pi? Does it have a dedicated GPU attached? Is the USB backup drive physically plugged in?
You cannot open the box to look. You must ask the Linux Kernel.
The Kernel maintains a constant, live inventory of every single piece of silicon and metal attached to the motherboard.
We retrieve this inventory using the ls* family of hardware commands (List CPU, List PCI, List USB).
🧠 Mental Model: The Three Busses
When electricity flows through a motherboard, it travels down three primary highways (Busses):
- The Core Block: The CPU and the RAM. These are accessed via highly specific core commands (
lscpuandfree). - The PCI Bus: The high-speed internal highway. This is where Graphics Cards (GPUs), Network Cards (NICs), and NVMe solid-state drives plug in. Evaluated using
lspci. - The USB Bus: The slower, external highway. This is where keyboards, mice, flash drives, and external backup arrays plug in. Evaluated using
lsusb.
📖 Command Reference
The Core Block
$ # Print exhaustive details about the processor architecture $ lscpu
$ # Show exactly how much RAM is installed, how much is used, and how much is free $ # The (-h) flag makes it Human-Readable (Gigabytes instead of Bytes) $ free -h
$ # A quick combination tool that reads BOTH the CPU and RAM interactively $ htop
The Expansion Busses
$ # List every device plugged directly into the motherboard slots $ lspci
$ # List every device plugged into external USB ports $ lsusb
$ # List block storage devices (Hard Drives) $ lsblk
🌍 Real Scenarios
Scenario 1: Sizing the Database
You are hired to tune a PostgreSQL database. The very first thing you do is run lscpu and free -h. You discover the server has 32 CPU cores but only 8GB of RAM! This is an insane hardware bottleneck. You instantly know why the database is struggling and tell the client they need to upgrade the RAM before you even touch a config file.
Scenario 2: The Missing Network Card
You plug a brand new 10-Gigabit fiber network card into the server slot. You boot Linux. You run ip link, but the fiber card doesn’t show up. Is the card dead, or is Linux missing the software drivers?
You run lspci. You see Ethernet controller: Intel X710 10GbE SFP+.
The kernel does see the physical metal card! You conclude the card is physically fine, but you need to manually install the i40e Linux driver software for it to work.
⚠️ Gotchas & Pitfalls
- Virtual Machines lie to you
If you run
lscpuinside an AWS EC2 instance or a VirtualBox VM, you do not see the real physical hardware of the remote host. You explicitly see the virtualized slice of hardware the hypervisor (VMware/KVM) chose to show you. Look for theHypervisor vendor:line inlscputo confirm. free -mvsfree -hMany older Sysadmins have rigid muscle memory forfree -m(Megabytes). If a server has 128 Gigabytes of RAM,free -mwill output131072. This is unreadable. Train yourself to usefree -h(Human) so it outputs128Gi.
Part B: The Drill Deck
Terminal Required: Open any Linux terminal. It doesn’t matter if it’s a VM, a Raspberry Pi, or WSL; the kernel will report what it sees.
G Guided Step by step - type exactly this and compare the result >
Exercise G1: The Brain
- Interrogate your processor:
lscpu - Find the line that says
Architecture:. Is itx86_64(Standard Intel/AMD PC) oraarch64(ARM / Apple Silicon / Raspberry Pi)? - Find the line that says
CPU(s):. How many total logical processing cores do you have? - Look at
Model name:. What exact brand of silicon is running your machine?
Exercise G2: The Memory
- Check your available RAM:
free -h - Look at the
Mem:row (NOT the Swap row yet). - Identify your
totalRAM capacity. - Identify how much is
available. (Note: Do not look atfree. Linux intentionally fills upfreeRAM with cached files to speed up the system.availableis the true amount of RAM you can safely use before the system crashes).
Exercise G3: The Peripherals
- Let’s see what is plugged into the motherboard. Run:
lspci - If you are in a Virtual Machine, you will see fake simulated devices (like
VMware Virtual Machine Communication Interface). - If you have a dedicated Graphics Card (Nvidia/AMD), you will see a
VGA compatible controller:line. - Run:
lsusbto see your virtual or physical USB hubs.
S Solo Task described, hints available - figure it out >
Exercise S1: Verbosity is Power
The lspci command output is extremely brief. If you are troubleshooting a specific manufacturer defect, you need the nitty-gritty silicon details.
- Add the Verbose flag to PCI:
lspci -v. - Scroll up. Notice how an entry that was previously one line is now 10 lines, detailing the precise memory addresses, latency timers, and exact Linux
Kernel modules(Drivers) assigned to the card. - If you need even more depth, you can run
-vv(Very Verbose).
Exercise S2: Grepping the Metal
You run lspci on a massive enterprise server and receive 80 lines of chaotic output connecting to dozens of bridges. You only care about Network connectivity.
- Pipe
lspciintogrep. - Instruct grep to search for the word
EthernetorNetwork(Case-insensitive!). - The output should be cleanly reduced to just your network interface cards.
M Mission Real scenario - no hints, combine multiple skills >
Mission M1: The Raw Source of Truth
Where do commands like lscpu actually get their information? They don’t cast magic spells. They simply read text files that the Kernel constantly generates inside the mysterious /proc virtual filesystem.
Whenever you run lscpu, the tool is secretly just formatting the raw text found in /proc/cpuinfo.
Your Mission:
Bypass the lscpu tool entirely.
- Use the
catcommand to read the raw Kernel stream directly at/proc/cpuinfo. - Marvel at the raw data block for
{'{}'}processor : 0{'}'}. - Use the same technique to find the raw Kernel source file for Memory statistics. (Instead of
cpuinfo, the file is calledmeminfo). - Read
/proc/meminfo. Notice it contains 50x more detailed RAM statistics than the simplefree -hcommand summarizes!
(When you truly understand Linux, you realize that absolutely everything is just a text file. Even the hardware!)