Is there a flag I can pass to either `df` or `mount` to make them display results for only locally-mounted filesystems?

13,312

Solution 1

Okay, as seems to be the case 75% of the time, I've actually tripped over the answer to my own question. The -t and -x flags for df will do what I'm looking for.

-t [type] will list filesystems matching fs TYPE [type]

-x [type] will list filesystems NOT matching fs TYPE [type]

I.e., for me to exclude NFS-mounted filesystems, the command is df -x nfs.

Solution 2

df -l. This depends on network filesystems being properly identified as such, though.

Share:
13,312

Related videos on Youtube

RebornGeek
Author by

RebornGeek

MacLinuxSysAdminWordPressTwitterHumo[u]rGeekStephensonMUDsButNotWoW phew!

Updated on September 18, 2022

Comments

  • RebornGeek
    RebornGeek almost 2 years

    I'm getting mighty tired of having to manually egrep out NFS- and SMB-mounted filesystems whenever I am checking on the condition of locally-mounted filesystems. So, my question is thus: is there some combination of flags that I can pass to either df or mount that will force them to display ONLY local filesystems and skip any and all network-mounted ones?

  • рüффп
    рüффп over 5 years
    Super, very straightforward solution.
  • maletin
    maletin about 5 years
    df -l still shows many loop-devices like /snap/gnome-calculator or /snap/core/
  • bviktor
    bviktor over 4 years
    What does "property identified" mean? Must it have the _netdev mount option, or is it some other detection logic in the background?