Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

df command not working

Posted on 2000-03-01
5
1,504 Views
Last Modified: 2013-12-16
We have installed fileutils-3.16-9 but the df -k command gives tons of error messages like:
Filesystem         1024-blocks  Used Available Capacity Mounted on
df: module: No such file or directory
df: kerneld,: No such file or directory
df: filesystems.: No such file or directory
df: clean,: No such file or directory

etc.
Since we use df -k to monitor the file system's capacity, we really need this command to work properly.
Please help.

We are running Linux 2.0.33 on a Sparc 10
Thanks.                                          
0
Comment
Question by:molmstead
5 Comments
 
LVL 4

Expert Comment

by:kiffney
ID: 2573312
Perhaps you don't have an /etc/mtab file?  Or it has been deleted by mistake?  I think df reads this to find out what's mounted.  Check to see if it's there.  If not, re-create it (man fstab will help).  If it is there, and not empty, try running

strace -o df.errors df

and post the output of df.errors.  The df.errors file will help you see what system calls are being made and what is going wrong.
0
 

Author Comment

by:molmstead
ID: 2573363
I don't have the strace command. Where do I get it?

I do have an /etc/mtab file, and it looks like this:

Finding module dependencies... done
Starting kerneld, version 2.1.85 (pid 38)
Checking filesystems.
/dev/sda5: clean, 845/51200 files, 18004/204624 blocks
/dev/sda7: clean, 4569/197880 files, 84171/790308 blocks
/dev/sda4: clean, 19158/204800 files, 283972/819018 blocks
/dev/sda6: clean, 178/25584 files, 8705/102312 blocks
Parallelizing fsck version 1.10 (24-Apr-97)
Checking all file systems.
----------------------------------
----------------------------------
[/sbin/fsck.ext2] fsck.ext2 -a /dev/sda5
[/sbin/fsck.ext2] fsck.ext2 -a /dev/sda7
[/sbin/fsck.ext2] fsck.ext2 -a /dev/sda4
[/sbin/fsck.ext2] fsck.ext2 -a /dev/sda6
----------------------------------
Mounting local filesystems.
Turning on user and group quotas for local filesystems
Setting clock (utc): Tue Dec 28 21:08:28 UTC 1999
Enabling swap space.
Initializing random number generator...

Thanks for any help you can provide.
0
 
LVL 2

Accepted Solution

by:
Reinier earned 75 total points
ID: 2573532
WHAT?????

/etc/mtab is supposed to contain a list of your mounted partitions, like this:

/dev/hda1 / ext2 rw 0 0
none /proc proc rw 0 0
/dev/hda5 /usr ext2 rw 0 0
/dev/hda8 /var ext2 rw 0 0
/dev/hda7 /home ext2 rw 0 0
/dev/hda6 /opt ext2 rw 0 0

Are you sure you gave us the correct file? I

f these are indeed the contents of /etc/mtab then post here the contents of /etc/syslog.conf and any line containing the phrase "dmesg" from /etc/..../rc.sysinit.

What linux distribution are you using? You only mentioned the kernel version so far.
0
 
LVL 3

Expert Comment

by:jyu_88
ID: 2573662
I think he's Molmstead is giving the right file which has wrong contents for some reason. Since 'df' is looking at /etc/mtab and get really surprised by the contents, as resulted in the error he posted.
0
 

Author Comment

by:molmstead
ID: 2573702
You sir have greatly helped us.
I read the mount man page, and created a symbolic link from the /proc/mounts to the mtab file and now the df -k command works perfectly.
Thanks for your wonderful help.
;-)MO
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question