df -x tmpfs fails to exclude udev (/dev)

Bug #1219529 reported by Daniel Barrett
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
coreutils
New
Undecided
auto-15257
coreutils (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

The command:

$ /bin/df -x tmpfs

should exclude all filesystems of type tmpfs. The udev filesystem mounted at /dev is of this type:

$ stat -f /dev
  File: "/dev"
    ID: 0 Namelen: 255 Type: tmpfs
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 4109101 Free: 4109098 Available: 4109098
Inodes: Total: 4109101 Free: 4108501

However, df still displays this filesystem:

$ df -l -x tmpfs
Filesystem 1K-blocks Used Available Use% Mounted on
...
udev 16436404 12 16436392 1% /dev
...

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: coreutils 8.20-3ubuntu5
ProcVersionSignature: Ubuntu 3.8.0-29.42-generic 3.8.13.5
Uname: Linux 3.8.0-29-generic x86_64
ApportVersion: 2.9.2-0ubuntu8.3
Architecture: amd64
Date: Sun Sep 1 15:05:40 2013
InstallationDate: Installed on 2013-08-31 (0 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
MarkForUpload: True
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: coreutils
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Daniel Barrett (dbarrett-m) wrote :
Revision history for this message
C de-Avillez (hggdh2) wrote :

Thank you for opening this bug and helping make Ubuntu better. Indeed 'stat' states /dev is tmpfs.

But 'mount' gives out the type as 'devtmpfs' (!):

hggdh@chatto:~$ mount | grep udev
udev on /dev type devtmpfs (rw,mode=0755)
hggdh@chatto:~$

and, then, 'df -x devtmpfs' works as expected:

hggdh@chatto:~$ df -x devtmpfs
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/vda 20511356 2518264 16944516 13% /
none 4 0 4 0% /sys/fs/cgroup
tmpfs 50300 232 50068 1% /run
none 5120 0 5120 0% /run/lock
none 251484 52 251432 1% /run/shm
none 102400 0 102400 0% /run/user
hggdh@chatto:~$

 But 'info mount', or 'man mount' do not list 'devtmpfs' as a valid system type. But 'devtmpfs' *is* a kernel-supported type...

I am not sure this is a coreutils issue per se; needs more research.

Changed in coreutils (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
tags: added: saucy
Revision history for this message
C de-Avillez (hggdh2) wrote :

OTOH, 'stat' *is* coreutils... so confirming. At least 'stat' and 'df' should should agree.

Changed in coreutils (Ubuntu):
status: Incomplete → Confirmed
C de-Avillez (hggdh2)
Changed in coreutils (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Daniel Barrett (dbarrett-m) wrote :

This bug still exists in 15.10 - confirming.

Revision history for this message
Bryce Harrington (bryce) wrote :

20.04's coreutils still has the behavior described in this bug. /dev is listed as type 'udev' by df but df -x udev does not exclude it; df -x devtmpfs does.

I wonder if one way to at least resolve the confusion might be to make the code that prints the table display devtmpfs devices as 'devtmpfs'. An obvious alternative would be to make '-x udev' be handled like '-x udev -x devtmpfs'. Another alternative would be to overload '-x tmpfs' to exclude also udev and devtmpfs. It's not clear what the best solution would be.

Bryce Harrington (bryce)
Changed in coreutils (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package coreutils - 8.30-3ubuntu3

---------------
coreutils (8.30-3ubuntu3) groovy; urgency=medium

  * d/p/treat-devtmpfs-and-squashfs-as-dummy-filesystems.patch:
    - Avoid displaying snaps in output from df and other tools, by
      excluding display of squashfs filesystems.
      (LP: #1219529, #1756595)
    - Exclude devtmpfs filesystems in output from df and other tools
      since it is a dummy filesystem.
      (LP: #1219529)

 -- Bryce Harrington <email address hidden> Thu, 02 Jul 2020 02:30:48 +0000

Changed in coreutils (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.