Home > Mobile >  Why sysfs and procfs aren't displayed by df on Linux?
Why sysfs and procfs aren't displayed by df on Linux?

Time:01-21

When I type df -Th I only get this :

$ df -Th
Filesystem     Type   Size  Used Avail Use% Mounted on
tmpfs          tmpfs  987M  2.1M  984M   1% /run
/dev/sda3      ext4    59G   34G   23G  60% /
tmpfs          tmpfs  4.9G     0  4.9G   0% /dev/shm
tmpfs          tmpfs  5.0M  4.0K  5.0M   1% /run/lock
/dev/sda1      vfat   197M   29M  169M  15% /boot/efi
tmpfs          tmpfs  987M  4.7M  982M   1% /run/user/1000

Why sysfs and procfs aren't displayed ? I thought df had to display all the file systems on my computer.

Thx!

CodePudding user response:

(This answer assumes you are using df from the GNU coreutils)

This is the intended behavior, as df will not show all mounted filesystems unless explicitely asked to with -a (see here for the discard rules). In the case of sysfs and procfs, they are discarded since they are marked as dummy filesystems.

The mount list is obtained from GNU Gnulib and it has rules about which filesystems it marks as dummy: see here.

  • Related