diff --git a/sos/report/__init__.py b/sos/report/__init__.py index 9bfce187b5..14288629b0 100644 --- a/sos/report/__init__.py +++ b/sos/report/__init__.py @@ -445,7 +445,8 @@ def _get_hardware_devices(self): 'fibre': self._get_fibre_devs() }, 'network': self._get_network_devs(), - 'namespaced_network': self._get_network_namespace_devices() + 'namespaced_network': self._get_network_namespace_devices(), + 'fstype': self._get_devices_by_fstype() } def _check_container_runtime(self): @@ -680,6 +681,21 @@ def _get_network_namespaces(self): out_ns.append(line.partition(' ')[0]) return out_ns + def _get_devices_by_fstype(self): + _dev_fstypes = {} + _devs = sos_get_command_output("lsblk -nrpo FSTYPE,NAME") + if _devs['status'] != 0: + return _dev_fstypes + for line in (_devs['output'].splitlines()): + helper = line.strip().split() + if len(helper) == 1: + helper.insert(0, 'unknown') + if "ext" in helper[0]: + helper[0] = 'ext4' + _dev_fstypes.setdefault(helper[0], []) + _dev_fstypes[helper[0]].append(helper[1]) + return _dev_fstypes + def get_commons(self): return { 'cmddir': self.cmddir,