You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Linux下df命令为何不显示sysfs与procfs文件系统?

Why aren't sysfs and procfs showing up in df -Th output?

Question:

When I run the df -Th command, I only get the following output:

$ 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 aren't sysfs and procfs showing up? I thought the df command would display all filesystems on the computer.


Answer:

Great question! The reason you don't see sysfs and procfs in your default df -Th output is because df intentionally filters out certain virtual filesystems by default. Let's break this down:

  • Default df behavior: df is built to focus on filesystems that use actual persistent or memory-backed storage (like your ext4 root partition, vfat EFI partition, or tmpfs mounts). Sysfs and procfs are virtual filesystems—they don't store data on disk at all. Instead, they act as live interfaces to kernel data, exposing system and hardware information in real time. Since they have no meaningful "disk usage" metrics (their size/used values would be 0 or irrelevant), df excludes them by default to avoid cluttering the output with non-storage-related filesystems.

  • How to view all filesystems: If you want to see every single mounted filesystem—including sysfs, procfs, and other virtual ones like cgroup2 or devpts—use the -a (short for --all) flag. Run this command:

    df -aTh
    

    You'll now see all mounted filesystems, including the virtual ones you were missing.

  • Why tmpfs shows up: You might notice tmpfs entries in your original output even without -a—that's because tmpfs uses system RAM (and swap if enabled) to store temporary data. Unlike sysfs/procfs, tmpfs has measurable size and usage values, so df includes it by default as it behaves like a traditional storage filesystem (just in memory).

内容的提问来源于stack exchange,提问作者Autechre

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 16:35:13