Solved

df command not working

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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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 several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now