Other df -h hangs

Hello, I recently began noticing that df -h hangs on my Freebsd 8.2 server. I need the output of this command to know current partitions and its sizes.

Usually I do a reboot and everything comes back to normal. But I've done this a number of times now and am beginning to suspect there's an underlying problem.

Before the hanging up, here's the output of my df -h. I the meantime is there an alternative command for this? Thanks.

Filesystem                            Size    Used   Avail Capacity  Mounted on
/dev/aacd0s1a                         143G     52G     79G    40%    /
devfs                                 1.0K    1.0K      0B   100%    /dev
/dev/aacd0s1d                         145G    276K    134G     0%    /tmp
/dev/aacd0s1e                         291G    117G    151G    44%    /var
/dev/aacd2s1                          3.0T    2.6T    137G    95%    /usr2
/dev/aacd1s1                          1.8T    1.5T    156G    91%    /storage
devfs                                 1.0K    1.0K      0B   100%    /var/named/dev      1.5T    567G    932G    38%    /mnt/mailsback --> nfs mount                  1.5T    268G    1.2T    18%    /mnt/appback -->nfs mount
Hei David,
I suggest checking every mountpoint/filesystem on its own to find out which of them isn't responding, like:
# df -h /
# df -h /tmp
# df -h /mnt/mailsback
You said a reboot used to fix that, so I guess it might be one of the nfs mounts not responding (disconnectet/timed out?).
CD into /mnt/mailsback and check if you can access it.

In the meantime you could # du -hc .... to check the diskusage of all the files on the filesystem
and just subtract the result from the disksize.
That might take a moment as the size of files is summed.
But... that might not work as well, if there is a problem on one of your filesystems.

Which options did you use to mount the nfs shares?

Hello, thanks for the response. At least now I can df -h /specific-partition. I discover that there's one nfs mount causing trouble. I mounted it as follows;

mount /mnt/appback

Even unmounting it with umount /mnt/appback just hangs. At first, it said device is busy. Then I passed the -f option, but that didn't help. It simply hangs. I restarted the nfs server on the remote box (Redhat 6), but that still hasn't changed anything.
Ok, you have it running the opposite way. I have a FreeBSD 10.2 nfs-server and Linux nfs-client.
So the mount options are not 100% the same...
Try mount the nfs-share like this:
# mount_nfs -o hard,intr,nolockd /mnt/appback
(could be you have to remove the space between like this -ohard,intr....)
I mount my nfs-share via /etc/fstab so that's not exactly the same syntax.

On nfs the options are important:
hard prevents file corruption when suddenly getting disconnected.
intr makes a hanging connection interruptable (that should help you unmounting)
nolockd (I think that is the same as nolock in Linux) which I use as an option top prevent the server from locking files.
Usually it's ok to let the server lock files that are in use but there are programs causing trouble, like Open-office/Libre-office.
So, if I try to save a file in Libre-office on my Linux-client without the nolockoption I get the same behavior as you. It hangs and needs to be un-/remounted.
That's where the nolockd option comes in handy and let the application on the client side handle the locking.
You should try mounting with the first 2 options hard and intr and if it still does not work try with nolockd
in addition.

Hope that will help you.
Thanks wblock@ I've a bad experience mounting smb/nfs mounts from /etc/fstab. They last time I did, the server failed to mount them. Instead of ignoring, it completely hang up and couldn't reboot. If you're hosting a VPN, you know what a nightmare that is.

Anyway, am going to initiate a reboot at the appropriate time since umount -f won't work, then mount the nfs shares with the options you've suggested. Then I test if the mounting and unmounting work properly.
When ever I'm changing /etc/fstab, I do that while the system is up and running. I edit /etc/fstab and then check if it's working as it should with # mount -a.
If it's not working the way you want it, unmount if necessary, edit /etc/fstab again and try again with # mount -a
That way you can make sure you haven't made a mistake and the system would mount and start up after a reboot as it should. Try that!