With the fast development of science and technology, customers have higher and higher requirements for server performance. Therefore, multiple hardware generations are launched in quick succession. When a customer installs a new device in a server under Linux operating system, he or she may see the invalid device information because the release date of the device is newer than the release date of the operating system.
This paper provides a brief introduction about how to detect and fix the missing/incomplete naming of the new PCI and USB devices. Our instructions are based on SUSE Linux Enterprise Server 15 SP2 running on a Lenovo ThinkSystem server, however the instructions are also relevant to Red Hat and Ubuntu. This paper is intended for IT administrators and quality assurance engineers. Readers are expected to have a basic knowledge of Linux.
Missing/incomplete device names can cause misunderstanding and suspicion for customers. This section will explain the origin of device name clearly and provide the solution accordingly.
PCI device names
In this section, we provide a guide to introduce the origin of the name about PCI device and how to correct the missing name definition in Linux OSes.
PCI ID Repository
There is an open-source project: The PCI ID Repository, which is a public repository of all known IDs used in PCI devices: IDs of vendors, devices, subsystems and device classes for various programs (e.g., The PCI Utilities) to display full human-readable names instead of hexadecimal code. Everyone can browse the latest database and download the latest database in form of a pci.ids file.
For different Linux distributions, there may have multiple pci.ids files in your operating system in different locations. To find out the actual pci.ids you are using, you need to install a debugging tool named strace.
Finding the PCI device name
Each PCI device typically has a vendor & device ID indicating the chip and a subvendor & subdevice ID (collectively called subsystem) indicating the board on which the chip resides. There should be one line for each device vendor & device ID and subsystem ID in the naming file. You can get the device information with the steps below:
- Grab the device domain information (The first column of output is domain). We will use “5b:00.0” for the example:
- Get the vendor and device ID and subsystem information.
- Check the name definition in your OS.
Based on the above output, vendor id (1000), device id (00af) and subvendor id are available in the database while subdevice id is not available.
Figure 6. Determine the current name of the device
Modifying the PCI device name
There are two alternatives to updating the PCI device name.
The easiest way is to run the update-pciids command if the missing data is available in PCI ID repository. This requires your machine to be able to access the Internet. The following screenshot shows the subdevice information available after the database is updated from the Internet.
If your system doesn't have internet access then you can manually update the database. If PCI ID repository does not include a device ID, please consult the device vendor and add one-line information to the database.
Open the pci.ids file using the vi/vim commands, find the line of device ID “00af” and add the definition of subdevice ID below, then save it.
USB device names
In this section, we provide a guide to introduce the origin of the name of USB device and how to correct it to the expected name in Linux OSes.
USB ID Repository
There is an open-source project: The USB ID Repository, which is a public repository of all known ID's used in USB devices: ID's of vendors, devices, subsystems and device classes. It is used in various programs (e.g., The USB Utilities) to display full human-readable names instead of hexadecimal codes. Everyone can browse the latest database list and download the latest database in form of a usb.ids file.
For the early build of USB Utilities (lsusb), which uses the file usb.ids directly for USB device naming, we can use the tool “strace” to locate the path to USB database (usb.ids) in Ubuntu 18.04:
Note that the database usb.ids is not used anymore since Sep 30, 2019.Instead, udev hardware database is used.
According to the output of the command “man hwdb”, hwdb.bin is generated after systemd-hwdb reads all the */hwdb.d/*.hwdb. The file “20-usb-vendor-model.hwdb” is for the USB device naming file imported from: http://www.linux-usb.org/usb.ids.
Thus, all the USB names always come from USB ID Repository in different ways.
Finding the USB device name
Each USB device typically has a vendor & device ID indicating the chip. There should be one line for vendor & device ID about each device in the naming file. You can get the device information with the steps below:
- Grab the USB device ID (After the keyword “ID”).
- Check the definition about vendor & device ID “2a4b:0400” and “1d6b:0003” in the file /lib/udev/hwdb.d/20-usb-vendor-model.hwdb and usb.ids.
The above is about the format of the udev hardware database. The following image shows the format of usb.ids:
There is no information about vendor 2a4b in either usb.ids or hardware database.
Modifying the USB device name
The process to modify the USB device name depends on the USB database:
For original usb.ids naming: Run the update-usbids command if the missing data is available in USB ID repository. This requires your machine to be access the Internet. The following screenshot shows the vendor and device information available after the database is updated from the Internet.
For udev hardware database naming, find out the standard definitions in the USB ID repository and add them to file /lib/udev/hwdb.d/20-usb-vendor-model.hwdb, for example below:
The following screenshot shows the vendor and device information available after rebuilding the file hwdb.bin.
Note: If USB ID repository does not include a vendor/device ID, please consult the device vendor and add one-line information to the database.
Song Shang is a Linux Engineer in Lenovo Infrastructure Solutions Group, based in Beijing, China.
Related product families
Product families related to this document are the following:
Lenovo and the Lenovo logo are trademarks or registered trademarks of Lenovo in the United States, other countries, or both. A current list of Lenovo trademarks is available on the Web at https://www.lenovo.com/us/en/legal/copytrade/.
The following terms are trademarks of Lenovo in the United States, other countries, or both:
The following terms are trademarks of other companies:
Linux® is the trademark of Linus Torvalds in the U.S. and other countries.
Other company, product, or service names may be trademarks or service marks of others.