SOS Reports – Focused Diagnostic Collection
sos report collects system configuration and diagnostic data into an archive, normally under /var/tmp. (Red Hat Documentation)
1. Generate a normal SOS report
Install if needed:
dnf install -y sos
Create report:
sos report
Non-interactive:
sos report --batch
Find the result:
ls -lh /var/tmp/sosreport*
2. Generate only specific information
List available plugins:
sos report --list-plugins
Run only the filesystem plugin:
sos report --batch --only-plugins filesys
Useful short form:
sos report --batch -o filesys
Plugin-specific options are enabled with -k plugin.option. (GitExtract)
For detailed ext2/ext3/ext4 information:
sos report --batch \
-o filesys \
-k filesys.dumpe2fs
dumpe2fs reads ext2/ext3/ext4 filesystem metadata. (man7.org)
Before collecting, identify the filesystems:
findmnt
Only ext4:
findmnt -t ext4
Example:
/ /dev/mapper/rhel-root ext4
/boot /dev/sda2 ext4
/data /dev/sdb1 ext4
3. Exclude a partition such as /boot
First find the device behind /boot:
findmnt -no SOURCE /boot
Example:
/dev/sda2
Generate filesystem information but skip dumpe2fs for that device:
sos report --batch \
-o filesys \
-k filesys.dumpe2fs \
--skip-commands='*dumpe2fs*/dev/sda2*'
--skip-commands supports shell-style wildcard matching. (Debian Manpages)
A reusable version:
BOOTDEV=$(findmnt -no SOURCE /boot)
sos report --batch \
-o filesys \
-k filesys.dumpe2fs \
--skip-commands="*dumpe2fs*${BOOTDEV}*"
Key idea
Full system:
sos report
Specific area:
sos report -o <plugin>
Extra plugin data:
-k plugin.option
Exclude something:
--skip-commands='pattern'
For filesystem troubleshooting:
findmnt
↓
identify devices
↓
-o filesys
↓
-k filesys.dumpe2fs
↓
skip unwanted devices