Troubleshooting Linux Applications and Hardware

Share This Post:

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Troubleshooting Linux Applications and Hardware

Troubleshooting Linux applications and hardware issues is your next step as a Linux administrator if your system has an issue and you’ve worked your way through potential network, process, user and device problems. 

Troubleshooting Storage Problems on Linux Systems

When troubleshooting Linux applications and hardware issues, you will encounter storage problems that range from the mundane all the way to the needle in the haystack sort of thing. Read on as Secur dives into some of these issues.

Common Storage Issues

The best place to start when troubleshooting storage issues on a Linuxs system is with the common source of storage problems.

Degraded Storage/Mode:  Storage gradually decays due to time or improper use, which causes data degeneration or loss.   Solid state drives have a finite number of program/erase (PE) cycles, so using and SSD in your swap space is unwise.

A degraded mode is when one or more disks in a RAID array fail, so you need to use the “mdadm -D” command to view a particular array’s detailed status in order to troubleshoot the issue. If the state contains is “degraded”, add another partition to the array so it can recover.
Missing Devices: From time to time, storage devices disappear on Linux, but the cause varies.

  • Check your network to troubleshoot issues with network attached storage issues.  
  • If the device is locally attached, use the “lspci -M” command to scan of all PCI attached devices.
  • If the particular partition’s device file is corrupted (for example “/dev/sdb“),  rebuild it via the “mknod” command.
  • Check that the utility configuration uses the correct device file name.  Remember that:
    • The whole disk is referred to by the device file name with no numbers, such as “/dev/sdb“.
    • A disk partition is specified by the device file name and its number, like “/dev/sdc2“.

Missing Volumes:  When you perform a “pvscan” on the physical devices that make up a logical volume and get a “Couldn’t find device” message, you’ve discovered a missing volume, which is usually cause by a failed/removed disk.

  • The UUID of the missing disk’s  displays in the pvscan message.   Using logical volume manager tools. You can:
    • Replace the failed volume with pvcreate
    • Restore the group’s metadata with vgcfgrestore
    • Recover the group with vgscan
    • Activate it  with vgchange

Missing Mount Points: The “Mount point does not exist” error message means the directory on which you are attempting to mount the filesystem does not exist can  be generated by both an obvious or  not-so-obvious problem.

  • Obvious problem: The mount point was either was deleted or never created in the first place, so simply make it via the mkdir command.
  • Less obvious problem:   You’ve moved a filesystem with the bind option to a new mount point. If it is not already mounted somewhere, you’ll get a “Mount point does not exist” error message.  So remember that before removing a directory, check if it is a mount point with the “mountpoint ” command.

Storage Integrity: A bad block  is a part of a disk drive that doesn’t  respond to I/O requests due to corruption or physical damage.

  • A random bad block does not indicate a drive is failing but you should consider monitoring with the:
    • fsck command 
    • The “badblocks” utility it focuses on a particular parti- tion and does not perform any repairs.
      • Back up and unmount a partition prior to checking for bad sectors.
      • Run the “badblocks -nsv partition-device-file” command which is a non-destructive test that provides progress as it runs, and when the tests are complete, it issues a final bad blocks status.
      • A disk’s manufacturer often provides its own set of testing programs. Typically these programs let you know whether or not to replace the drive but do not provide detailed data on bad sectors.
    • The “dmesg” command displays the kernel ring buffer, which may have messages related to disk I/O errors which indicate potential problems.

Performance Issues: Poor storage performance adversely affects applications. In addition to using disk management utilities to monitor storage performance problems, also consider using:

  • The “hdparm” command to determine a drive’s read speeds and is useful for PATA or SATA drives and SCSI drives that have SCSI/ATA command translation.
  • The “dstat” utility provides data,  like throughput stats for network use or per individual LV drives, for troubleshooting storage performance problems.
  • The “dmstats” utility works with logical volumes and allows the setup and management of statistics for any devices charted by the device mapper.
    • Determine device mapper file names associated with logical volumes with the “lsblk -p” utility.
  • The “gnome-disks” utility is a GUI tool that gauges disk performance; back up any of the disk’s data prior to performing a write benchmark.

Resource Exhaustion: a system’s finite resources are committed and unavailable to others. Running out of inode numbers or disk space (covered in Chapter 20) are two examples.  This can be used as an  attack via file descriptor leaks (file descriptor are used in programming languages to access a file, pipe, or network socket)

  • Prevent this attack type by setting the PAM nofile limit with in the “/etc/security/limits.conf” file. 

Dealing with Difficult Storage Issues

When dealing with older storage devices, the first things you should check for is whether or not the device’s manufacturer has a new driver or firmware available.  The next thing to explore is the device’s Linux module (driver) as if it is not loaded or built into the Linux kernel, your device will not function.  The screenshot below works through this process:

  • Start with the dmesg utility to gain some clues and search (grep) its output for the drive in question to find information concerning the sda disk (/dev/sda). The important clue here is that the disk is an attached SCSI disk.
  • The available SCSI disk driver information is stored within a /sys/ directory.
    • Both the sd and sr drivers are used for SCSI devices.
    • The udevadm command confirms which driver is employed for the /dev/sde disk.
  • After the driver is confirmed, use the “lsmod” command to see if it is currently loaded into the kernel.

     

Troubleshooting complex link issues in Linux
Determining if a disk driver is properly installed during the troubleshooting process.

If the module is not loaded, it may be built into the kernel. You can check this by look- ing at the modules.builtin file wit the following command

  cat /lib/modules/$(uname -r)/modules.builtin | grep sd_mod

If the module is neither loaded nor built into the kernel,  load it as a super user with the “modprobe” command.

Seeking SATA Devices

An adapter may have one or more software interfaces which can have unique problems.  For example, on Linux, SATA drives, denoted by “/dev/sd*” device files are self-configuring and typically connected to the SCSI bus.  Additionally, some SATA devices fail earlier than others due to frequent head loads and unloads associated with aggressive power management.

If the SATA drives uses self-monitoring analysis and reporting technology (SMART), use the “smartctl -a” command to check for this problem

  • Look at the Start_Stop_Count, which is the number of loads and unloads.
  • For a given disk, a high count compared to other drives is indicative of this problem.
    • Double-check it via the “hdparm -B” command on the drive.
      • If the command returns a low number, such as 1, then aggressive power management is confirmed.
      • Modify the aggressive power management this  using super user privileges and typing in the following command:

hdparm -B 127 <device-filename>

This remove the aggressive power management, improves performance and extends the drive’s life.

Comprehending the SCSI Framework

On the Linux, SCSI framework , there are three main components:

  • Upper: The device driver (for example, disk driver) layer
    • Closest to the application or user command
  • Middle: The SCSI routing layer
  • Lower: The host bus adapter (HBA) driver layer
    • Next to the actual hardware
    • Is either a circuit board or an integrated circuit adapter, which connects to the disk drive.
    • HBA driver is either loaded or built into the kernel.

 

Problems can occur if either the HBA or device driver is not loaded or built into the kernel.  In the screenshot below you can see:

  • How to look for the HBA driver (module).
  • Checking whether or not it is loaded or built in.
    • The HBA driver is the advance host controller interface (ACHI) driver, and it is loaded into the kernel.
      • This driver allows you to hot-plug SATA drives, which are then treated as SCSI devices (SATA drives are attached to the SCSI framework).
determining if a Linux module name and see if its loaded

After attaching a SATA drive as a hot-plugable SCSI device, enable it by either rebooting the system or modifying the “/sys/class/scsi_host/ host<drive’s SCSI host number>/scan” file.   The screenshot below shows the use of the “lsblk -S” command to shows attached SCSI framework devices, and the SATA drive is sda (/dev/sda). The HTCL column in the output shows the device’s host number (first number prior to the first colon), which in this case is 2. 

After the disk’s host number is determined, the characters ‘- – -‘ are echoed into the appropriate file (note the required spaces between each dash) with the following command:

echo “- – -” > /sys/class/scsi_host/ host2/scan

This action forces the system to scan the device attached to the SCSI framework at that host number, which enables the drive.

Finding SCSI devices with lsblk command
Finding SCSI devices with "lsblk - S" command

Moderating RAID

Linux systems can employ both software and hardware RAIDs.

  • Software RAID arrays are implemented through the Multiple Devices (md) driver.
    • Check the status of your software RAID array by viewing the /proc/mdstat file.
    • A software RAID array can hang if it is SATA based and a drive goes offline,.
    • Occurs if the HBA does not handle hot-plug action.
    • Check if your lower SCSI framework layer’s driver supports hot-plugging. 
      • If your HBA uses the AHCI module (driver), hot-plugging is allowed.
  • Hardware-based RAID arrays are managed via a hardware device connected to the Linux SCSI framework.
    • Use the command “lspci -knn | grep ‘RAID bus controller‘ to see a hardware RAID controller’s data, such as the manufacturer and model number,
    • This is useful to obtain manufacturer utilities to troubleshoot/monitor a hardware-based RAID array.
  •  

How to Fix Permissions Issues in Linux?

As an administrator, one of the issues you run in troubleshooting Linux applications and hardware issues is that users will notify you that when they attempt to run an application, they get an I/O error.

In this situation, you need to determine if the problem is a permission issue, so start troubleshooting by gathering some information:

  1. Determine which account runs the application and the account’s name.
  2. Discover the specific program action that raised the error.
  3. Obtain a full directory reference for any files on which the application was attempting to perform reads/writes or for any files it was attempting to create.
  4. Record, if applicable, any additional applications it was trying to launch.
  5. Document, if applicable, any local or remote services the application is attempting to employ, such as NTP or a file server
    • If the application uses services, such as OpenSSH and/or an authentication server, it is important to know what service accounts are involved. Record this information as well.

The next step involves looking at 4 file properties of the application in question:

  • Ownership: Look at the  application files involved with the “ls -l” command in order to determine which username owns the files and the permissions granted to those owners.
    • Look at the directory permissions as well; you need to know the entire directory tree’s owners and permissions.
    • If the application is not run under a username that owns the file or the directory tree, go on to group memberships and possibly other permissions.
  • Group Memberships Determine the groups to which the end user running the application belongs.
    • Also, if the application is run under a different account, check that account’s group memberships.
      • Check the application files/directory tree involved for the group permissions of those files as well to uncover any potential problems.
  • Executables: If the application cannot be run by a particular account, check the execute privileges.
    • Keep in mind that if the application triggers additional programs, check the privileges for those programs.
    • If there is a script that changes the present working directory and it fails, check the directory tree it is trying to access. and make sure that the execute privilege is granted on all the directories within the tree in order for an account to change its present working directory to that particular location.
  • Inheritance: If the application is creating files in a particular directory and it can’t  access those files, check for forced inheritance via ACLs as if the directory has a default ACL, files created within that directory that do not have ACLs set specifically for them will inherit their ACL from the directory.
    • View default directory ACLs via the “getfacl -d” command.
    • If you find that a directory’s default ACL is behind the problem, consider:
      • Removing the default ACL and defining the needed ACL on the directory.
      • Explicitly set the application file’s ACL with the “setfacl” utility to override the inherited directory default ACL. 

Analyzing Linux Application Dependencies

When using package management commands, such as “apt-cache depends” and “yum deplist” to display a repository-managed application’s dependencies, you can run into a range of problems with programs and their dependencies.

Troubleshooting Linux Application Versioning Issues

Most application, software programs and operating systems are continously updated to improve performance or add additional functionality.  Versioning, the management of multiple application software updates through a numbering process, to keep track of the  application updates, a technique called is employed.  As you might expect, different versions of an application have different numbers, which typically increase for newer application updates.

  • When troubleshooting software issues, use versioning to determine if application updates or patches have been released. 

Troubleshooting Problems with Application Updates

Check for a new software update for an application is experiencing problems.  Remember, that if the application is available through a repository, use the relevant package management tool to check for a new version. 

As part of your professional workflow:

  • Set up a test system with the application environment and apply application updates to it. This lets you conduct thorough tests prior to updating production applications.
  • Ensure that you have an excellent backup before applying any production application updates.

If an application begins experiencing problems after a recent update, review the distro’s package management history information.

RPM system: View the latest update history for the package-name package use the command:

rpm -q package-name –last

Debian system: Check the “/var/log/apt/history.log” file and uninstall any installed packages or libraries causing the problem.  On modern Ubuntu distro versions, unattended upgrades are configured to automatic security upgrades to software and requires no human intervention.

  • Turn this off by change the APT::Periodic::Update- Package-Lists directive in the “/etc/apt/apt.conf.d/10periodic” file from 1 to 0.
  • Dependency occur when one software package depends upon another package or library to operate properly.
    • A broken/unmet dependency occurs when a software package has been installed but one or more of its needed packages or libraries are not installed.
      • A broken package occurs when package upgrade  break dependencies.
      • To check for broken dependencies, on a Debian package management system, use the “apt-get check” command.
        • The YUM package manager will not update programs that cause a broken dependency, but if you installed a program using the rpm utility that caused problems, use the “rpm -aV” command on any Red Hat package managed system to see damaged software packages.

Patching Linux Software Application

A patch is an update for a particular application or system services that may correct serious problems or fix security vulnerabilities and are often issued out of the normal software update cycle. Patching is the act of applying a patch does not necessarily involve updating all your system’s software. 

A kernel patch release is a special source code package that only contains the changes applied to the major kernel source code release that you apply as follows: 

  • Download the patch source code package
  • Use the Linux patch command to apply the patch updates to the existing kernel source code files.
  • Recompile the kernel. 
    • Typically the package manager handles this for you when you update packages.

Troubleshooting Linux Application Libraries

Multiple applications that make use of the same functions can share library files.  If an application experiences problems after a software upgrade, it may be caused by a shared library that was recently upgraded.    Do this with the by checking which libraries a program uses with the following command:

ldd “program-name” > sharedlibraries.txt

Piping the  output into another file makes it easier view the files. 

As a seen in the screenshot below, the next step is search the package management log files using “grep” to determine if one of the application’s libraries was recently updated.  Using the OpenSSH command as an  Notice one of its libraries was recently upgraded. (The -B and -A options on the grep command allow you to pull addi- tional lines below and above the found content.) If it began experiencing problems shortly after this library upgrade, you have a probable cause. Check to see if a new upgrade or patch is available for this library. If not, you may have to uninstall it and install an earlier version.

Troubleshooting Linux Environment Variable Problems

When having trouble executing a newly installed application, inspect the PATH environment variable, which is what determines the directories searched when Bash shell executes a program it does not directly handle. The screenshot below displaying the PATH variable’s contents.

displaying the PATH variable
Using the echo command to view the PATH variable.

Modify the PATH variable for everyone:  Create a Bash script file in the “/etc/profile.d/” directory.

  • Use the .sh file extension.
  • The file must be owned by root and belong to the root group.
  • Set the file’s other (world) permissions to “r” so all users can read it.
  • When a user logs into the system or starts a new shell, the script is read by the “/etc/profile” or “/etc/bashrc” file.

Modify the PATH variable for individual users: make the modification in the users  “~/.profile“, “~/.bash_profile“, or “~./bash_login” environment files. 

Fixing GCC Issues

If you have problems compiling a Linux application with GCC, the GNU Compiler Collection (GCC),  the most common tool used for compiling Linux programs, there are several potential causes, including:

  • GCC uses the system C library, which might not be compliant with the ISO C standard. 
  • There are several notable incompatibilities between GNU C and non-ISO versions of C. 
  • GCC uses corrected versions of system header files, which can cause issues.
  • Using an older version of GCC and need to update it. 

Fixing Linux Repository Problems

When you get an error messaged regarding a package not being found/updated/installed, make sure your computer is connected to the network (First things first you know)

The next thing to investigate is if there was corruption of the  package repositories.

Debian package manager (Ubuntu): To see a list of the enabled repositories on your system, use the ‘grep -v “#” /etc/apt/ sources.list‘ command to see the enabled repositories.

  • If you are attempting to install or update packages from a non-standard repository, you may need to enable that repo on your system.
  • If you get a message saying it cannot download repository information or something similar, use the “apt-get clean” command to clean up the database and any temporary download files.
    • Then use “apt-get update” to update the local repository by retrieving updated information about packages in the repository.
  • Also consider using the “apt-get dist-upgrade” command instead of “apt-get upgrade” to update all the system’s packages.
    • The “dist-upgrade” prevents any software from being upgraded that will break a dependent package.

Red Hat package manager: Use either the “yum clean all” or “zypper clean -a” command.

    • Next,  use the “yum check-update” or “zypper refresh” command to update the local repository.
  • If you are attempting to install or update packages from a non-standard repository, you may need to enable that repo on your system.
  • Use the “yum repolist” or “zypper repos” command to see a list of the enabled repositories on your system, 

Before adding additional non-standard repositories, back up the repository file(s), such as these:

  • /etc/apt/sources.list
    • You have to manually edit the sources.list file to add and enable a new repository.
  • /etc/yum.repos.d/*.*
    •  To add and enable a new repo with YUM, use the “yum-config-manager –add-repo <repository-url>” command
  • /etc/zypp/repos.d/*.*
    • The zypper command requires a repository name alias—”zypper addrepo <repository-url> <alias>“.

Debugging SELinux Context Violations

Linux kernel security module, such as SELinux, can cause application issues on your system.  If you seeing a large number of SELinux context violations in your log or journal files and have not had application problems in the past, consider the possibility that your system has an intruder so run  an intrusion detection tool to confirm.

  • A violation of an incorrect policy configuration can prevent applications from serving their purpose.
    • Check the audit log file using the “sealert” command first. If this tool is not available, you can install it via the setroubleshoot package.
  • A mislabeled file can cause problems, such as access being denied to applications.
    • Use the “ls -Z” command to view a file’s SELinux context.
      • If it or its parent directory needs to have their context changed,
        • Use the “chcon” utility to modify it,
        • Use the “semanage” command to make it permanent,
        • Use the “restorecon” to fix the labels.
        • Don’t forget to employ all three of those commands or you won’t resolve the problem.
  • You can change the mode for SELinux temporarily from enforcing to permissive via the “setenforce permissive” command with super user privileges, allowing you to make context changes and see if it triggers any violations without actually blocking access.
  • Once you’ve got the correct SELinux policies in place, put it back into enforcing mode via the “setenforce enforcing” command.
  • An application that is confined by SELinux needs the proper Booleans set to allow appropriate access; using the “getsebool” command allow you to review the application’s Booleans.  Change them if needed with the “setsebool” command.

Fixing Linux Firewall Misconfiguration

When applications experience problems over a network and the network is functioning properly,  the next step is checking the local/remote systems’ firewalls. Application/firewall updates and modifications can trigger this problem.   The next few items discuss how you can explore these issues.

Unrestricting ACLs

When troubleshooting an application issue related to a firewall, you’ll need to gather the control information that an ACL uses to review application packets traveling back and forth including :

  • Source address or hostname
  • Destination address or hostname
  • Network protocol(s) used
  • Inbound port(s) used
  • Outbound port(s) used

Additionally, you need to know both your source and destination systems’ firewall application in use.

Once gathered, review this information and the firewall settings on both sides to determine if the ACLs are overly restrictive.  To start, view the default zone on your system with the “firewall-cmd” command as seen in the screen shot below.  Notice that the default setting is public; if the system had its firewalld default set to th “drop” all incoming network packets are dropped and only outbound network connections are allowed. If the application receives data or connections from other systems, then this firewall ACL setting is overly restrictive.

Viewing default firewall zone in order to troubleshoot issues
Viewing the default zone with the firewall-cmd command.

Unblocking Service Ports

If an application relies on another system service/daemon, you need to examine the rules that relate to that particular service port and obviously, blocking a port needed by the external service would impact that particular application.  As an example:

  • If a system provides a public web services, it needs to allow incoming/outbound packets associated with the HTTPS protocol port 443. 
  • If the system uses iptables firewall software,  view the current ACL rules via the “iptables -L” command.
    • If the packet filter is blocking port 443 via a particular rule or policy,  modify the chain and opens up port 443.
  • If your application is designed to use a port that is not dedicated to a well-known service, check it as well.
  • You also need to modify the OUTPUT chain rules to allow your web server to establish connections.
  • In addition, if your application allows HTTP traffic, you must modify rules for port 80 as well.

Unblocking Networking Protocols

As we’ve discussed previously, in addition to ports, there are various protocols, such as UDP, TCP, and ICMP, that networked application employ. If it uses another system service, you must know the protocols it uses as well, which you can find out via the “/etc/services” as demonstrated in the screenshot below.

Checking protocols in etc services file
Using grep to check HTTP protocols in the etc/services file.

For example, an application is working with a HTTP server, which runs the TCP protocol on port 80. Check the /etc/services (well-known ports) file to find the transport protocols it employs.  In this situation , make sure to unblock port  80 on the HTTP server system for TCP for both inbound and outbound packets.

Additional Hardware Troubleshooting Issues Tips

Helpful Linux Hardware Utilities

How to Use The dmidecode Utility

As a preface to learning about the “dmidecode” command, we are going to dive into the Distributed Management Task Force (DMTF), a nonprofit organization with goal of  simplifying the management of network-accessible technologies, like servers, through standards in order to make system administration easier.  They created two standards that interact with each other and are widely adopted by hardware manufacturers.:

Desktop Management Interface (DMI):   Consists of four components that provide information about the hardware being used on a computer as well as some additional helpful data.

System Management BIOS (SMBIOS):   Consists of data structures used to read management information produced by a computer’s BIOS. 

Using these standards require two things:

  • A DMI/SMBIOS compliant computer and
  • A software interface to their data structures. The software interface on a Linux system is the “dmidecode” utility.

The “dmidecode” utility pulls  information,  from the “sysfs” filesystem,  from the tables in the “/sys/firmware/dmi/tables/” directory.   

If you are using a virtualized Linux system, the information from the dmidecode” utility is suspect. Also, do not rely on this utility alone for hardware information. Its man page even states, “More often than not, information contained in the DMI tables is inaccurate, incomplete, or simply wrong.”

The screenshot below show how to check if these tables exist on the system.

Checking for tables in the sysfs filesystem
Checking for tables in the sysfs filesystem.

The “dmidecode” utility’s help option describes the various options you can use to uncover information in your hardware troubleshooting process. 

dmidecode help
Viewing dmidecode help with the "dmidecode -h" command.

The most useful for troubleshooting is the “-t” or “–type“, switch which allows you to pull specified information from the DMI/SMBIOS tables via providing an argument, which is either a number or a keyword. The keyword argument can be one of the following:

  • baseboard 
  • bios 
  • cache 
  • chassis connector 
  • memory 
  • processor 
  • slot 
  • system

If the tables do not contain the needed information, you will only receive a message about where the utility attempted to extract data and possibly DMI and/or SMBIOS standard versions supported. The screenshot below show two examples of the use of the command; notice that there is no memory information available in the memory table, but system table data is displayed.

dmidecode table information
Inspecting data for the memory and system tables.

Working with the lshw Utility

As you should know by now, hardware information is stored in various /proc/ directory files and can be gathered with the “lshw” utility.  It is installed by default on most distributions or available in a standard repository and provides data on your system’s processor(s), memory, NIC(s), USB controller(s), disk(s), and so on.   Two helpful options are “-short“, which produces a nice table-formatted hardware data display, and “-businfo“, which shows information associated with SCSI, USB, IDE, and PCI devices. An example of using the -short option is shown in the screenshot below.

Using the lshw command to view hardware.
Viewing hardware with the lshw command.

To find detailed information concerning a particular hardware component use the “-class” options with the “lshw” utility. The different classes available are displayed in the lshw -short command’s output, an example of which can be seen below.

Using the -class option with the lshw command
Using the -class option with the lshw command to show hardware information.

Investigating Other Hardware Problems

Memory: Diagnosing physical problems with RAM are tricky to diagnose. Some symptoms of this issue include:

  • A system’s performance slows over time.
  • The system appears to hang when a memory-intensive application is running or at boot, kernel panics or segmentation faults occur intermittently.
  • Files are sporadically corrupted.
  • Program installations fail.

Step 1: As a first step, make sure this issue is not a memory capacity issue; use the “free” and “vmstat” utilities.

Determine hardware information concerning your RAM with the “lshw -class memory” command.

Step 2: If you recently added new memory, most likely you obtained a faulty component. Damage can also be done to RAM via power spikes or outages. I

Step 3:  Conduct a test on the memory via a system reboot and using the “memtest” or “memtest86+” option in the server’s boot menu.  Alternatively, if this option is not available, use the “memtester” utility (typically not installed by default).  When using this utility,  shut down any production applications and test the memory in chunks.

Printers: External hardware devices are typically plug and play for Linux, but problems do arise, typically either an outdated/incorrect driver (PPD) or a bad connection.

  • Start by checking the kernel ring buffer with dmesg and taking a look at the printer error log files (“/var/log/cups/ error_log“).
  • Check the printer configuration.
    • You can do this via a web browser, if available, on the system by entering 127.0.0.1:631 in the address bar.
    • If your system does not have a GUI, you can look through the /etc/cups/printers.conf file to review the printer’s configuration.
  • Determine how the printer connects to the system.
    • Is it a network printer?
      • First check that the network is operational.
    • Does it attach via a USB cable?
      • If the printer is attached via a USB cable, start with troubleshooting the USB connections
    • Is the printer directly connected into a parallel port?
      • it may be a bad adapter. If possible, consider switch- ing it to a different connection type, such as USB
  • Check if the printer’s PostScript Printer Definition (PPD) file or driver needs updating.
    • Go to the manufacturer or open-source driver website to determine if an update is available.
    • View all the currently available printer drivers on your system via the “lpinfo -m” command.
      • The problem may involve a needed printer firmware update.

Video: Video hardware issues manifest as sluggish displays, audio lag, glitches on the screen, a black screen or  no audio output as well as system crashing/hanging

  • First check the kernel ring buffer with “dmesg” and video log files.
    • If your system is still use X11, check the journal file or the “/var/log/ Xorg.0.log” file.
    • If you are employing Wayland, check the journal file via the “journalctl” command.
  • A graphics processing unit (GPU) exists on either a graphics card or on a motherboard.
    • It is an assembly that performs some simple processing in order to relieve the CPU of such duties.
    • To find out what graphics card driver your system is using, use the  “lspci -vnn” and  redirect STDOUT to a file.
    • Search the file for the word VGA. to find your graphics card driver data.
    • You can also employ “lshw -class display” (or video) and look for the driver information there.
    • When you have the driver’s name, find out additional details through the “modinfo <driver-name>” command.
    • Check the manufacturer’s or open-source site to see if there is an updated graphics card driver available.
      • If not, try testing the card on another system to see if you need to replace it.

Communications Ports: A communications port is a serial communications port.

  • Often used to connect hardware such as point-of-sale devices.
  • Serial ports device files have the following syntax are /dev/ttyS#.
    Troubleshooting Steps: When experiencing problems with a serial communications device, follow these steps:
    • Run “dmesg | grep ttyS” this finds the device file name in use.
    • Then use that “setserial” utility to get detailed information on the serial device.
    • Using super user privileges, and run “setserial -a <device-file-name>” at the command line in order to find the interrupt request (IRQ) number.
      • When you have the IRQ of the serial device, check the interrupts file.
      • If you do not find the IRQ number in the “/proc/interrupts” file, the appropriate driver for the serial device is not loaded.
      • If the driver is loaded, check the manufacturer’s website for a newly updated driver.
      • Also, check the serial device’s recommended configuration and make any modifications needed via the “setserial” utility.

USB:  There are some simple troubleshooting techniques you can employ.

  • Use the  “lsmod | grep usb”  command to confirm the USB module (driver) is loaded into the kernel
    • If you get a response, it is loaded.
    • If you just get a prompt back, then employ the “modprobe command to load the module
    • If the driver is already loaded, detach the device’s USB cable from the system.
  • Monitor the journal file via the “journalctl -f”  or use the “tail -f” command on the appropriate log file (“/var/log/syslog” or “/var/log/rsyslog“).
  • After the watch is in place, plug back in the USB device’s cable and see what log messages are generated.
    • If the USB device is a printer, also check the “/var/log/cups/error_log” for any pertinent information. 
      When  completed run the “lsusb -v” command to see if the device is showing up on the USB bus.
      • If you see the device’s manufacturer/product information, then Linux can see the device.
      • If the lsusb utility is not installed, use “dmesg” to scan the kernel ring buffer.
  • Check the USB’s device files for corruption.
    • If the USB device still does not work, put another watch on the appropriate journal or log files and try attaching it to a different USB port. 
    • Consider switching the USB cable to see if that resolves the issue(s).

Keyboard Mapping: You know you have a keyboard mapping issue when you press a key on your keyboard and a different letter appears on the screen,  The fix depends on the particular distribution you are using. 

  • In order to figure out how to enter commands with a dysfunctional key board:
    • Write the commands down.
    • Then try the various keyboard keys until you find each key that corresponds with the desired key/symbol and record it.
    • Use the recorded keyboard keys to enter the commands. 
  • For Red Hat distros: Use the “localectl” command with no options to display your current key map.
    • To see the list of available key maps, enter “localectl list-keymaps”  to display the list of available key mappings; this list can be rather large, so you might want to redirect STDOUT to the less utility for your perusal.
    • When you find the appropriate key mapping name, permanently set with the  “localectl set-keymap <keymap-name>” at the command line.
  • For Debian-based distros: Run the “dpkg-reconfigure keyboard-configuration” command which enters you into a menu system where you can select the appropriate keyboard mapping.

Hardware or Software Compatibility Issues: Before you purchase any new hardware (or software for that matter), make sure it will work with your Linux distribution.

  • Drivers are often not available for brand-new devices, or you may end up with a manufacturer’s poorly written device driver.
  • Check with the Linux community to find well-developed drivers and hardware device recommendations. 

Share This Post:

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Leave a Reply

Your email address will not be published. Required fields are marked *

Table of Contents

You May Like

Related Posts

Linux logging
Linux Basics
Linux Administrator

Linux System Logs: How Do They Work

The various parts of the built in Linux logging system records almost all actions (especially errors and security alerts) that take place on your system and provides administrators with a great resource in analyzing system activities. Log files provide evidence of all system activity, including unauthorized access, so these files can provide evidence of hacker intrusions so you need to understand how to these files can be manipulated in order to obfuscate intrusions.

Read More »
Networking
Linux Administrator

How Do Computers Communicate ?

Given the pervasiveness of the Internet in our daily lives, understanding how computers communicate with one another is essential to improving your online security.  In

Read More »