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.
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".
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.
Scan the available raid devices and execute the below commands
# mdadm --examine --scan # mdadm --assemble --scan
Activate the logical volume
# vgchange -ay
Next verify the available logical volume. Now we can see all our logical volumes which are part of my node.
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:
# 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.
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:
So all our required partitions are mounted on /mnt/sysimage
. Change root to the already installed root fs
:
# chroot /mnt/sysimage
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.
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.
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.