In this exercise, you will determine and configure hardware settings in a Linux system. Please note that some of the legacy devices may not automatically be detected by the operating system and therefore, you will need to manually configure them in the system BIOS.
Please refer to your course material or use your favourite search engine to research for more information about this topic.
Task 2 – Determining Existing Hardware Resources
When configuring new hardware devices for your Linux system, you may want to find the existing hardware resources being used by the existing devices. To obtain this information, you explore three files – interrupts, dma, and iports – under the /proc file system.
In this task, you will determine the existing hardware resources on a system.
Step 1
cat /proc/interrupts
This command displays the contents of the interrupts, dma, and iports files. This file lists the following:
- Number of interrupts per CPU per I/O device
- The IRQ number
- Number of that interrupt handled by each CPU core
- the interrupt type
- a comma-delimited list of drivers that are registered to receive that interrupt
Step 2
cat /proc/dma
This displays the contents of the dma file. This file contains the list of registered ISA DMA channels in use
Step 3
cat /proc/ioports
Note the output of this command. The output contains the list of currently registered port regions used for input or output communication with a specific device.
Task 3 – Differentiating Among Various Types of Mass Storage Devices
To differentiate among mass storage devices, you can explore the partitions on the system, list the devices by ID, identify the mounted devices, and identify the CD-ROM(s) on the system.
In this task, you will differentiate between various types of mass storage devices on a system.
Step 1
cat /proc/partitions
The output of the command displays all the partitions configured on the hard disk of the system.

Step 2
To explore the detailed parameters of the listed partitions, enter the following command:
lsblk
The output of the command here displays various parameters, including the maj:min ratio, speed, size, RO, type, and mount point of the system.

Step 3
You can also list the devices by their ids. Enter the following command:
file /dev/disk/by-id/*
You can replace the “*” in the command with the disk ID you want to list.

Step 4
To list the mounted drives on the system, along with the disks on the system, enter the following command:
df -h
Notice from the output of the command that some tmpfs drives are listed in addition to the partitions listed earlier. These are the mounted drives on the system.

Step 5
The commands so far displayed consolidated output.
You can also view the specific type of storage by using different commands. For example, to view the SATA and IDE spinning disks and solid-state disks (SSDs), enter the following command:
ls -l /dev/sd?*

Step 6
You can also execute the following command:
cat /proc/scsi/scsi
Notice that the output of the command displays the scsi drives on the system.

Step 7
To view the connected CD-ROM, enter the following command:
ls -l /dev/sr?*
Notice that the device listed is the root CD-ROM on the system.

Task 4 – Exploring Tools and Utilities to Manage USB Devices
The USB, short for Universal Serial Bus, standard specifies various parameters for hardware as well as software used for connecting computers and their peripheral devices, including power supplies. The efficacy and broad-range applicability of the standard has made it universally available on various electronic devices – both mobile and conventional ones.
In this task, you will use the tools and utilities to manipulate USB devices.
Note: The virtual environment does not have any USB devices configured. Therefore, you will only be able to execute the command but not receive any output.
Step 1
To list the connected USB devices, enter the following command:
lsusb
Note: An error is generated as there are no USB devices connected.

Step 2
You can also list the USB devices by entering the following command:
usb-devices


Task 5 – Exploring Tools and Utilities to List Various Hardware Information
In this task, you will use the tools and utilities to list various hardware information.
Step 1
To print the contents of the /proc/modules file, enter the following command:
lsmod | more
Note: The more parameter in the command above adds a line break. You will need to press Enter every time you want to display the next line.

Step 2
Continue to press Enter till you reach the end of the display.
At the end of the command output, you should see the command prompt.

tep 3
To list the devices on PCI bus, enter the following command:
lspci

Step 4
To list PC bus devices, enter the following command:
lspcmcia
Note: There is no output to the command as there are no PC bus devices configured on the system.
Step 5
To list the CPU and its configuration, enter the following command:
lscpu
Note: The output displays various parameters of the system cpu.

Step 6
To list the block devices, enter the following command:
lsblk
Note: The output displays the various block devices configured on the system.
Step 7
You can also view information about a specific module, add or remove a module or check for dependencies.
To manage a module, enter the following command:
modprobe -D fuse
Note: The -D parameter shows the dependency. Fuse is the name of a module on the system.
