Friday 29 May 2020

Re: Adjusting what fstypes df displays

On Fri, May 29, 2020 at 11:15:27AM -0300, Rafael David Tinoco wrote:
> On 29/05/2020 11:03, Robie Basak wrote:
> > +1 for Bryce's approach.
> >
> > On Fri, May 29, 2020 at 10:56:34AM -0300, Rafael David Tinoco wrote:
> >> Perhaps this environment variable should be set by snapd package ?
> > I think this could be surprising - because we would be hiding all
> > squashfs filesystems from df, not just snapd ones. I think it would be
> > cleaner to consider that users don't generally want to see squashfs
> > stuff in df output by default anyway, and so hide it Ubuntu-wide.
> >
> > I'm less sure about tmpfs. I can think of occasions where I have wanted
> > to see tmpfs usage (since it can run out, and has run out on me before).
> > But that's perhaps too much of a specialist case, and so I think it's
> > also OK to hide tmpfs by default from df on Ubuntu.
> I'm wondering if having an optarg to disconsider the environment
> variable would be appropriate. And sorry if that was already considered
> Bryce, I haven't looked into your code.

I didn't include a cli arg, but that effect can be achieved by:

$ DF_EXCLUDE_FSTYPES= df

I did make sure the env var plays well with -t, so if you *just* want to
see tmpfs and squashfs filesystems, for instance, then this would do it:

$ df -t tmpfs -t squashfs

(Note that if you've aliased df to 'df -x tmpfs' this will break if you
try to also -t tmpfs; those options are mutually exclusive, and df will
error.)

You can also get df to display everything, including normally hidden
filesystems via:

$ df -a

For my desktop this shows 79 entries, including cgroup and nsfs stuff
(that apparently snap uses) which aren't shown by default. The -T flag
is handy to use with -a to help figure out what's what.

$ df -a -T

Thanks for the feedback,
Bryce


--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel