0

I'm running the linux distro on my server.When i want to verify the size of the disk, i'm issuing this commnand to get the output.

 df -h

But it does not produce ANY output.Strangely enough when i'm issuing other command such as fdisk -l or du -h it can show output normally.

Does anyone now why is this happening?Thanks.

edit:

here is the output of cat /etc/fstab

 none     /dev/pts       devpts   rw   0     0

and this is for mount command

 none on /dev/pts type devpts (rw)
 none on /proc/sys/fs/binfmt_misc tpe binfmt_misc  (rw)

edit(2):

here is the output of cat /proc/mounts

 /dev/vzfs / vzfs rw,relatime,usrquota,grpquota 0 0
 proc /proc proc rw,relatime 0 0
 sysfs /sys sysfs rw,relatime 0 0
 none /dev/tmpfs rw,relatime 0 0
 none /dev/pts devpts rw,relatime 0 0
 none /proc/sys/fs/binfmt_misc binfmt_msc rw,relatime 0 0
13
  • Which distro? How about df without -h? Are you running as root or sudo permission?
    – quanta
    Sep 12, 2012 at 7:38
  • @quanta my distro is centos.I'm running as root.All the command df is not working..
    – user119720
    Sep 12, 2012 at 7:45
  • 2
    Please post your /etc/fstab file and also the output of the mount command.
    – ramruma
    Sep 12, 2012 at 8:21
  • df reads /etc/mtab, could you show us this file? Both fdisk and du do something completely different.
    – scai
    Sep 12, 2012 at 8:31
  • i've already update my post above.both the output of fstab and mount
    – user119720
    Sep 12, 2012 at 8:35

2 Answers 2

4

How about this:

$ \df

\ to ignore df alias.


UPDATE

here is the output of cat /proc/mounts

 /dev/vzfs / vzfs rw,relatime,usrquota,grpquota 0 0

/dev/vzfs --> looks like you're running OpenVZ (check by using virt-what). And if so, root filesystem is mounted by the host system, not the guest, therefore, there is no / in the /etc/mtab and df shows nothing. To fix, link /etc/mtab to /proc/mounts:

rm -f /etc/mtab
ln -s /proc/mounts /etc/mtab

Source: http://wiki.openvz.org/Gentoo_template_creation#Make_.2Fetc.2Fmtab_a_symlink_to_.2Fproc.2Fmounts

3
  • nope..its not working.sorry
    – user119720
    Sep 12, 2012 at 8:02
  • @user119720: updated my answer.
    – quanta
    Sep 12, 2012 at 9:47
  • thanks..altough i'm not tested this yet,but you've already point me to the right direction.i will check out this first thing in the morning.
    – user119720
    Sep 12, 2012 at 10:14
1

It may be that you are not running the correct df; perhaps there is a badly-named alias or shellscript in your path. Run which df to check.

If you are running the correct df, then perhaps it has been corrupted or overwritten. Run rpm -qf $(which df) to see which package owns df, and then run rpm -V packagename or rpm -V $(rpm -qf $(which df)) to see if it has changed since installation.

2
  • i've already run which df and it shows me this path : /bin/df when i'm running rpm -qf $(which df) it show me this output: coreutils-5.97-34.el5_8.1 and lastly when i'm running rpm -V $(rpm -qf $(which df)) ,it doesn't show me any output and neither the df command is working
    – user119720
    Sep 12, 2012 at 8:14
  • If you run strace df, is there anything obviously wrong?
    – ramruma
    Sep 12, 2012 at 8:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .