Sunday, 1 July 2018

How to fix df –h command hangs on RHEL7/Centos7



The most common cause of df -h command hanging while reading related files to return output and fails without output.

Faced the same issue on RHEL 7.5 Linux box and I have reinstalled the systemd package and the issue is resolved without rebooting the server.

Option 1: Reinstall systemd package:

[root@linuxcnf ~]# yum reinstall systemd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
………

Installed:
  systemd.x86_64 0:219-57.el7

Complete!
[root@linuxcnf ~]#

 Option 2: Check the file /etc/mtab

Check the file /etc/mtab, by default in RHEL 7 /etc/mtab is symbolic link to /proc/self/mounts and check the permissions as well.

[root@linuxcnf ~]# ls -ld /etc/mtab
lrwxrwxrwx. 1 root root 17 Jan 12 05:46 /etc/mtab -> /proc/self/mounts
[root@linuxcnf ~]#

Now the df -h command hanging has been resolved!!!

1 comment:

  1. Thats a good answer kumar i like ur way of explanation
    iam from india iam also learning linux administration

    ReplyDelete