3.1 Filesystem Usage
3.2 Inode Usage
3.3 Block Devices (+ blkid)
3.4 Mounted Filesystems (+ mount propagation)
3.5 Filesystem Configuration (/etc/fstab)
3.6 LVM (+ VG free space)
3.7 Software RAID / mdadm (+ md detail)
3.8 ZFS (+ zpool status -v)
3.9 SMART Health (+ smartctl -i)
3.10 Storage Services
3.11 NFS Client / Server (+ showmount)
3.12 iSCSI Initiator / Target (+ /dev/disk/by-path)
3.13 Multipath (+ show maps)
3.14 Disk I/O Statistics (+ /proc/diskstats fallback)
Root rights need!
Copy–>Past
echo "==================== 03.1 FILESYSTEM USAGE ===================="; df -hT; printf "\n%.0s" {1..3}; echo "==================== 03.2 INODE USAGE ===================="; df -ih; printf "\n%.0s" {1..3}; echo "==================== 03.3 BLOCK DEVICES ===================="; lsblk -o NAME,SIZE,TYPE,FSTYPE,LABEL,UUID,MOUNTPOINTS; printf "\n"; echo "--- Disk Model / Serial ---"; lsblk -d -o NAME,SIZE,MODEL,SERIAL; printf "\n"; echo "--- Filesystem UUIDs ---"; blkid 2>/dev/null || echo "blkid not available"; printf "\n"; echo "--- Persistent Device IDs ---"; ls -l /dev/disk/by-id 2>/dev/null | head -50 || echo "/dev/disk/by-id unavailable"; printf "\n%.0s" {1..3}; echo "==================== 03.4 MOUNTED FILESYSTEMS ===================="; findmnt -o TARGET,SOURCE,FSTYPE,OPTIONS; printf "\n"; echo "--- Mount Propagation ---"; findmnt -o TARGET,PROPAGATION; printf "\n%.0s" {1..3}; echo "==================== 03.5 FSTAB ===================="; cat /etc/fstab; printf "\n%.0s" {1..3}; echo "==================== 03.6 LVM ===================="; pvs 2>/dev/null || echo "pvs not available or no LVM"; printf "\n"; vgs 2>/dev/null || echo "vgs not available or no LVM"; printf "\n"; echo "--- VG Custom Fields (Size/Free) ---"; vgs -o vg_name,vg_size,vg_free 2>/dev/null || echo "vgs detailed not available"; printf "\n"; lvs -a -o +devices 2>/dev/null || echo "lvs not available or no LVM"; printf "\n"; echo "--- LV Detailed Display ---"; lvdisplay 2>/dev/null || echo "lvdisplay not available"; printf "\n%.0s" {1..3}; echo "==================== 03.7 SOFTWARE RAID / MDADM ===================="; cat /proc/mdstat 2>/dev/null || echo "/proc/mdstat not available"; printf "\n"; mdadm --detail --scan 2>/dev/null || echo "mdadm not available or no arrays"; printf "\n"; echo "--- MDADM Detail Status ---"; mdadm --detail /dev/md* 2>/dev/null || echo "No active mdadm arrays or mdadm not installed"; printf "\n%.0s" {1..3}; echo "==================== 03.8 ZFS ===================="; zpool list 2>/dev/null || echo "zpool not available or no pools"; printf "\n"; zpool status 2>/dev/null || echo "zpool status not available"; printf "\n"; echo "--- ZPOOL Verbose Status (Errors) ---"; zpool status -v 2>/dev/null || echo "zpool status -v not available"; printf "\n"; echo "--- ZPOOL Properties (Top 80) ---"; zpool get all 2>/dev/null | head -80 || echo "zpool get all not available"; printf "\n"; zfs list 2>/dev/null || echo "zfs not available or no datasets"; printf "\n%.0s" {1..3}; echo "==================== 03.9 SMART HEALTH ===================="; if command -v smartctl >/dev/null 2>&1; then smartctl --scan; printf "\n"; for D in $(smartctl --scan | awk '{print $1}'); do echo "--- SMART: $D ---"; smartctl -i "$D" 2>/dev/null; printf "\n"; smartctl -H "$D" 2>/dev/null; echo "--- Temperature Mappings ---"; smartctl -A "$D" 2>/dev/null | grep -Ei 'Temperature|Airflow_Temperature' || echo "No temperature attribute found"; echo "--- Critical Attributes ---"; smartctl -A "$D" 2>/dev/null | egrep -i 'Reallocated|Current_Pending|Offline_Uncorrectable|Power_On|Media_Wearout|Wear_Leveling|Percentage_Used|Available_Reserv|Critical_Warning' || true; printf "\n"; done; else echo "smartctl not installed"; fi; printf "\n%.0s" {1..3}; echo "==================== 03.10 STORAGE SERVICES ===================="; echo "smartd : $(systemctl is-active smartd 2>/dev/null || echo not-found/inactive)"; echo "multipathd : $(systemctl is-active multipathd 2>/dev/null || echo not-found/inactive)"; echo "iscsid : $(systemctl is-active iscsid 2>/dev/null || echo not-found/inactive)"; echo "rpcbind : $(systemctl is-active rpcbind 2>/dev/null || echo not-found/inactive)"; echo "nfs-server : $(systemctl is-active nfs-server 2>/dev/null || echo not-found/inactive)"; echo "nfs-kernel-server : $(systemctl is-active nfs-kernel-server 2>/dev/null || echo not-found/inactive)"; printf "\n%.0s" {1..3}; echo "==================== 03.11 NFS CLIENT / SERVER ===================="; echo "--- NFS Client Mounts ---"; findmnt -t nfs,nfs4 2>/dev/null || echo "No NFS client mounts"; printf "\n"; echo "--- NFS Server Exports ---"; exportfs -v 2>/dev/null || echo "exportfs not available or no NFS exports"; printf "\n"; echo "--- NFS Showmount Local ---"; (systemctl is-active nfs-server >/dev/null 2>&1 || systemctl is-active nfs-kernel-server >/dev/null 2>&1) && showmount -e localhost 2>/dev/null || echo "NFS server not running or showmount unavailable"; printf "\n"; echo "--- RPC Services ---"; rpcinfo -p 2>/dev/null || echo "rpcinfo unavailable or rpcbind not running"; printf "\n%.0s" {1..3}; echo "==================== 03.12 ISCSI INITIATOR / TARGET ===================="; echo "--- iSCSI Services ---"; echo "iscsid: $(systemctl is-active iscsid 2>/dev/null || echo not-found/inactive)"; echo "open-iscsi: $(systemctl is-active open-iscsi 2>/dev/null || echo not-found/inactive)"; echo "target: $(systemctl is-active target 2>/dev/null || echo not-found/inactive)"; echo "tgtd: $(systemctl is-active tgtd 2>/dev/null || echo not-found/inactive)"; printf "\n"; echo "--- Initiator IQN ---"; cat /etc/iscsi/initiatorname.iscsi 2>/dev/null || echo "No iSCSI initiator configured"; printf "\n"; echo "--- Discovered Targets ---"; iscsiadm -m node 2>/dev/null || echo "No discovered iSCSI targets"; printf "\n"; echo "--- Active Sessions ---"; iscsiadm -m session 2>/dev/null || echo "No active iSCSI sessions"; printf "\n"; echo "--- iSCSI Disks by Path ---"; ls -l /dev/disk/by-path 2>/dev/null | grep iscsi || echo "No iSCSI disks found"; printf "\n"; echo "--- TargetCLI Configuration ---"; command -v targetcli >/dev/null 2>&1 && targetcli ls 2>/dev/null || echo "targetcli not installed or no LIO targets configured"; printf "\n"; echo "--- TGT Configuration ---"; command -v tgtadm >/dev/null 2>&1 && tgtadm --mode target --op show 2>/dev/null || echo "tgtd not installed or no TGT targets configured"; printf "\n%.0s" {1..3}; echo "==================== 03.13 MULTIPATH ===================="; echo "multipathd: $(systemctl is-active multipathd 2>/dev/null || echo not-found/inactive)"; printf "\n"; multipath -ll 2>/dev/null || echo "multipath not installed or no multipath devices"; printf "\n"; multipathd show paths 2>/dev/null || echo "multipathd paths unavailable"; printf "\n"; multipathd show maps 2>/dev/null || echo "multipathd maps unavailable"; printf "\n%.0s" {1..3}; echo "==================== 03.14 DISK I/O STATISTICS ===================="; iostat -xz 1 2 2>/dev/null || { echo "iostat not installed. Falling back to /proc/diskstats:"; printf "\n"; cat /proc/diskstats; }
# ==================== 03.1 FILESYSTEM USAGE ====================
echo "==================== 03.1 FILESYSTEM USAGE ===================="
df -hT
printf "\n%.0s" {1..3}
# ==================== 03.2 INODE USAGE ====================
echo "==================== 03.2 INODE USAGE ===================="
df -ih
printf "\n%.0s" {1..3}
# ==================== 03.3 BLOCK DEVICES (+ BLKID) ====================
echo "==================== 03.3 BLOCK DEVICES (+ BLKID) ===================="
lsblk -o NAME,SIZE,TYPE,FSTYPE,LABEL,UUID,MOUNTPOINTS
printf "\n"
echo "--- Disk Model / Serial ---"
lsblk -d -o NAME,SIZE,MODEL,SERIAL
printf "\n"
echo "--- Filesystem UUIDs ---"
blkid 2>/dev/null || echo "blkid not available"
printf "\n"
echo "--- Persistent Device IDs ---"
ls -l /dev/disk/by-id 2>/dev/null | head -50 || echo "/dev/disk/by-id unavailable"
printf "\n%.0s" {1..3}
# ==================== 03.4 MOUNTED FILESYSTEMS (+ MOUNT PROPAGATION) ====================
echo "==================== 03.4 MOUNTED FILESYSTEMS (+ MOUNT PROPAGATION) ===================="
findmnt -o TARGET,SOURCE,FSTYPE,OPTIONS
printf "\n"
echo "--- Mount Propagation ---"
findmnt -o TARGET,PROPAGATION
printf "\n%.0s" {1..3}
# ==================== 03.5 FILESYSTEM CONFIGURATION (/ETC/FSTAB) ====================
echo "==================== 03.5 FILESYSTEM CONFIGURATION (/ETC/FSTAB) ===================="
cat /etc/fstab
printf "\n%.0s" {1..3}
# ==================== 03.6 LVM (+ VG FREE SPACE) ====================
echo "==================== 03.6 LVM (+ VG FREE SPACE) ===================="
pvs 2>/dev/null || echo "pvs not available or no LVM"
printf "\n"
vgs 2>/dev/null || echo "vgs not available or no LVM"
printf "\n"
echo "--- VG Custom Fields (Size/Free) ---"
vgs -o vg_name,vg_size,vg_free 2>/dev/null || echo "vgs detailed not available"
printf "\n"
lvs -a -o +devices 2>/dev/null || echo "lvs not available or no LVM"
printf "\n"
echo "--- LV Detailed Display ---"
lvdisplay 2>/dev/null || echo "lvdisplay not available"
printf "\n%.0s" {1..3}
# ==================== 03.7 SOFTWARE RAID / MDADM (+ MD DETAIL) ====================
echo "==================== 03.7 SOFTWARE RAID / MDADM (+ MD DETAIL) ===================="
cat /proc/mdstat 2>/dev/null || echo "/proc/mdstat not available"
printf "\n"
mdadm --detail --scan 2>/dev/null || echo "mdadm not available or no arrays"
printf "\n"
echo "--- MDADM Detail Status ---"
mdadm --detail /dev/md* 2>/dev/null || echo "No active mdadm arrays or mdadm not installed"
printf "\n%.0s" {1..3}
# ==================== 03.8 ZFS (+ ZPOOL STATUS -V) ====================
echo "==================== 03.8 ZFS (+ ZPOOL STATUS -V) ===================="
zpool list 2>/dev/null || echo "zpool not available or no pools"
printf "\n"
zpool status 2>/dev/null || echo "zpool status not available"
printf "\n"
echo "--- ZPOOL Verbose Status (Errors) ---"
zpool status -v 2>/dev/null || echo "zpool status -v not available"
printf "\n"
echo "--- ZPOOL Properties (Top 80) ---"
zpool get all 2>/dev/null | head -80 || echo "zpool get all not available"
printf "\n"
zfs list 2>/dev/null || echo "zfs not available or no datasets"
printf "\n%.0s" {1..3}
# ==================== 03.9 SMART HEALTH (+ SMARTCTL -I) ====================
echo "==================== 03.9 SMART HEALTH (+ SMARTCTL -I) ===================="
if command -v smartctl >/dev/null 2>&1; then
smartctl --scan
printf "\n"
for D in $(smartctl --scan | awk '{print $1}'); do
echo "--- SMART: $D ---"
smartctl -i "$D" 2>/dev/null
printf "\n"
smartctl -H "$D" 2>/dev/null
echo "--- Temperature Mappings ---"
smartctl -A "$D" 2>/dev/null | grep -Ei 'Temperature|Airflow_Temperature' || \
echo "No temperature attribute found"
echo "--- Critical Attributes ---"
smartctl -A "$D" 2>/dev/null | \
egrep -i 'Reallocated|Current_Pending|Offline_Uncorrectable|Power_On|Media_Wearout|Wear_Leveling|Percentage_Used|Available_Reserv|Critical_Warning' || true
printf "\n"
done
else
echo "smartctl not installed"
fi
printf "\n%.0s" {1..3}
# ==================== 03.10 STORAGE SERVICES ====================
echo "==================== 03.10 STORAGE SERVICES ===================="
echo "smartd : $(systemctl is-active smartd 2>/dev/null || echo not-found/inactive)"
echo "multipathd : $(systemctl is-active multipathd 2>/dev/null || echo not-found/inactive)"
echo "iscsid : $(systemctl is-active iscsid 2>/dev/null || echo not-found/inactive)"
echo "rpcbind : $(systemctl is-active rpcbind 2>/dev/null || echo not-found/inactive)"
echo "nfs-server : $(systemctl is-active nfs-server 2>/dev/null || echo not-found/inactive)"
echo "nfs-kernel-server : $(systemctl is-active nfs-kernel-server 2>/dev/null || echo not-found/inactive)"
printf "\n%.0s" {1..3}
# ==================== 03.11 NFS CLIENT / SERVER (+ SHOWMOUNT) ====================
echo "==================== 03.11 NFS CLIENT / SERVER (+ SHOWMOUNT) ===================="
echo "--- NFS Client Mounts ---"
findmnt -t nfs,nfs4 2>/dev/null || echo "No NFS client mounts"
printf "\n"
echo "--- NFS Server Exports ---"
exportfs -v 2>/dev/null || echo "exportfs not available or no NFS exports"
printf "\n"
echo "--- NFS Showmount Local ---"
(systemctl is-active nfs-server >/dev/null 2>&1 || systemctl is-active nfs-kernel-server >/dev/null 2>&1) && \
showmount -e localhost 2>/dev/null || \
echo "NFS server not running or showmount unavailable"
printf "\n"
echo "--- RPC Services ---"
rpcinfo -p 2>/dev/null || echo "rpcinfo unavailable or rpcbind not running"
printf "\n%.0s" {1..3}
# ==================== 03.12 ISCSI INITIATOR / TARGET (+ /DEV/DISK/BY-PATH) ====================
echo "==================== 03.12 ISCSI INITIATOR / TARGET (+ /DEV/DISK/BY-PATH) ===================="
echo "--- iSCSI Services ---"
echo "iscsid: $(systemctl is-active iscsid 2>/dev/null || echo not-found/inactive)"
echo "open-iscsi: $(systemctl is-active open-iscsi 2>/dev/null || echo not-found/inactive)"
echo "target: $(systemctl is-active target 2>/dev/null || echo not-found/inactive)"
echo "tgtd: $(systemctl is-active tgtd 2>/dev/null || echo not-found/inactive)"
printf "\n"
echo "--- Initiator IQN ---"
cat /etc/iscsi/initiatorname.iscsi 2>/dev/null || echo "No iSCSI initiator configured"
printf "\n"
echo "--- Discovered Targets ---"
iscsiadm -m node 2>/dev/null || echo "No discovered iSCSI targets"
printf "\n"
echo "--- Active Sessions ---"
iscsiadm -m session 2>/dev/null || echo "No active iSCSI sessions"
printf "\n"
echo "--- iSCSI Disks by Path ---"
ls -l /dev/disk/by-path 2>/dev/null | grep iscsi || echo "No iSCSI disks found"
printf "\n"
echo "--- TargetCLI Configuration ---"
command -v targetcli >/dev/null 2>&1 && targetcli ls 2>/dev/null || \
echo "targetcli not installed or no LIO targets configured"
printf "\n"
echo "--- TGT Configuration ---"
command -v tgtadm >/dev/null 2>&1 && tgtadm --mode target --op show 2>/dev/null || \
echo "tgtd not installed or no TGT targets configured"
printf "\n%.0s" {1..3}
# ==================== 03.13 MULTIPATH (+ SHOW MAPS) ====================
echo "==================== 03.13 MULTIPATH (+ SHOW MAPS) ===================="
echo "multipathd: $(systemctl is-active multipathd 2>/dev/null || echo not-found/inactive)"
printf "\n"
multipath -ll 2>/dev/null || echo "multipath not installed or no multipath devices"
printf "\n"
multipathd show paths 2>/dev/null || echo "multipathd paths unavailable"
printf "\n"
multipathd show maps 2>/dev/null || echo "multipathd maps unavailable"
printf "\n%.0s" {1..3}
# ==================== 03.14 DISK I/O STATISTICS (+ /PROC/DISKSTATS FALLBACK) ====================
echo "==================== 03.14 DISK I/O STATISTICS (+ /PROC/DISKSTATS FALLBACK) ===================="
iostat -xz 1 2 2>/dev/null || {
echo "iostat not installed. Falling back to /proc/diskstats:"
printf "\n"
cat /proc/diskstats
}







