Unit 6
Managing Devices and
networking
THE IMPORTANCE OF DEVICE
DRIVERS
Device drivers act as an interface between the operating system and
hardware devices. Drivers are crucial for devices to function properly,
or to even function at all within the Linux environment.
THIN CLIENTS
• A client device, typically referred to as a thin client, is any lightweight
computing device that connects to a more powerful server for doing
work. The server does most of the heavy lifting, including processing
and storing data, while the thin client acts as little more than a user
interface.
USB DEVICES
A wide range of USB device types are supported in Linux, including, but not
limited to:
• Thumb drives
• External HDDs and SSDs
• Digital cameras
• Smartphones and tablets
• Printers and scanners
• Keyboards and mice
• Microphones and webcams
• Game controllers
WIRELESS DEVICES
• Wi-Fi: A technology used primarily in establishing a wireless local area
connection (WLAN) in home and office environments.
• Bluetooth: A technology used primarily for establishing a personal
area network (PAN) in which devices communicate wirelessly within a
few feet of each other.
• Near Field Communication (NFC): A communications protocol used
by mobile devices and peripherals that are either touching or only
inches apart.
• A network adapter, also known as a network interface card (NIC), is a
device that provides an interface with which hosts exchange data over
a network.
• Serial AT Attachment (SATA) is a computer bus interface standard for
attaching storage devices to traditional computers. In modern PCs,
SATA has largely replaced earlier standards like Parallel ATA (PATA) and
Integrated Drive Electronics (IDE) as one of the dominant standards in
storage connection technology.
• Small Computer System Interface (SCSI) is a computer bus interface
for connecting peripheral devices to traditional computers.
• A host bus adapter (HBA) is a hardware component that connects a
host system to a storage device, like in a storage area network (SAN),
in order to facilitate the input and output of data.
• Peripheral Component Interconnect (PCI) is a connection interface
standard that is primarily used as an expansion bus for attaching
peripheral devices.
Which of the following wireless connection standards is
primarily used to create a local area network (LAN) for home
and office computing?
• NFC
• Bluetooth
• Wi-Fi
• RFID
Which of the following hardware interfaces carries audio and
video signals and is used to connect devices like monitors?
• USB
• HDMI
• Wi-Fi
• VGA
Configure Devices
DEVICE FILE LOCATIONS
Device files represent information about hardware devices, and in
some cases, define settings about those devices that you can
customize.
• A hotpluggable device can be physically added or removed from the
system without requiring a reboot in order to use that device.
• Modern Linux distributions support hotplugging for many standard
bus types, particular for USB, FireWire, SATA, and other related
technologies.
udev
• The device manager udev manages the automatic detection and
configuration of hardware devices. udev is an integral part of the
kernel that is initialized during boot time. The udev utility handles
module loading for both coldpluggable and hotpluggable devices.
• udev RULES
• The /etc/udev/rules.d/ directory is used to configure rules for how udev
functions.
THE udevadm COMMAND
• The udevadm command is used to manage udev. It takes various subcommands, each of
which performs a certain task to modify the behavior of the systemd-udevd daemon and
related components.
1. Info retrieve device information stored in the udev database or example,
you can view a device's vendor ID, product ID, serial number, and much more.
2. Control Modify the running state of udev. For example, providing the --
reload-rules option will ensure that udev is reading from any new rules files
you've added.
3. monitor Watch for events sent by the kernel or by a udev rule.
4. test Simulate a udev event running for a device, with results on output.
• SYNTAX
• The syntax of the udevadm command is udevadm [options] [subcommand]
[arguments]
PRINTING SOFTWARE
• Printers are typically bundled with software utilities that enable you
to configure settings for the printer. These utilities may target a
specific operating system, so you need to confirm whether or not they
were designed to run on Linux.
CUPS
• CUPS is a print management system for Linux that enables a computer to function as a print
server. A system running CUPS is a host that can initiate print jobs from client systems.
• CUPS is designed for scheduling print jobs, processing administrative commands, and providing
printer status information to local and remote programs. CUPS provides a web-based interface for
configuring the service.
• Changes made through this interface modify the /etc/cups/[Link] and /etc/cups/cups-
[Link] files.
THE lpr COMMAND
• The lpr command submits files for printing. Files supplied at the
command-line are sent to the specified printer or to the print queue if
the printer is busy.
• Without specifying the printer to use, the command will send the
print job to the default printer, which you can configure with CUPS.
• The lpr command reads the print file from standard input if no files
are supplied at the command-line.
• SYNTAX
• The syntax of the lpr command is lpr [options] [file names]
Monitor Devices
• THE lsdev COMMAND
• The lsdev command displays various information about a system's
hardware as reported by the kernel. It compiles this information from
three files in the /proc/directory:
• /proc/interrupts —This file lists each logical CPU core and its associated interrupt
requests (IRQ). An IRQ is a signal sent by a device to the processor so that the processor
can stop what it is doing and handle some task that the hardware needs to perform, like
pressing a keystroke or moving the mouse.
• /proc/ioports —This file lists I/O ports and the hardware devices that are mapped to
them.
THE lsusb COMMAND
• The lsusb command is used to display information about devices that are connected
to the system's USB buses. This command scans the /dev/bus/usb/ directory for
information.
• By default, the command will print the number of the bus and the connected
device, the ID of the device, and the name of the vendor and product matching that
device.
• You can use the -v flag to see detailed information about each device, similar to
using the udevadm info command. You can also filter results by bus (-s) and by
vendor/product (-d).
• SYNTAX
• The syntax of the lsusb command is lsusb [options]
THE lpq COMMAND
• The lpq command shows the status of the printer queue. By default, it
will report each print job's rank in the queue, who owns the job, the
job number, the files in the job, and the size of the job.
• SYNTAX
• The syntax of the lpq command is lpq [options]
Troubleshoot Hardware Issues
• COMMON HARDWARE ISSUES
• Problems can affect a wide array of different hardware devices. Missing or poorly
configured drivers are a common source of these problems, as is user space
software that is incompatible with certain hardware.
In general, hardware issues can be categorized as follows:
• Keyboard mapping issues.
• Communications port issues.
• Printer issues.
• Memory issues.
• Video issues.
• Storage adapter issues.
KEYBOARD MAPPING ISSUES
• Certain keyboard keys, when pressed, may produce an unexpected
character on the screen, or no character at all. This is the most
common and overt symptom of a keyboard mapping issue.
• To address the problem, make sure you can correctly identify the
layout of the physical keyboard—not just its overall design type (e.g.,
QWERTY vs. Dvorak), but its specific regional layout.
PRINTER ISSUES
Printers are a very common source of issues. In many cases, the printer
itself will be at fault:
• It may be out of ink or paper.
• There may be a paper jam.
• The mechanical components may be damaged or misaligned.
• And many more issues.
MEMORY ISSUES
• From a software perspective, memory can "leak" when a process fails
to free up allocated memory when it is no longer needed.
• In these cases, you can use memory monitoring tools like free as well as
process monitoring tools like top to identify the problem, then deal with the
offending process (e.g., by killing it).
VIDEO ISSUES
Common video-related issues include:
• Consistent or intermittent blank screens.
• Incorrectly displayed colors.
• Multiple monitors not being detected.
• Sluggish performance in video-intensive applications.
• And more.
STORAGE ADAPTER ISSUES
There are several possible indicators of a faulty bus adapter, including:
• Poor data transfer speeds.
• Less total space available than expected.
• Excessive read/write errors.
• Inability to read/write at all.
• The system cannot detect devices at all.
• And more.
THE lshw COMMAND
• The lshw command lists each detected hardware component on the system and
provides details about each device. The command pulls information from many
different files in multiple device file locations like /proc/ and outputs in a
hierarchical format.
• SYNTAX
• The syntax of the lshw command is lshw [options]
ABRT
• The Automatic Bug Reporting Tool (ABRT) is a utility, typically used on Fedora-
and RHEL-based distros, that analyzes and reports on problems detected during
system runtime. ABRT collects data like memory dumps from crashed
applications to help administrators diagnose and troubleshoot issues. It can also
report on problems with various devices, such as MCEs that typically indicate
hardware failure.