How to generate sosreport in rescue mode on Software RAID (RHEL/CentOS 7)


Linux, How To

How to generate sosreport in in RedHat and CentOS Linux. sosreport command not found. Collect sosreport in Linux rescue mode. How to run sosreport in CentOS or RHEL 7. Steps to collect sosreport by manually mounting the filesystem in RedHat Linux . Unable to boot into rescue mode on software raid RedHat linux host. redhat sosreport.

How to generate sosreport in rescue mode on Software RAID (RHEL/CentOS 7)

 

Steps to generate sosreport in Linux Rescue Mode

I have written another article with the steps to boot into rescue mode in Linux using RHEL/CentOS 7 DVD.

 

Now at the below screen instead of selecting "Continue", we will manually mount the file system and generate sosreport in RedHat. So select "3" to "Skip to shell".

How to generate sosreport in rescue mode on Software RAID (RHEL/CentOS 7)

 

Activate Software RAID

At the "sh-4.2" prompt check df command output to see if the dev, sys, proc filesystems are mounted under the existing installation environment /mnt/sysimage or not. If these directories are not by default mounted, then we must activate our RAID partitions to activate the filesystem.

How to generate sosreport in rescue mode on Software RAID (RHEL/CentOS 7)-2

 

Scan the available raid devices and execute the below commands

# mdadm --examine --scan
# mdadm --assemble --scan

How to generate sosreport in rescue mode on Software RAID (RHEL/CentOS 7)-3

 

Activate the logical volume

# vgchange -ay

How to generate sosreport in rescue mode on Software RAID (RHEL/CentOS 7)-4

 

Next verify the available logical volume. Now we can see all our logical volumes which are part of my node.

How to generate sosreport in rescue mode on Software RAID (RHEL/CentOS 7)-5

 

Mount the FileSystem on sysimage

Since the dev, sys, proc file systems are not mounted, we will try to mount it manually as shown below:

IMPORTANT NOTE:
It is important to mount the root file system as the first step.
# mount /dev/mapper/os-root /mnt/sysimage
mount -o bind /dev /mnt/sysimage/dev
mount -o bind /usr /mnt/sysimage/usr
mount -o bind /sys /mnt/sysimage/sys
mount -t proc /proc /mnt/sysimage/proc
mount -o bind /dev/shm /mnt/sysimage/dev/shm

 

We can also mount other logical volumes which we had observed with lvs command as those will also be required to generate sosreport.

NOTE:
These logical volume names will differ based on your environment. Here /dev/md124 raid device is my boot partition.
mount /dev/md124 /mnt/sysimage/boot
mount /dev/mapper/system-var /mnt/sysimage/var
mount /dev/mapper/system-home /mnt/sysimage/home
mount /dev/mapper/system-opt /mnt/sysimage/opt
mount /dev/mapper/system-tmp /mnt/sysimage/tmp

 

Now verify the mounted partitions using df command:

How to generate sosreport in rescue mode on Software RAID (RHEL/CentOS 7)

 

So all our required partitions are mounted on /mnt/sysimage. Change root to the already installed root fs:

# chroot /mnt/sysimage

How to generate sosreport in rescue mode on Software RAID (RHEL/CentOS 7)

Now as you see my file system is properly mounted under / (root)

 

Collect sosreport RedHat/CentOS

We are all set up to collect sosreport in rescue mode in RedHat/CentOS.

How to generate sosreport in rescue mode on Software RAID (RHEL/CentOS 7)

 

Fix sosreport command not found in rescue mode

It is possible that you may observe this error "sosreport command not found" in Linux rescue mode. In the Linux rescue mode these binary are loaded from the DVD which is used to boot into the rescue mode.

So if you have used the Red Hat Enterprise Linux X.X Boot ISO then these image do not contain the sosreport binary hence you won't be able to collect sosreport. Hence it is recommended that in such case you use Red Hat Enterprise Linux X.X Binary DVD or the original DVD to boot into rescue mode.

NOTE:
Here replace X.X with the RHEL release detail for example 7.6

 

Lastly I hope the steps from the article to generate sosreport and fix sosreport command not found in Redhat/CentOS Linux was helpful. So, let me know your suggestions and feedback using the comment section.

 

Deepak Prasad

Deepak Prasad

Deepak Prasad is the founder of GoLinuxCloud, bringing over a decade of expertise in Linux, Python, Go, Laravel, DevOps, Kubernetes, Git, Shell scripting, OpenShift, Networking, and Security. His extensive experience spans development, DevOps, networking, and security, ensuring robust and efficient solutions for diverse projects.

Certifications and Credentials:

  • Certified Kubernetes Application Developer (CKAD)
  • Go Developer Certification
  • Linux Foundation Certified System Administrator (LFCS)
  • Certified Ethical Hacker (CEH)
  • Python Institute PCAP (Certified Associate in Python Programming)
You can connect with him on his LinkedIn profile and join his Facebook and LinkedIn page.

Can't find what you're searching for? Let us assist you.

Enter your query below, and we'll provide instant results tailored to your needs.

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can send mail to admin@golinuxcloud.com

Thank You for your support!!

Leave a Comment