?
Solved

df command not working

Posted on 2000-03-01
5
Medium Priority
?
1,766 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
[X]
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
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 225 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month12 days, 13 hours left to enroll

777 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