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

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. 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

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

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

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 Rescue Mode Linux was helpful. So, let me know your suggestions and feedback using the comment section.

 

Leave a Reply

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