From unknown Mon Aug 18 21:17:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8208: Possible bug for df Resent-From: Jesse Molina Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 09 Mar 2011 13:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8208 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 8208@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.129967862618728 (code B ref -1); Wed, 09 Mar 2011 13:51:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Mar 2011 13:50:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PxJmT-0004ry-AA for submit@debbugs.gnu.org; Wed, 09 Mar 2011 08:50:26 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PxFox-0006ba-9f for submit@debbugs.gnu.org; Wed, 09 Mar 2011 04:36:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxFor-0004n9-E6 for submit@debbugs.gnu.org; Wed, 09 Mar 2011 04:36:38 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:36719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxFor-0004n5-C8 for submit@debbugs.gnu.org; Wed, 09 Mar 2011 04:36:37 -0500 Received: from [140.186.70.92] (port=59427 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxFop-0004Qi-R5 for bug-coreutils@gnu.org; Wed, 09 Mar 2011 04:36:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxFoo-0004md-BT for bug-coreutils@gnu.org; Wed, 09 Mar 2011 04:36:35 -0500 Received: from sorrows.opendreams.net ([24.249.170.115]:42796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxFoo-0004mA-6o for bug-coreutils@gnu.org; Wed, 09 Mar 2011 04:36:34 -0500 Received: from [192.168.250.28] (blame.opendreams.net [::ffff:192.168.250.28]) (AUTH: PLAIN shara, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by sorrows.opendreams.net with esmtp; Wed, 09 Mar 2011 02:36:31 -0700 id 06548202.4D774A1F.000058F1 Message-ID: <4D774A1F.2050303@opendreams.net> Date: Wed, 09 Mar 2011 02:36:31 -0700 From: Jesse Molina User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.17) Gecko/20110123 SeaMonkey/2.0.12 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.9 (-----) X-Mailman-Approved-At: Wed, 09 Mar 2011 08:50:24 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) The "df" tool will mismatch mounted devices when a specific device parameter is specified. Here's some console output from running df; [/var/log] shara@sorrows-->df -h /dev/md5 Filesystem Size Used Avail Use% Mounted on /dev/md5 2.3T 1.7T 534G 76% /mnt/backup/bak5 [/var/log] shara@sorrows-->df -h /dev/md5 Filesystem Size Used Avail Use% Mounted on udev 881M 372K 880M 1% /dev In the second invocation, the /dev/md5 device had been dismounted, but the /dev filesystem is now being matched, when it should not be. Expected behavior is to get non-zero exit code and print nothing, and/or an error on stderr that the device is not found. Note that this was to be used in a script. I tried with the -P flag, and the behavior is the same, in that the wrong mount is matched. shara@sorrows-->df --version df (GNU coreutils) 8.5 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Torbjorn Granlund, David MacKenzie, and Paul Eggert. Also FYI shara@sorrows-->df -v Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/sor--vg1-root 8256952 3884136 4288932 48% / tmpfs 906132 4 906128 1% /lib/init/rw udev 901260 372 900888 1% /dev tmpfs 906132 4 906128 1% /dev/shm /dev/md0 241036 108803 107344 51% /boot /dev/mapper/sor--vg1-tmp 2064208 71112 1888240 4% /tmp /dev/mapper/sor--vg1-var 1906616172 621163644 1266103904 33% /var /dev/mapper/sor--vg1-var--log 4128448 2038268 2090180 50% /var/log No reply needed. Sorry if this is duplicate or expected behavior. -- # Jesse Molina # Mail = jesse@opendreams.net # Page = page-jesse@opendreams.net # Cell = 1.602.323.7608 # Web = http://www.opendreams.net/jesse/ From unknown Mon Aug 18 21:17:11 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Jesse Molina Subject: bug#8208: closed (Re: bug#8208: Possible bug for df) Message-ID: References: <4D77A8E6.5000508@draigBrady.com> <4D774A1F.2050303@opendreams.net> X-Gnu-PR-Message: they-closed 8208 X-Gnu-PR-Package: coreutils Reply-To: 8208@debbugs.gnu.org Date: Wed, 09 Mar 2011 16:23:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1299687782-743-1" This is a multi-part message in MIME format... ------------=_1299687782-743-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #8208: Possible bug for df which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 8208@debbugs.gnu.org. --=20 8208: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D8208 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1299687782-743-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 8208-done) by debbugs.gnu.org; 9 Mar 2011 16:22:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PxM9L-0000Aq-Al for submit@debbugs.gnu.org; Wed, 09 Mar 2011 11:22:11 -0500 Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PxM9J-0000Af-LR for 8208-done@debbugs.gnu.org; Wed, 09 Mar 2011 11:22:10 -0500 Received: (qmail 30417 invoked from network); 9 Mar 2011 16:22:03 -0000 Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218) by mail1.slb.deg.dub.stisp.net with SMTP; 9 Mar 2011 16:22:03 -0000 Message-ID: <4D77A8E6.5000508@draigBrady.com> Date: Wed, 09 Mar 2011 16:20:54 +0000 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: Jesse Molina Subject: Re: bug#8208: Possible bug for df References: <4D774A1F.2050303@opendreams.net> In-Reply-To: <4D774A1F.2050303@opendreams.net> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 8208-done Cc: 8208-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) On 09/03/11 09:36, Jesse Molina wrote: > > The "df" tool will mismatch mounted devices when a specific device > parameter is specified. > > Here's some console output from running df; > > [/var/log] > shara@sorrows-->df -h /dev/md5 > Filesystem Size Used Avail Use% Mounted on > /dev/md5 2.3T 1.7T 534G 76% /mnt/backup/bak5 > [/var/log] > shara@sorrows-->df -h /dev/md5 > Filesystem Size Used Avail Use% Mounted on > udev 881M 372K 880M 1% /dev > > > > In the second invocation, the /dev/md5 device had been dismounted, but > the /dev filesystem is now being matched, when it should not be. > > Expected behavior is to get non-zero exit code and print nothing, and/or > an error on stderr that the device is not found. > > Note that this was to be used in a script. I tried with the -P flag, > and the behavior is the same, in that the wrong mount is matched. This is expected behavior. If the passed file is not a mount point itself, df will go and find it's mount point, and report for that device. If you want to enforce that the passed device node is mounted then I suggest you ensure that the file system is the same as passed, like: dev=/dev/md5 df_dev=$(df -P $dev | sed -n '2s/\([^ ]*\).*/\1/p') test "$dev" = "$df_dev" || { echo "$dev not mounted" >&2; exit 1; } cheers, Pádraig. ------------=_1299687782-743-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 Mar 2011 13:50:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PxJmT-0004ry-AA for submit@debbugs.gnu.org; Wed, 09 Mar 2011 08:50:26 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PxFox-0006ba-9f for submit@debbugs.gnu.org; Wed, 09 Mar 2011 04:36:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxFor-0004n9-E6 for submit@debbugs.gnu.org; Wed, 09 Mar 2011 04:36:38 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:36719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxFor-0004n5-C8 for submit@debbugs.gnu.org; Wed, 09 Mar 2011 04:36:37 -0500 Received: from [140.186.70.92] (port=59427 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxFop-0004Qi-R5 for bug-coreutils@gnu.org; Wed, 09 Mar 2011 04:36:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxFoo-0004md-BT for bug-coreutils@gnu.org; Wed, 09 Mar 2011 04:36:35 -0500 Received: from sorrows.opendreams.net ([24.249.170.115]:42796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxFoo-0004mA-6o for bug-coreutils@gnu.org; Wed, 09 Mar 2011 04:36:34 -0500 Received: from [192.168.250.28] (blame.opendreams.net [::ffff:192.168.250.28]) (AUTH: PLAIN shara, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by sorrows.opendreams.net with esmtp; Wed, 09 Mar 2011 02:36:31 -0700 id 06548202.4D774A1F.000058F1 Message-ID: <4D774A1F.2050303@opendreams.net> Date: Wed, 09 Mar 2011 02:36:31 -0700 From: Jesse Molina User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.17) Gecko/20110123 SeaMonkey/2.0.12 MIME-Version: 1.0 To: bug-coreutils@gnu.org Subject: Possible bug for df Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 09 Mar 2011 08:50:24 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) The "df" tool will mismatch mounted devices when a specific device parameter is specified. Here's some console output from running df; [/var/log] shara@sorrows-->df -h /dev/md5 Filesystem Size Used Avail Use% Mounted on /dev/md5 2.3T 1.7T 534G 76% /mnt/backup/bak5 [/var/log] shara@sorrows-->df -h /dev/md5 Filesystem Size Used Avail Use% Mounted on udev 881M 372K 880M 1% /dev In the second invocation, the /dev/md5 device had been dismounted, but the /dev filesystem is now being matched, when it should not be. Expected behavior is to get non-zero exit code and print nothing, and/or an error on stderr that the device is not found. Note that this was to be used in a script. I tried with the -P flag, and the behavior is the same, in that the wrong mount is matched. shara@sorrows-->df --version df (GNU coreutils) 8.5 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Torbjorn Granlund, David MacKenzie, and Paul Eggert. Also FYI shara@sorrows-->df -v Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/sor--vg1-root 8256952 3884136 4288932 48% / tmpfs 906132 4 906128 1% /lib/init/rw udev 901260 372 900888 1% /dev tmpfs 906132 4 906128 1% /dev/shm /dev/md0 241036 108803 107344 51% /boot /dev/mapper/sor--vg1-tmp 2064208 71112 1888240 4% /tmp /dev/mapper/sor--vg1-var 1906616172 621163644 1266103904 33% /var /dev/mapper/sor--vg1-var--log 4128448 2038268 2090180 50% /var/log No reply needed. Sorry if this is duplicate or expected behavior. -- # Jesse Molina # Mail = jesse@opendreams.net # Page = page-jesse@opendreams.net # Cell = 1.602.323.7608 # Web = http://www.opendreams.net/jesse/ ------------=_1299687782-743-1--