Rakesh Jain Profile picture
Jan 22, 2022 32 tweets 9 min read Read on X
Linux Diagnostics and Troubleshooting Series -

Thread 4 👇

IDENTIFYING HARDWARE ISSUES!

#Linux #diagnostics #troubleshooting #security PC: https://content.nexus.support.com/5b557b9559124044bb566b
Identifying hardware -
An important step in troubleshooting potential hw issues is knowing exactly which hw is present in a system. For virtual systems, this might seem less useful than for a physical system, but it can tell an admin if the correct virtual devices have been added
Identifying CPUs -

The CPU(s) in a running system can be identified with the lscpu command from the util-linux package.

# lscpu
Another useful piece of info is what flags a CPU supports. These flags indicate whether a CPU supports certain extended technologies, such as AES acceleration, hw-assisted virtualization, & many more. These flags can be inspected in /proc/cpuinfo.

# cat /proc/cpuinfo
Point to Note -
The fact that a CPU supports a certain flag doesn't always mean that the feature is available. For eg, the vmx flag on a Intel CPU indicates that d processor is capable of supporting hw virtualization, but d feature itself might be disabled in the system firmware.
Identifying memory -

The dmidecode tool can be used to retrieve info about physical memory banks, including the type, speed, and location of the bank. To retrieve this information, use the command

# dmidecode -t memory
Identifying disks -

To identify physical disks, an administrator can use the command lsscsi from the lsscsi package. This tool can list all physical SCSI (and USB, SATA, and SAS) drives attached to a system.

# apt-get install lsscsi
# lsscsi -v
For more information, the hdparm command from the hdparm package can be used on individual disks.

# hdparm -I /dev/sda
Identifying PCI hardware -

Attached PCI hardware can be identified with the lspci command. Adding one or more -v options will increase the verbosity.

# lspci
Identifying USB hardware -

USB hardware can be identified using the lsusb command. Just like with lspci, verbosity can be increased by adding -v options.

# lsusb
Hardware error reporting -

Modern systems can typically keep a watch on various hw failures, alerting an admin when a hw fault occurs. While some of these solutions r vendor-specific, and require a remote management card, others can be read from the OS in a standardized fashion.
There are two mechanisms for logging hardware faults, mcelog and rasdaemon.

mcelog -
mcelog provides a framework for catching, and logging machine check exceptions on x86 systems. On supported systems, it can also automatically mark bad areas of RAM so that they will not be used
To install and enable mcelog, follow the following procedure:

1. Install the mcelog package.
# apt-get install mcelog

or

# yum install mcelog

Note - On Ubuntu 18.04 onwards The mcelog package functionality has been replaced by rasdaemon.
2. Start and enable the mcelog.service service.

root@lco-linux-worker1:~# systemctl enable mcelog
root@lco-linux-worker1:~# systemctl start mcelog
From now on, hw errors caught by the mcelog daemon will show up in the system journal. Messages can be queried using the cmd journalctl -u mcelog.service. If the abrt daemon is installed and active, it will also trigger on various mcelog messages.
Alternatively, for administrators who do not wish to run a separate service, a cron is set up, but
commented out, in /etc/cron.hourly/mcelog.cron that will dump events into /var/log/mcelog.
rasdaemon -
A modern replacement for mcelog dat hooks into d kernel trace subsystem. It stands for Reliability, Availability, & Serviceability. It hooks into d Error Detection & Correction (EDAC) mechanism for DIMM modules & reports dem to user space & RAS msgs dat come from kts.
To enable rasdaemon, use the following steps:

1. Install the rasdaemon package.
# apt-get install rasdaemon

or

# yum install rasdaemon
2. Start and enable the rasdaemon.service service.

[root@lco-linux-worker1:~# systemctl enable rasdaemon

[root@lco-linux-worker1:~# systemctl start rasdaemon
Information about the various memory banks can be queried using the ras-mc-ctl tool.

Of special interest are ras-mc-ctl --status to show the current status, and ras-mc-ctl -- errors to view any logged errors
Memory testing -

When a physical memory error is suspected, an administrator might want to run an exhaustive
memory test. In these cases, the memtest86+ package can be installed. PC: https://windows-cdn.softpedia.com/screenshots/Memtest86_
Since memory testing on a live system is less than ideal, the memtest86+ package will install a
separate boot entry that runs memtest86+ instead of a regular Linux kernel.

The following steps outline how to enable this boot entry -
1. Install the memtest86+ package; this will install the memtest86+ application into /boot.

[root@lco-linux-worker1:~# yum install memtest86+

or

root@lco-linux-worker1:~# apt-get install memtest86+
2. Run the command memtest-setup. This will add a new template into /etc/grub.d/ to enable memtest86+.

# memtest-setup
There is another utility called memtester.

# apt install memtester
3. Update the grub2 boot loader configuration.

# grub2-mkconfig -o /boot/grub2/grub.cfg
Digging into multiple loggings -

Dmesg allows you to figure out errors and warnings in the kernel's latest messages. For example, here is output of the dmesg | more command:

# dmesg | more
You can also look at all Linux system logs in the /var/log/messages or syslog file, which is where you'll find errors related to specific issues. It's worthwhile to monitor d msgs via the tail cmd in real time when you make modifications to your hw.

# tail -f /var/log/messages
Analyzing networking functions -

You may have hundreds of thousands of cloud-native applications to serve business services in a complex networking environment; these may include virtualization, multiple cloud, and hybrid cloud. PC: https://s3.eu-west-3.amazonaws.com/dealna/uploads/2016/0
This means you should analyze whether networking connectivity is working correctly as part of your troubleshooting. Useful commands to figure out networking functions in the Linux server include ip addr, traceroute, nslookup, dig, and ping, among others.
Conclusion -
Troubleshooting Linux hw requires considerable knowledge, including how to use powerful command-line tools and figure out system loggings. You should also know how to diagnose the kernel space, which is where you can find the root cause of many hardware problems. PC: https://image.winudf.com/v2/image/Y29tLndHYWludGhla25vd2
Hope you like the thread. If yes, retweet it. You can follow me for more such content.

Thanks!

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Rakesh Jain

Rakesh Jain Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @devops_tech

Apr 29
🔍 AIOps vs. DevOps
Can AIOps Replace the Whole DevOps? 🔄

A thread🧵👇 Image
1/ 💡 Culture Matters:

DevOps isn't just about tools; it's about teamwork and making things better together. AIOps helps with some tasks, but it can't fix team dynamics.

Example: In DevOps, developers and IT folks work closely to solve problems faster.
2/ 💻 From Idea to Reality:

DevOps handles everything from planning to getting the software out there. AIOps helps with some steps, but it doesn't cover everything DevOps does.

Example: In DevOps, everyone works together to build and release software smoothly.
Read 9 tweets
Apr 24
🚨Interview Guide!

AWS☁️Networking Interview Questions & Answers👇

#AWS #Cloud #networking #interview #Guide
1/15 Q: What is the difference b/n an Internet Gateway (IGW) & a NAT Gateway in AWS networking?

A: An IGW allows communication b/n instances in a VPC & the internet, while a NAT Gateway enables outbound internet traffic from private subnets without exposing their IP addresses.
2/15 Q: Explain the concept of VPC peering in AWS.

A: VPC peering allows connecting two VPCs privately to share resources, like EC2 instances, without traversing the internet. It enables communication using private IP addresses across peered VPCs. #AWSNetworkingInterview
Read 25 tweets
Apr 22
🚨Kubernetes Interview Guide!

A thread with 15 interview questions & answers for new/intermediate administrators ⚓️👇
1/15: Question: What is a Kubernetes Pod, and why is it used?

Answer: A Pod is the smallest deployable unit in Kubernetes, representing one or more containers that share resources. It's used to deploy, manage, and scale containers.
2/15: Question: How does Kubernetes manage container networking?

Answer: Kubernetes uses the Container Network Interface (CNI) to manage container networking. CNI plugins allow for different network configurations and overlays, enabling communication between pods across nodes.
Read 19 tweets
Apr 20
🚨Linux Interview Guide!🚨

A thread with 15 advanced questions &answers 🐧👇 Image
1️⃣ Q: How do you optimize disk I/O performance in Linux?

A: Utilize techniques like RAID striping, I/O schedulers (e.g., deadline, noop), and file system optimizations (e.g., tuning journaling options).
2️⃣ Q: Explain the concept of kernel namespaces in Linux.

A: Kernel namespaces isolate and virtualize system resources, enabling processes to have their own view of the system, improving security and resource management.
Read 18 tweets
Apr 18
🚨🚨Interview Guide!

15 Docker scenario-based interview questions and answers 👇🛳️
Q1: U r tasked with deploying a multi-container app on Docker. How would u orchestrate these containers effectively?

A: Utilize Docker Compose, defining services, networks, & volumes in a YAML file. It simplifies multi-container deployments, ensuring consistency & scalability.
Q2: ur team wants to ensure seamless updates without downtime. How would u achieve zero-downtime deployments with Docker?

A: Implement rolling updates with Docker Swarm/ Kubernetes. By gradually updating containers while keeping the app available, u ensure uninterrupted service.
Read 18 tweets
Apr 16
🚨🚨 Interview Tip!

What happens at the backend when you launch a Pod in Kubernetes!

A Thread 👇 Image
🐳 Step 1: YAML Configuration

To kick things off, you create a YAML file defining your Pod's configuration. This includes details like container images, ports, volumes, etc. #Kubernetes #YAML
🔍 Step 2: API Request

Once you've got your YAML ready, you send an API request to the Kubernetes cluster. This request includes your Pod configuration. #K8s #API
Read 21 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(