Had an old cobalt system with the following issue:
[root /root]# df
df: cannot read table of mounted filesystems
Checking the mtab file it showed:
[root /root]# ls -la /etc/mtab
-rw-r–r–Â Â Â 1 rootÂ Â Â Â rootÂ Â Â Â Â Â Â Â Â Â Â 0 Apr 20 11:32 /etc/mtab
So, for some reason it wasn’t updating the mtab file. Tried the following which pointed the finger at the possible problem:
[root /root]# cat /proc/mounts > /etc/mtab
cat: write error: No space left on device
Searching through the contents of the / partition with “du -sh dirs” show some files that could be moved to another position.Â Once moving the files and creating a symlink the mtab could be regenerated with the cat /proc/mounts > /etc/mtab command and then df -h started to work.
The machine was probably rebooted and /etc/mtab recreated, however, as there wasn’t any space on the / partition could not re-populate the mtab file.