Solved

df command not working

Posted on 2000-03-01
5
1,589 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 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Fine Tune your automatic Updates for Ubuntu / Debian
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

732 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