How to Check PCI Slots in Linux
In this article
To check PCI slots in Linux, you can use the lspci command, which lists all PCI devices connected to your system. For detailed slot information (like physical slot numbers or bus addresses), combine it with lspci -v or use lshw. This guide shows you several methods, from quick commands to deeper hardware queries, so you can identify what's plugged into each PCI slot and which slots are free.
What You'll Need
- A Linux system (any distribution) with a terminal.
- Root or sudo access for some commands (like
lshwordmidecode). - Basic familiarity with the terminal (copy/paste commands).
Step-by-Step
- Open a terminal. Press
Ctrl+Alt+Ton most desktop environments, or use your app launcher to find "Terminal". - Run the basic PCI list. Type
lspciand press Enter. This shows a list of all PCI devices with their vendor, device name, and bus address (e.g.,00:1f.2). The output looks like:00:00.0 Host bridge: Intel Corporation ...
The first part (like00:00.0) is the PCI bus/device/function address, not the physical slot number. - Get more detail with verbose mode. Run
lspci -vto see additional info for each device, including IRQ, memory ranges, and sometimes the physical slot description (like "PCIe Slot 1"). This output is long, so you can scroll or pipe it toless:lspci -v | less. - Check for empty slots using kernel messages. Run
dmesg | grep -i pcito see boot-time PCI detection messages. Look for lines mentioning "pci_bus" or "slot"—they may indicate which slots are populated or empty. This is not always reliable, but it can help. - Use
lshwfor a hardware overview. Install it if needed (sudo apt install lshwon Debian/Ubuntu,sudo dnf install lshwon Fedora). Then runsudo lshw -class busto see a tree of PCI buses and devices. The output shows bus addresses and sometimes slot names (e.g., "PCI ExpressSlot 3"). - Use
dmidecodefor physical slot information. Runsudo dmidecode -t slotto list all physical PCI/PCIe slots on the motherboard, including which are occupied and which are free. This is the most direct way to see empty slots. Example output:Designation: PCIEX16_1
Type: x16 PCI Express
Current Usage: In Use - Map devices to slots. If
lspcishows a device at bus address01:00.0, you can match it to a physical slot by cross-referencing the bus number with the slot info fromdmidecode(though the mapping isn't always straightforward). For most users,lspciplusdmidecode -t slotgives enough info.
Common Mistakes
- Confusing bus address with physical slot. The
00:1f.2is a logical address, not the slot you see on the motherboard. Usedmidecodefor physical slots. - Not using sudo when needed. Commands like
lshwanddmidecoderequire root privileges to show full details. Without sudo, they may output partial or no info. - Assuming
lspcishows empty slots. It only lists devices that are present. Empty slots are invisible tolspci. - Ignoring kernel message filtering.
dmesgcan be huge; usinggrephelps but may miss relevant lines if you filter too narrowly.
Tips
- Use
lspci -nnto show vendor and device IDs in numeric form, which helps identify unknown hardware. - For a quick visual, run
lspci -tvto see a tree view of PCI buses and devices. - If you're planning to add a new card, check the available slot types (e.g., PCIe x16, x1) using
dmidecode -t slotto ensure compatibility. - On laptops, many slots are soldered or not user-accessible;
dmidecodemay list them but they might not be physically available. - Save the output of
lspcito a file for reference:lspci > pci_devices.txt.
Troubleshooting
If lspci returns nothing or an error:
- Ensure the
pciutilspackage is installed. On Debian/Ubuntu:sudo apt install pciutils. On Fedora:sudo dnf install pciutils. - Try running
sudo lspci—some systems restrict access to the PCI database. - If you still see nothing, your system may have a hardware issue or the PCI bus is not detected. Check
dmesg | grep -i pcifor errors.
If dmidecode -t slot shows no output or errors:
- Run it with sudo:
sudo dmidecode -t slot. Without sudo, it often fails. - If it says "No SMBIOS entry found", your system may use a different firmware (like UEFI without full SMBIOS). Try
sudo dmidecode | grep -i slotas a fallback. - Some virtual machines or older hardware may not expose slot information—this is normal.
If you can't identify which physical slot a device is in:
- Look at the bus number from
lspci(e.g.,02:00.0). The bus number often correlates with the physical slot order, but not always. - Use
lspci -vand look for "Physical Slot" or "Slot" lines—some drivers report it. - As a last resort, physically open the case and trace cables—but only if you're comfortable and the system is powered off.
Frequently Asked Questions
Can I see empty PCI slots with lspci?
No, lspci only lists devices that are present. To see empty slots, use sudo dmidecode -t slot which reports all physical slots and their usage status.
What does the PCI bus address mean?
It's a triplet like 00:1f.2: the first two numbers are the bus and device, the last is the function. It's a logical identifier, not a physical slot number.
Do I need to install anything to run lspci?
Most Linux distributions include pciutils by default. If not, install it via your package manager (e.g., sudo apt install pciutils).
Why does dmidecode require sudo?
Because it reads the system's SMBIOS/DMI firmware tables, which are protected. Without root, it can't access that data.
Can I check PCI slots on a laptop?
Yes, but many laptop slots are not user-accessible. The commands will still list them, but you may not be able to physically use them. For upgrades, check your laptop's manual.
How do I know if a PCIe slot is x16 or x1?
Use sudo dmidecode -t slot and look at the "Type" field (e.g., "x16 PCI Express"). Alternatively, check your motherboard's manual or the physical slot size.