No space left on device on Rhel, Centos, Linux – though space is free

I got the error “No space left on device” when doing mkdir. Steps to fix:

  1. Is there still space (yes in my case); df -h /data/
  2. Are there still inodes (yes in my case); df -i /data/
  3. File system might be corrupted. Fsck fixed it for me (xfs equivalent xfs_repair /dev/mapper/rhel-data