[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug in df -l -x?
From: |
Sven Kieske |
Subject: |
Bug in df -l -x? |
Date: |
Mon, 11 Apr 2016 17:43:29 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 |
Hi,
first: please keep me cc'ed as
I'm not yet subscribed to the mailing list.
it seems that df -l and df -x
do not what the man page advises it does.
However I wanted to double check with
this list before filing a bug report.
according to my manual page:
-l, --local
limit listing to local file systems
-x, --exclude-type=TYPE
limit listing to file systems not of type TYPE
Well and it's true, the output is shortend for these remote
fs types, like nfs.
However, what df seems to do, according
to my strace attempts, is to open /etc/mtab
and to do a "stat" on every fs it finds in there (or every mountpoint?)
including also remote filesystems like cifs or nfs.
While this is, strictly speaking, doing
what the man page documents, it can lead to surprising results.
for example in some environments you use periodic
executions of "df" to monitor the disk usage of local
filesystems but you do not want to include remote filesystems
which get monitored on their according nfs server and they
may also vanish at any given time, because the environment
is very dynamic.
what happens is, that df might hang at an nfs mount point
when it is no longer mounted for an infinite time until you kill it.
here is an example of a ps output on a linux machine with hanging
df command since the 10th of March (until today):
ps auxf | grep " D "
root 17803 0.0 0.0 2036 704 pts/1 S+ 16:58 0:00
\_ grep --colour=auto D
root 27629 0.0 0.0 1696 572 ? D Mar10 0:00 df
-PTlk -x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x zfs
root 28029 0.0 0.0 1696 572 ? D Mar10 0:00 df
-PTlk -x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x zfs
root 28555 0.0 0.0 1696 568 ? D Mar10 0:00 df
-PTlk -x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x zfs
root 29281 0.0 0.0 1696 568 ? D Mar10 0:00 df
-PTlk -x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x zfs
root 29900 0.0 0.0 1696 568 ? D Mar10 0:00 df
-PTlk -x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x zfs
here is the corresponding source code from a bash script which is used
for monitoring (from the popular "check_mk" Open Source Monitoring Tool):
echo '<<<df>>>'
# The exclusion list is getting a bit of a problem. -l should hide any
remote FS but seems
# to be all but working.
excludefs="-x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x
zfs"
df -PTlk $excludefs | sed 1d
To reiterate:
yes, df does not _list_ any remote filesystems in it's output, but it
_processes_ them in some way, leading to a hang in df if the file system
is not there for whatever reason.
It would be kind if this behaviour could get changed, or if I'm doing
something wrong, maybe someone can enlighten me?
Your help would be much appreciated.
PS: for completeness sake, here is the tested version:
df --version
df (GNU coreutils) 8.22
[..]
--
Mit freundlichen Grüßen / Regards
Sven Kieske
Systemadministrator
Mittwald CM Service GmbH & Co. KG
Königsberger Straße 6
32339 Espelkamp
T: +495772 293100
F: +495772 293333
https://www.mittwald.de
Geschäftsführer: Robert Meyer
St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
signature.asc
Description: OpenPGP digital signature
- Bug in df -l -x?,
Sven Kieske <=