From unknown Thu Jun 19 14:31:04 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#64588 <64588@debbugs.gnu.org> To: bug#64588 <64588@debbugs.gnu.org> Subject: Status: BUG: stat -f incorrectly reports a BTRFS device as a tmpfs Reply-To: bug#64588 <64588@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:31:04 +0000 retitle 64588 BUG: stat -f incorrectly reports a BTRFS device as a tmpfs reassign 64588 coreutils submitter 64588 "debug@roosoft.ltd.uk" severity 64588 normal tag 64588 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 12 23:27:03 2023 Received: (at submit) by debbugs.gnu.org; 13 Jul 2023 03:27:04 +0000 Received: from localhost ([127.0.0.1]:53111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJmys-0000Gy-8b for submit@debbugs.gnu.org; Wed, 12 Jul 2023 23:27:03 -0400 Received: from lists.gnu.org ([209.51.188.17]:41616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJidK-0001C8-U5 for submit@debbugs.gnu.org; Wed, 12 Jul 2023 18:48:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJidK-0003Uk-Gb for bug-coreutils@gnu.org; Wed, 12 Jul 2023 18:48:30 -0400 Received: from gproxy2-pub.mail.unifiedlayer.com ([69.89.18.3]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJic1-0002XM-FS for bug-coreutils@gnu.org; Wed, 12 Jul 2023 18:48:30 -0400 Received: from cmgw14.mail.unifiedlayer.com (unknown [10.0.90.129]) by progateway4.mail.pro1.eigbox.com (Postfix) with ESMTP id 8B3EE10047E20 for ; Wed, 12 Jul 2023 22:46:42 +0000 (UTC) Received: from box2278.bluehost.com ([50.87.176.218]) by cmsmtp with ESMTP id Jibaq7aw0BAs0Jibaqtd97; Wed, 12 Jul 2023 22:46:42 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=DJxKXwBb c=1 sm=1 tr=0 ts=64af2d52 a=XwlUGG/Joq/Evm8SRPjtJg==:117 a=XwlUGG/Joq/Evm8SRPjtJg==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10:nop_charset_1 a=ws7JD89P4LkA:10:nop_rcvd_month_year a=yWZkyvPI6HoA:10:endurance_base64_authed_username_1 a=rq43_l6bJaNEUcltk6YA:9 a=QEXdDO2ut3YA:10:nop_charset_2 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roosoft.ltd.uk; s=default; h=Content-Transfer-Encoding:Content-Type: Reply-To:Subject:From:To:MIME-Version:Date:Message-ID:Sender:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=wIcSxVJ3VVLNDy5TieDrqXPRWjgFORZCpo6Vs3NzOmc=; b=bFzmdXIApWkT+pDuR1PK9uy9ps yjwp3dlALpFsqLBVVHI9grQYeT45WgS7KXcFnx67FQtqAEh7XWFGtofIEJ24YJMGjS1h+4lTOcRt+ 3fYBG6RWsWmex2ftgfw/MzVPC; Received: from host86-165-35-159.range86-165.btcentralplus.com ([86.165.35.159]:57436 helo=[192.168.1.158]) by box2278.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qJibZ-002xws-2w for bug-coreutils@gnu.org; Wed, 12 Jul 2023 16:46:42 -0600 Message-ID: <2b14af65-77aa-718f-530e-c31d36aa6ddb@roosoft.ltd.uk> Date: Wed, 12 Jul 2023 23:46:38 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-CA To: bug-coreutils From: support Subject: BUG: stat -f incorrectly reports a BTRFS device as a tmpfs Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box2278.bluehost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roosoft.ltd.uk X-BWhitelist: no X-Source-IP: 86.165.35.159 X-Source-L: No X-Exim-ID: 1qJibZ-002xws-2w X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: host86-165-35-159.range86-165.btcentralplus.com ([192.168.1.158]) [86.165.35.159]:57436 X-Source-Auth: support@roosoft.ltd.uk X-Email-Count: 1 X-Source-Cap: Y2FzYWRpbG87Y2FzYWRpbG87Ym94MjI3OC5ibHVlaG9zdC5jb20= X-Local-Domain: yes Received-SPF: pass client-ip=69.89.18.3; envelope-from=support@roosoft.ltd.uk; helo=gproxy2-pub.mail.unifiedlayer.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 12 Jul 2023 23:27:01 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: "debug@roosoft.ltd.uk" Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) coreutils version 9.1-1 on Debian testing, but also exists in previous versions. Example: stat -f  /dev/sdb   File: "/dev/sdb"     ID: eb91af7d7bda02dd Namelen: 255     Type: tmpfs Block size: 4096       Fundamental block size: 4096 Blocks: Total: 2012292    Free: 2012292    Available: 2012292 Inodes: Total: 2012292    Free: 2011839 stat -f  /dev/disk/by-uuid/6abaa68a-2670-4d8b-8d2a-fd7321df9242   File: "/dev/disk/by-uuid/6abaa68a-2670-4d8b-8d2a-fd7321df9242"     ID: eb91af7d7bda02dd Namelen: 255     Type: tmpfs Block size: 4096       Fundamental block size: 4096 Blocks: Total: 2012292    Free: 2012292    Available: 2012292 Inodes: Total: 2012292    Free: 2011839 blkid /dev/sdb /dev/sdb: UUID="6abaa68a-2670-4d8b-8d2a-fd7321df9242" UUID_SUB="d15f1846-8f18-4ba0-9e2a-a6aaa7bbf83b" BLOCK_SIZE="4096" TYPE="btrfs" Not sure why the reported fstype is wrong but obviously it is a bug. TIA From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 13 05:59:59 2023 Received: (at 64588) by debbugs.gnu.org; 13 Jul 2023 09:59:59 +0000 Received: from localhost ([127.0.0.1]:53430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJt79-0005mp-H2 for submit@debbugs.gnu.org; Thu, 13 Jul 2023 05:59:59 -0400 Received: from mail-lf1-f43.google.com ([209.85.167.43]:46566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJt77-0005mT-JP; Thu, 13 Jul 2023 05:59:58 -0400 Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-4fb94b1423eso928114e87.1; Thu, 13 Jul 2023 02:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689242391; x=1691834391; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=DmaWzPXvozZhpyPtYIc+l6UcTzAN4BkBq3N1DE54Kqw=; b=qt+WXZN15bXliIjHNxMcHx9/At6ZJMl0N5TxHRKw02+EA+06FN7jVRvZvBKt2giC14 9w/lKM6n43Pi3gP3tMct6bjeTf4MmdRb5RWJnaHCMI46K4y0+3ObKBGIm5qX8r9EIqId 9hIf9RNX+oPHcO48tJN87WgdRE/f8UKTtvFM4Gqpp0EzPddbfxS9AE6tc+40t27NQ0mJ 3pidus94uETDdSgdK7KFPW1hJswgrj4iB4XLKx86/rpp34CF/1htulsAHbQGGxv0hiA4 nDFYQiSzg9oQDZqTJRdZc319MuWpqgl3Me9k7N4kJc2cm2Gj89rvjTJphWrsAKjcwRqg QDCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689242391; x=1691834391; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DmaWzPXvozZhpyPtYIc+l6UcTzAN4BkBq3N1DE54Kqw=; b=jx0OrsqQm5f0yoQ1jVnjZDyrlyCy7M0ScrmQd+AVgZjLmdJb6izDeeYxL6qo6JnzwJ akatfVW5hdvYsHZoRR0UPSBt5hRng4WdAeT6YuX9ZE02EdjxFtVfYwHE6DCu30wb55tw 0/EU5G/KuYMNg6E96QqUeydTIpxgc6tOI0d8T+tBJvbHfZXvCPSsIOdAO3PzpyzHCkgn Zc4mNBGO7LhdUB0eB9UKOcaC/soO2wQ5/vsuCb4BhropVXep9Dsy79MMiZQKkM81HWet JxC5nNdTL7GQqrO0CsdEVjJ9VKhs7LFBKXK6hjPFcYSIg3pm+X0wNW/9S1JLMP10hwnH 6uUg== X-Gm-Message-State: ABy/qLbHMD4IfqGE5DaJdHZ13BltBHToJU+f2waQSyls2ZVup7iURf/s CFm8yMDDCDCiZmza5eTKFAMkeCCbmfI= X-Google-Smtp-Source: APBJJlHOU03fN1g21wkysEutB6j9PkgZ0MLLgzHwmR7u/RD4Ng0rq9gPMYXOiUcBgCyiuCItzaqkoQ== X-Received: by 2002:a19:6557:0:b0:4fb:97e8:ed8c with SMTP id c23-20020a196557000000b004fb97e8ed8cmr794911lfj.4.1689242391008; Thu, 13 Jul 2023 02:59:51 -0700 (PDT) Received: from [192.168.1.20] (95-44-90-175-dynamic.agg2.lod.rsl-rtd.eircom.net. [95.44.90.175]) by smtp.googlemail.com with ESMTPSA id l21-20020a05600c1d1500b003f7f475c3bcsm2861572wms.1.2023.07.13.02.59.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Jul 2023 02:59:49 -0700 (PDT) Message-ID: Date: Thu, 13 Jul 2023 10:59:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#64588: BUG: stat -f incorrectly reports a BTRFS device as a tmpfs Content-Language: en-US To: "debug@roosoft.ltd.uk" , 64588@debbugs.gnu.org References: <2b14af65-77aa-718f-530e-c31d36aa6ddb@roosoft.ltd.uk> From: =?UTF-8?Q?P=C3=A1draig_Brady?= In-Reply-To: <2b14af65-77aa-718f-530e-c31d36aa6ddb@roosoft.ltd.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64588 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) tag 64588 notabug close 64588 stop On 12/07/2023 23:46, support wrote: > coreutils version 9.1-1 on Debian testing, but also exists in previous > versions. > > > Example: > > stat -f  /dev/sdb >   File: "/dev/sdb" >     ID: eb91af7d7bda02dd Namelen: 255     Type: tmpfs > Block size: 4096       Fundamental block size: 4096 > Blocks: Total: 2012292    Free: 2012292    Available: 2012292 > Inodes: Total: 2012292    Free: 2011839 > > > stat -f  /dev/disk/by-uuid/6abaa68a-2670-4d8b-8d2a-fd7321df9242 >   File: "/dev/disk/by-uuid/6abaa68a-2670-4d8b-8d2a-fd7321df9242" >     ID: eb91af7d7bda02dd Namelen: 255     Type: tmpfs > Block size: 4096       Fundamental block size: 4096 > Blocks: Total: 2012292    Free: 2012292    Available: 2012292 > Inodes: Total: 2012292    Free: 2011839 > > > blkid /dev/sdb > /dev/sdb: UUID="6abaa68a-2670-4d8b-8d2a-fd7321df9242" > UUID_SUB="d15f1846-8f18-4ba0-9e2a-a6aaa7bbf83b" BLOCK_SIZE="4096" > TYPE="btrfs" > > > Not sure why the reported fstype is wrong but obviously it is a bug. This is expected. From the info docs: "stat does not search for specified device nodes in the file system list, instead operating on them directly" I.e. /dev/sdb is a device node in the /dev file system, which is tmpfs. You can confirm this with: strace -e statfs stat -f -c %T /dev/sdb strace -e statfs df --output=fstype /dev/sdb If you wanted to operate on a file system mounted on the device node you could: stat -f $(df --output=target /dev/sdb | tail -n1) cheers, Pádraig From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 13 06:34:21 2023 Received: (at 64588) by debbugs.gnu.org; 13 Jul 2023 10:34:21 +0000 Received: from localhost ([127.0.0.1]:53441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJteP-0001Dr-9J for submit@debbugs.gnu.org; Thu, 13 Jul 2023 06:34:21 -0400 Received: from alt-proxy28.mail.unifiedlayer.com ([74.220.216.123]:33470) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJteJ-0001DP-0Y for 64588@debbugs.gnu.org; Thu, 13 Jul 2023 06:34:19 -0400 Received: from cmgw15.mail.unifiedlayer.com (unknown [10.0.90.130]) by progateway1.mail.pro1.eigbox.com (Postfix) with ESMTP id EC18E1003A102 for <64588@debbugs.gnu.org>; Thu, 13 Jul 2023 10:34:05 +0000 (UTC) Received: from box2278.bluehost.com ([50.87.176.218]) by cmsmtp with ESMTP id Jte9qwSeRgmQhJte9qFAdf; Thu, 13 Jul 2023 10:34:05 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=FpTAQ0nq c=1 sm=1 tr=0 ts=64afd31d a=XwlUGG/Joq/Evm8SRPjtJg==:117 a=XwlUGG/Joq/Evm8SRPjtJg==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10:nop_charset_1 a=ws7JD89P4LkA:10:nop_rcvd_month_year a=yWZkyvPI6HoA:10:endurance_base64_authed_username_1 a=vmPXowZO_TUHeKsXyB0A:9 a=QEXdDO2ut3YA:10:nop_charset_2 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roosoft.ltd.uk; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:Subject:From:Reply-To:References:To:MIME-Version:Date:Message-ID: Sender:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4xwVkPjwv6fi/0TaBY/LTOdVJvobdmnjobCUNp6TArc=; b=RZ8mmFE/FiU4KvtRBvl3ZyNXp+ kSt7JeW0prMZ8Uh00E/GjBCG3iRYPkAtgjMwzTVNGuSs3SEkx2PT49inWJErWoXz31WKsUeyd50J+ 9chMdycvcc4nu26qexKdu6fhz; Received: from host86-165-35-159.range86-165.btcentralplus.com ([86.165.35.159]:13700 helo=[192.168.1.158]) by box2278.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qJte9-002Re5-0a; Thu, 13 Jul 2023 04:34:05 -0600 Message-ID: <550f337c-6561-bf9e-3cb9-38ded4d30683@roosoft.ltd.uk> Date: Thu, 13 Jul 2023 11:33:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-CA To: =?UTF-8?Q?P=c3=a1draig_Brady?= , "debug@roosoft.ltd.uk" , 64588@debbugs.gnu.org References: <2b14af65-77aa-718f-530e-c31d36aa6ddb@roosoft.ltd.uk> From: support Subject: Re: bug#64588: BUG: stat -f incorrectly reports a BTRFS device as a tmpfs In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box2278.bluehost.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roosoft.ltd.uk X-BWhitelist: no X-Source-IP: 86.165.35.159 X-Source-L: No X-Exim-ID: 1qJte9-002Re5-0a X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: host86-165-35-159.range86-165.btcentralplus.com ([192.168.1.158]) [86.165.35.159]:13700 X-Source-Auth: support@roosoft.ltd.uk X-Email-Count: 1 X-Source-Cap: Y2FzYWRpbG87Y2FzYWRpbG87Ym94MjI3OC5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: 64588 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: "debug@roosoft.ltd.uk" Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Hmmm ok, Well the reason I flagged it as a bug, is because the btrfsmaintenance package uses a script to test to see if a filesystem is btrfs and incorrectly uses stat -f to do it. This must have worked in the past else they would not use it. The code snippet is: # function: is_btrfs # parameter: path to a mounted filesystem # # check if filesystem is a btrfs is_btrfs() {     local FS=$(stat -f --format=%T "$1")     [ "$FS" = "btrfs" ] && return 0     return 1 } Obviously that is targeted at mounted filesystems, but the documentation and usage always shows "|" as a parameter. I guess I should file a bug against that package but I am curious as to when the default behaviour changed. Thanks for your response. On 13/07/2023 10:59, Pádraig Brady wrote: > tag 64588 notabug > close 64588 > stop > > On 12/07/2023 23:46, support wrote: >> coreutils version 9.1-1 on Debian testing, but also exists in previous >> versions. >> >> >> Example: >> >> stat -f  /dev/sdb >>     File: "/dev/sdb" >>       ID: eb91af7d7bda02dd Namelen: 255     Type: tmpfs >> Block size: 4096       Fundamental block size: 4096 >> Blocks: Total: 2012292    Free: 2012292    Available: 2012292 >> Inodes: Total: 2012292    Free: 2011839 >> >> >> stat -f  /dev/disk/by-uuid/6abaa68a-2670-4d8b-8d2a-fd7321df9242 >>     File: "/dev/disk/by-uuid/6abaa68a-2670-4d8b-8d2a-fd7321df9242" >>       ID: eb91af7d7bda02dd Namelen: 255     Type: tmpfs >> Block size: 4096       Fundamental block size: 4096 >> Blocks: Total: 2012292    Free: 2012292    Available: 2012292 >> Inodes: Total: 2012292    Free: 2011839 >> >> >> blkid /dev/sdb >> /dev/sdb: UUID="6abaa68a-2670-4d8b-8d2a-fd7321df9242" >> UUID_SUB="d15f1846-8f18-4ba0-9e2a-a6aaa7bbf83b" BLOCK_SIZE="4096" >> TYPE="btrfs" >> >> >> Not sure why the reported fstype is wrong but obviously it is a bug. > > This is expected. From the info docs: > > "stat does not search for specified device nodes in the file system list, > instead operating on them directly" > > I.e. /dev/sdb is a device node in the /dev file system, which is tmpfs. > You can confirm this with: > >   strace -e statfs stat -f -c %T /dev/sdb >   strace -e statfs df --output=fstype /dev/sdb > > If you wanted to operate on a file system mounted on the device node > you could: > >   stat -f $(df --output=target /dev/sdb | tail -n1) > > cheers, > Pádraig From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 13 08:35:42 2023 Received: (at 64588) by debbugs.gnu.org; 13 Jul 2023 12:35:42 +0000 Received: from localhost ([127.0.0.1]:53565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJvXq-0007Ps-9y for submit@debbugs.gnu.org; Thu, 13 Jul 2023 08:35:42 -0400 Received: from mail-wr1-f42.google.com ([209.85.221.42]:56746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJvXo-0007Pd-H5 for 64588@debbugs.gnu.org; Thu, 13 Jul 2023 08:35:41 -0400 Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-31441dfbf97so827688f8f.1 for <64588@debbugs.gnu.org>; Thu, 13 Jul 2023 05:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689251734; x=1691843734; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=doOfBytlh+XNxDC5rYlNBHkGxfQTgM9ld1qT5Nz7F+M=; b=U3kM3AcL+p/jEdI4C+97LeJDkD0kWoxiBvouGpBn4OmZtLwE2kJBH2vjWDSC5OR+RU NDYxt/3ORp/FahlOYm9s6v9RzPiAUl88eo/arljkHeS0ANYVTOXMROGzkrrmEmKkla6b GQvnVR/ViaF6xLJdbt113I4qec4kDcNFkxbJuw1zSbyrjuZzULP+TP9st7Hlz4LryKml QBo4hC7YL8WzNkkLviFF2yi3tqdznHv4S8idPhwmHgqV3thfJjazNU8Sqj2c69vuCHcU DdgoheSzSdyHH53GBbTbfDU+12hkGqzwMR4CsOSAEHtdABdSS/jmh1o6LVZsyvCAqklL Kzqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689251734; x=1691843734; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=doOfBytlh+XNxDC5rYlNBHkGxfQTgM9ld1qT5Nz7F+M=; b=TNj9j6X+UNB6ODgp9xHPZCkhwCpnsMkT8mmH9ORHoooY7pWw2kLyc1KrdQANwO1izM LhsuiKDRHQRRSWffnzTUF+w2HsjkcVRFdCKo6iXX/x80ZDDJdUEuH0GafUKTSzkd5SMm rhIn61XGQjdMww73qWEzLoVte4BEEQ0VV6lwM5AxhEM+x2zfuNBK3P496TUMMBvbBBvj k0m+E9nzKsL+fSvkHndzb0xnlNhSogtbYQsi7ExgvK6K+HeTyQoHBQ5gP5EEL4CGklUg ijpgy7SiWzyPXWUCXTPGXEuHnVoJO9lIMO8881d3Tko0U/XnrvOWZ/3u3MhkhENwmZJ1 c4mA== X-Gm-Message-State: ABy/qLa+EOJl/szQyUo3U72s+aVAWg5i8NveiVr1Zg8HSkerx/NWHLpV fG3TsFw3gxF+CLgPIkB7PBAasgNJf30= X-Google-Smtp-Source: APBJJlFxwV5+ja8nWRxqM+J/fKAW7pFa/0xbWzCxK1xaEYDRcGHamY7LDymPpuT9nz0x51DJzMTMdA== X-Received: by 2002:a05:6000:11c9:b0:314:6252:d4a8 with SMTP id i9-20020a05600011c900b003146252d4a8mr1343758wrx.43.1689251733939; Thu, 13 Jul 2023 05:35:33 -0700 (PDT) Received: from [192.168.1.20] ([95.44.90.175]) by smtp.googlemail.com with ESMTPSA id y7-20020a5d6147000000b0031412b685d2sm7871710wrt.32.2023.07.13.05.35.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Jul 2023 05:35:32 -0700 (PDT) Message-ID: <3d011971-e7c3-0cdb-6fda-bc81e336814e@draigBrady.com> Date: Thu, 13 Jul 2023 13:35:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#64588: BUG: stat -f incorrectly reports a BTRFS device as a tmpfs Content-Language: en-US To: "debug@roosoft.ltd.uk" , 64588@debbugs.gnu.org References: <2b14af65-77aa-718f-530e-c31d36aa6ddb@roosoft.ltd.uk> <550f337c-6561-bf9e-3cb9-38ded4d30683@roosoft.ltd.uk> From: =?UTF-8?Q?P=C3=A1draig_Brady?= In-Reply-To: <550f337c-6561-bf9e-3cb9-38ded4d30683@roosoft.ltd.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 64588 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) On 13/07/2023 11:33, support wrote: > Hmmm ok, > > Well the reason I flagged it as a bug, is because the btrfsmaintenance > package uses a script to test to see if a filesystem is btrfs and > incorrectly uses stat -f to do it. This must have worked in the past > else they would not use it. > > The code snippet is: > > > # function: is_btrfs > # parameter: path to a mounted filesystem > # > # check if filesystem is a btrfs > is_btrfs() { >     local FS=$(stat -f --format=%T "$1") >     [ "$FS" = "btrfs" ] && return 0 >     return 1 > } > > > Obviously that is targeted at mounted filesystems, but the documentation > and usage always shows "|" as a parameter. > > I guess I should file a bug against that package but I am curious as to > when the default behaviour changed. It has never changed AFAIK thanks, Pádraig From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 13 12:02:20 2023 Received: (at 64588) by debbugs.gnu.org; 13 Jul 2023 16:02:20 +0000 Received: from localhost ([127.0.0.1]:40645 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJylo-0001lN-G1 for submit@debbugs.gnu.org; Thu, 13 Jul 2023 12:02:20 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:38711) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJyll-0001l9-Bv for 64588@debbugs.gnu.org; Thu, 13 Jul 2023 12:02:18 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4R1zrk3J5Dz1r6nK; Thu, 13 Jul 2023 18:02:14 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 4R1zrj72pfz1qqlS; Thu, 13 Jul 2023 18:02:13 +0200 (CEST) X-Virus-Scanned: amavis at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavis, port 10024) with ESMTP id nxwszM3QVcf9; Thu, 13 Jul 2023 18:02:13 +0200 (CEST) X-Auth-Info: pqusni/OTAX+se91kn33Hm8FuNvamPrpwvLssEjFWvz9Um1YOMLRNQqv/Ki3e7l5 Received: from igel.home (aftr-62-216-205-205.dynamic.mnet-online.de [62.216.205.205]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 13 Jul 2023 18:02:13 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id 1901D2C1389; Thu, 13 Jul 2023 18:02:13 +0200 (CEST) From: Andreas Schwab To: support Subject: Re: bug#64588: BUG: stat -f incorrectly reports a BTRFS device as a tmpfs In-Reply-To: <550f337c-6561-bf9e-3cb9-38ded4d30683@roosoft.ltd.uk> (support@roosoft.ltd.uk's message of "Thu, 13 Jul 2023 11:33:57 +0100") References: <2b14af65-77aa-718f-530e-c31d36aa6ddb@roosoft.ltd.uk> <550f337c-6561-bf9e-3cb9-38ded4d30683@roosoft.ltd.uk> X-Yow: I'm young.. I'm HEALTHY.. I can HIKE THRU CAPT GROGAN'S LUMBAR REGIONS! Date: Thu, 13 Jul 2023 18:02:12 +0200 Message-ID: <87zg3zajgb.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 4.5 (++++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Jul 13 2023, support wrote: > # function: is_btrfs > # parameter: path to a mounted filesystem A device node is not a path to a mounted filesystem Content analysis details: (4.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.18.0.9 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [212.18.0.9 listed in wl.mailspike.net] 2.5 RCVD_IN_SORBS_HTTP RBL: SORBS: sender is open HTTP proxy server [62.216.205.205 listed in dnsbl.sorbs.net] 2.4 RCVD_IN_SORBS_SOCKS RBL: SORBS: sender is open SOCKS proxy server 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 64588 Cc: 64588@debbugs.gnu.org, "debug@roosoft.ltd.uk" , =?utf-8?Q?P=C3=A1draig?= Brady X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 3.5 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Jul 13 2023, support wrote: > # function: is_btrfs > # parameter: path to a mounted filesystem A device node is not a path to a mounted filesystem Content analysis details: (3.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.18.0.9 listed in list.dnswl.org] 2.5 RCVD_IN_SORBS_HTTP RBL: SORBS: sender is open HTTP proxy server [62.216.205.205 listed in dnsbl.sorbs.net] 2.4 RCVD_IN_SORBS_SOCKS RBL: SORBS: sender is open SOCKS proxy server 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [212.18.0.9 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager On Jul 13 2023, support wrote: > # function: is_btrfs > # parameter: path to a mounted filesystem A device node is not a path to a mounted filesystem -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." From unknown Thu Jun 19 14:31:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 11 Aug 2023 11:24:12 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator