Identifying supported PCIe versions and width

I’m trying to determine the supported PCIe versions and width (x1, x4, etc) of the PCIe slots I have. Normally I would look in the user manual, but in this case my hardware is a Minisforum x400, and the manual mentions the physical size of the slots (2280, 2242, etc). On the 2280 I have already have an old 2280 NVMe, one of the short ones (don’t know the exact size) has an Intel Wi-Fi 6 card. I would like to purchase an NVMe for the 3rd (2242) M.2 slot, but I can’t figure out the PCIe version and bus width. I don’t want to purchase a more expensive drive if it cannot function at its best.

So far I came across this SX post, but it didn’t really help since I can’t identify which port is which (if I could tell which device is plugged in, that would already help). Does anyone one have any idea how I can figure this out?

My storage & networking devices:

# inxi -ND
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet driver: r8169
  Device-2: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet driver: r8169
  Device-3: Intel Wi-Fi 6 AX200 driver: iwlwifi
Drives:
  Local Storage: total: 931.51 GiB used: 65.24 GiB (7.0%)
  ID-1: /dev/nvme0n1 vendor: PNY model: CS3030 1TB SSD size: 931.51 GiB

PCI devices:

# lspci -vv | grep -E 'PCI bridge|LnkCap' 
00:02.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir PCIe GPP Bridge (prog-if 00 [Normal decode])
		LnkCap:	Port #0, Speed 8GT/s, Width x16, ASPM L1, Exit Latency L1 <64us
		LnkCap2: Supported Link Speeds: 2.5-8GT/s, Crosslink- Retimer- 2Retimers- DRS-
00:02.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne PCIe GPP Bridge (prog-if 00 [Normal decode])
		LnkCap:	Port #1, Speed 8GT/s, Width x4, ASPM L1, Exit Latency L1 <64us
		LnkCap2: Supported Link Speeds: 2.5-8GT/s, Crosslink- Retimer- 2Retimers- DRS-
00:02.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne PCIe GPP Bridge (prog-if 00 [Normal decode])
		LnkCap:	Port #3, Speed 8GT/s, Width x1, ASPM L1, Exit Latency L1 <64us
		LnkCap2: Supported Link Speeds: 2.5-8GT/s, Crosslink- Retimer- 2Retimers- DRS-
00:02.5 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne PCIe GPP Bridge (prog-if 00 [Normal decode])
		LnkCap:	Port #4, Speed 8GT/s, Width x1, ASPM L1, Exit Latency L1 <64us
		LnkCap2: Supported Link Speeds: 2.5-8GT/s, Crosslink- Retimer- 2Retimers- DRS-
00:08.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir Internal PCIe GPP Bridge to Bus (prog-if 00 [Normal decode])
		LnkCap:	Port #0, Speed 8GT/s, Width x16, ASPM L0s L1, Exit Latency L0s <64ns, L1 <1us
		LnkCap2: Supported Link Speeds: 2.5-16GT/s, Crosslink- Retimer+ 2Retimers+ DRS-
		LnkCap:	Port #0, Speed 8GT/s, Width x4, ASPM L1, Exit Latency L1 <64us
		LnkCap2: Supported Link Speeds: 2.5-8GT/s, Crosslink- Retimer- 2Retimers- DRS-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s unlimited, L1 <64us
		LnkCap2: Supported Link Speeds: 2.5GT/s, Crosslink- Retimer- 2Retimers- DRS-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s unlimited, L1 <64us
		LnkCap2: Supported Link Speeds: 2.5GT/s, Crosslink- Retimer- 2Retimers- DRS-
		LnkCap:	Port #4, Speed 5GT/s, Width x1, ASPM L1, Exit Latency L1 <8us
		LnkCap2: Supported Link Speeds: 2.5-5GT/s, Crosslink- Retimer- 2Retimers- DRS-
		LnkCap:	Port #0, Speed 8GT/s, Width x16, ASPM L0s L1, Exit Latency L0s <64ns, L1 <1us
		LnkCap2: Supported Link Speeds: 2.5-16GT/s, Crosslink- Retimer+ 2Retimers+ DRS-
		LnkCap:	Port #0, Speed 8GT/s, Width x16, ASPM L0s L1, Exit Latency L0s <64ns, L1 <1us
		LnkCap:	Port #0, Speed 8GT/s, Width x16, ASPM L0s L1, Exit Latency L0s <64ns, L1 <1us
		LnkCap:	Port #0, Speed 8GT/s, Width x16, ASPM L0s L1, Exit Latency L0s <64ns, L1 <1us
		LnkCap:	Port #0, Speed 8GT/s, Width x16, ASPM L0s L1, Exit Latency L0s <64ns, L1 <1us
		LnkCap:	Port #0, Speed 8GT/s, Width x16, ASPM L0s L1, Exit Latency L0s <64ns, L1 <1us
		LnkCap:	Port #0, Speed 8GT/s, Width x16, ASPM L0s L1, Exit Latency L0s <64ns, L1 <1us
# dmidecode | grep -B1 'PCI Express'
	Designation: J10
	Type: PCI Express x16
--
	Designation: J3700 M.2 Slot
	Type: PCI Express x1
--
	Designation: J3708 PCIE x4 slot from Promontory
	Type: PCI Express x4
--
	Designation: J3703 PCIE x1 slot from Promontory
	Type: PCI Express x1
--
	Designation: J3702 PCIE x1 slot from Promontory
	Type: PCI Express x1
--
	Designation: J3707 PCIE x4 slot from Promontory
	Type: PCI Express x4
--
	Designation: J3701 M.2 WLAN/BT slot from Promontory
	Type: PCI Express x1

Did you try a dmidecode -t 9?

That’s a really hard exercise you’re trying to do. There is a much easier way.

What PCIe gen and # of electrical lanes connected by slot is (should be) documented in your mobo manual. I find I have no trouble finding manuals from manufacturers even for products released 15 years ago.