The Problem
When running the systool command on CentOS/RHEL 7, the following error message is reported:
# systool -c fc_host -v Error opening class fc_host
The Solution
The error occurs because the scsi_transport_fc module that is responsible for populating the contents of /sys/class/fc_host/ directory is not loaded on the system.
1. Manually load the scsi_transport_fc module then generate modules.dep and System.map files.
# modprobe scsi_transport_fc # depmod
# lsmod | grep scsi_transport_fc scsi_transport_fc 57344 0
2. Re-run the systool(1) command to confirm it displays expected output e.g:
# systool -c fc_host Class = "fc_host" Class Device = "host2" Device = "host2" Class Device = "host3" Device = "host3"
3. Rebuild the initial RAM disk image.
a. Backup the existing initial RAM disk file for the currently running kernel version e.g.:
# cp -p /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak
b. Rebuild the initial RAM disk file for the currently running kernel version:
# dracut -f
NOTE: If you are running a kernel version that is different to the initial RAM disk version you are building (or if running in Linux Rescue Mode) you must specify the full kernel version/architecture e.g:
# dracut -f /boot/initramfs-5.4.17-2102.201.3.el7uek.x86_64.img 5.4.17-2102.201.3.el7uek.x86_64
4. Reboot the server. Upon reboot, the system should automatically load the scsi_transport_fc kernel module e.g.:
# lsmod | grep scsi_transport_fc scsi_transport_fc 57344 0
5. Re-run the systool(1) command to confirm it displays expected output e.g.:
# systool -c fc_host Class = "fc_host" Class Device = "host2" Device = "host2" Class Device = "host3" Device = "host3"