How to Check and Repair a Linux Filesystem (fsck for ext4, xfs_repair for XFS)
Find the device and its filesystem type with lsblk -f. For ext4, unmount it and run fsck -n /dev/DEVICE to check, then fsck -y /dev/DEVICE to repair. For XFS, the default on AlmaLinux and Rocky Linux, use xfs_repair -n and xfs_repair instead, because fsck does nothing on XFS. The root filesystem cannot be unmounted, so repair it from rescue mode or force a check at the next boot.