So let’s say that you want to install a new operating system on your Linux computer. It could be by dual-booting it with your current OS, dedicating a whole hard drive to it, or booting it directly from within a virtual machine. In all cases, you have to make sure that you know your Linux hardware info beforehand. Otherwise, you might end up with one of the following situations.
You Might Get a Distro That Isn’t Compatible with Your Machine
Either it uses the wrong architecture, doesn’t recognize some hardware components, or it is too powerful for your system’s specs. In all cases, knowing your Linux hardware info saves you the headache of downloading the wrong version of your favorite distro. Some of these circumstances are more common than you might think.
- Many distributions offer their OS in the 32-bit and 64-bit format. By choosing 32-bit when your system runs on 64-bit, you will end up with an OS that offers subpar performance. By opting for the 64-bit disc image when your machine runs on 32-bit, you will end up with a non-functioning OS.
- Some distributions, such as Debian (https://www.debian.org/distrib/), offer both a stock, official version and an unofficial version containing non-free firmware. Those using brand new or not-so-common hardware components might have to choose the non-free firmware version. It contains proprietary drivers, whereas official Debian releases only include open-source drivers. These are unfortunately sometimes incompatible with new hardware, which is why knowing your Linux hardware info is primordial.
- Even though Linux tends to be gentler on your hardware than its mainstream OS competitors, some machines might benefit from the use of specific distributions. Older computers often require lightweight Linux distros, as their components aren’t meant to sustain the toll of newer operating systems. If your laptop is particularly old, you might even require the use of a lightweight desktop environment. These factors are especially relevant when dealing with virtualization. By booting a VM (virtual machine) that contains a distribution, you end up running two OS at the same time. You thus have to make sure that your other Linux operating system isn’t eating up your computer’s RAM or storage.
You Might Format the Wrong Drive
That can happen when you want to boot a Linux distribution from USB or when dedicating a whole hard drive to it. By not knowing your external and internal drives’ identifiers, you might format the wrong one by mistake. It is also why I recommend having only one USB plugged in your laptop when burning a disc image.
Even though virtually all GUI (graphical user interface) software asks for confirmation before erasing a drive’s content, the Terminal doesn’t. When formatting or burning an ISO image on a specific drive using the command line, you always run the risk of irrevocably erasing the wrong drive. That is why before performing the procedure, you have to make sure that you know your Linux hardware info.
The Importance of Knowing Your Linux Hardware Info Before Installing a New Distribution
The factors above are examples of situations where knowing your nomenclature and Linux hardware info come in handy. Understanding how your computer refers to each USB port and hard drive (if you have more than one or if you had partitioned it) can be crucial. The same goes for knowing the brand and model of your CPU to know which architecture you are using. Finally, knowing the name of your network interface, graphics card, touchpad, and other peripherals is essential. Indeed, not only might you need this information when deciding whether you want to choose an OS with proprietary drivers, but also if you have to troubleshoot compatibility issues.
Under ideal circumstances, you should already have the basic specs of your computer noted down somewhere before installing a new operating system. At a minimum, knowing your computer’s RAM and available storage space is always good to know. Nonetheless, as long as you still have access to your Linux Terminal, you can fetch all the Linux hardware info you need.
Even if your computer’s operating system is kaput, if you can still access the BIOS (more on that HERE), all hope isn’t lost. Most UEFI programs offer at least some details regarding the processor, RAM, and hard drive(s).
Specific hardware components to keep in mind
Two computer components, in particular, can end up requiring some troubleshooting before being fully functional with your new Linux operating system: the video (graphics) card, and the network interface. Indeed, some models of graphics card or WiFi chips can be a little more finicky to deal with due to driver compatibility and recognition. Having your hardware info on hand makes finding a solution faster and easier. If you run into a particular hardware compatibility issue when operating a new Linux distribution, then I recommend taking a look at the distro’s forums. You can find a list of OS-related online resources on ITgirl.tech by clicking here (LINK).
A good preemptive measure to take when wanting to install a new Linux OS on your machine is to first try it out on a virtual machine. That will allow you to check for possible incompatibilities first, without having to commit to the new operating system fully.
Another useful trick is to have an ethernet cable ready in case your WiFi doesn’t work out of the box. Usually, the ethernet adaptor will work even if your distro doesn’t detect the WiFi.
Lastly, doing a bit of Google-fu before you install a new Linux OS by searching for “[NameAndModelOfMyPeripheral] + [NameOfMyLinuxDistribution] + troubleshooting” can be enlightening. It is often not necessary to do this step, but if you own obscure (read unpopular or obsolete) hardware, you might want to give it a go.
This ITgirl.tech article will first give a general list of all the Linux hardware info you might require before installing a new operating system on your computer. Then, you will find useful Terminal commands to fetch all the hardware specs you need.
What Hardware Info Might You Need?
Usually, Linux distributions will provide the minimal hardware specs recommended to get the best user experience out of their OS. Besides taking a look at them and noting whether or not they coincide with your own computer’s firmware, you might also want to take note of the following:
- How many do you have?
- What is their order, and what is their identifier? (ex: sda1, sda2, etc.)
- Are they partitioned? If so, how many are there and how much storage space have you allocated to each one?
- Are there operating systems already present on specific partitions or hard drives? If so, take note of the name of the partition or hard drive where you have installed the OS.
- The brand and model of your WiFi
- The brand and model of your ethernet
- The nomenclature of your WiFi (how Linux calls upon it; usually wlan0, but it might vary)
- The brand and model of your graphics card
- The brand and model of your PCU (processor)
- How much memory (RAM) your computer has
- The brand and model of your Bluetooth adaptor
- The brand and model of your touchpad (if any)
- The brand and model of your printer (if any)
Finding Your Computer Specs Using the Linux Command Line
Using the Terminal, as opposed to GUI tools, is often referred to as the “Linux way” of doing things. As the command line is universally available across all Linux distributions, providing Terminal instructions is often the easiest way of offering a solution that works for everyone. By contrast, software apps will vary according to the widget toolkit underlying the desktop environment of your OS.
Note that whenever a command starts with “#,” it means that it requires root privileges. To execute such commands, begin with “sudo” followed by the regular command (you will be prompted to enter your password upon pressing Enter). Alternatively, execute a standalone command first by typing “su” (followed by your password after pressing Enter). Your next commands will all be from root. As for commands that begin with “$,” they can be executed from regular users.
An All-Purpose Command to Get Your General Linux Hardware Info
Open the Terminal, then type:
$ sudo lshw -short
An excellent all-purpose command, “lshw” provides all the essential Linux hardware information you may need.
Be aware that not adding “-short” after the main “lshw” command can result in a pretty lengthy output. If you omit the “sudo” command, you might get a warning saying that some information might be missing if you are executing lshw as a non-root user. Ideally, it would be best if you ran lshw as root by typing “sudo” first and entering your password to get the output as a superuser.
You can find the information we are looking for next to the following classes:
- System (be aware that if you are using VirtualBox, the output will only be “VirtualBox.” See below)
- Memory (be aware that if you are using VirtualBox, the output will not reflect your actual RAM capacity. The output will be limited by the maximum RAM allocated to the virtual machine.)
- Storage (be aware that if you are using VirtualBox, the output will not reflect your actual hard drive characteristics. Instead, it will show the size allocated to the virtual machine.)
- Network (in this example, the ethernet port)
- bus (for the USB port)
- Disk (note the presence of both “disk” and “volume,” the latter being the primary partition (sda1) of the first – and main – hard drive (sda)).
NOTA: If you are using VirtualBox, you will not see your system’s architecture. Instead, you will only find that the Terminal mentions “VirtualBox.” You will not get your real memory or storage information either. Instead, the specs will reflect the amount of storage and memory you decided to attribute to the virtual machine. You can still find the architecture and memory information from the virtual machine session by executing commands found below. Note, however, that you can only fetch the real hard disk size and availability of your machine from within your primary operating system.
Quickly Know Your System’s Architecture with This Terminal Command
To get the architecture of your machine, enter the following command:
In the example above, the command gives x86_64 (aka 64-bit) as the output.
To get the memory information of your machine, enter the following:
$ free -m
It will not only give you the total memory available but also what amount of it is currently being used or free. The data we are looking for is the one found next to “Mem:” under “total.”
As for how to get your storage information using the Terminal, enter:
Getting Details Regarding Your Machine’s Drives
To fetch more disc info, execute the following command:
$ df -H
You will find a table containing several items, most of which titled “tmpfs.” The filesystem that interests us, however, is the one that looks like /dev/sda1. To its right, you will find the size of the drive, its used amount, its available amount, and its equivalence in percentage. If you own several internal hard drives, or if you have partitioned them, your results might vary (you might get several /dev/sd[?] results, like /dev/sda2, /dev/sdb1, etc.). Take note of the hard drive that is relevant to what you wish to accomplish. If for instance, you want to install Debian on your unpartitioned, primary internal hard drive, then take note of the size of your “sda1” filesystem.
Note here the difference between the results fetched using VirtualBox (in this case, a virtual machine running Debian) and the output from my primary operating system (macOS Mojave). As you can see, only the latter can provide the real numbers. The former will only show the specs attributed when setting up the virtual machine. The storage information it displays will thus reflect these restrictions.
The same command ($ df -h) is also used to find the name attributed to your USB drive(s). A great way of identifying external flash drives is by looking at the size of the device; the filesystem name also gives a clue. Usually, pen drives are classified either as /dev/sdb or /dev/sdc.
Getting Additional Linux Hardware Info – Peripherals
To get your WiFi information from the Linux Terminal, enter one of the following commands from root:
lspci | grep -i wlan
lspci | grep -i wireless
lspci | grep -i wifi
lspci -nn | grep Network
To find your VGA (graphics card) information from the Linux command line, enter the following from root:
lspci -vnn | grep VGA
As for how to find peripherals info for the touchpad, power button, speaker, and more enter the following:
A list of devices should appear, one of them containing the word “touchpad.” In the example below, as I am using VirtualBox, the virtually rendered version of a touchpad is indicated instead (its identifier will often be “VirtualBox mouse integration”).
Do you know other useful Linux hardware command lines? Share them in the comment section below!