Random notes from mg

a blog by Marius Gedminas

Marius is a Python hacker. He works for Programmers of Vilnius, a small Python/Zope 3 startup. He has a personal home page at http://gedmin.as. His email is marius@gedmin.as. He does not like spam, but is not afraid of it.

Wed, 15 Jul 2009

df

Modern Linux system have all sorts of fake filesystems cluttering the output of df and mount: tmpfs, bind mounts, fuse for ~/.gvfs, etc. I have only one real partition on my laptop, yet mount returns 22 lines of output.

Question: are there any df-like utilities that filter out all the crap and show only interesting bits? The standard df as well as pydf both display 8 lines instead of 1. Discus is worse: it shows 20. GUI utilities like Baobab also suffer from this confusion, especially bind mounts.

Ironically, Ubuntu's update-motd gets confused by Ubuntu's private user directories and displays disk stats for ~/Private as if it were a real partition.

posted at 01:33 | tags: | permanent link to this entry | 11 comments
df --type=ext3

or whatever file type you use. Putting this in a bash alias like

alias df='df --type=ext3'

will make df work like you wish.
posted by Gary at Wed Jul 15 04:20:08 2009
Hi

you can use df -t  show only specific filesystem types and
df -x to show everything but selected filesystems types

For instance

df -x tmpfs

will dramatically reduce the number of filesystems shown (most probably all the house keeping ones you don't need to see most of the time)
posted by Tim Hoffman at Wed Jul 15 04:26:01 2009
Is this too difficult?

$ alias gdf="df -h /partitionyoucareabout"
$ gdf
Filesystem  Size  Used Avail Use% Mounted on
/dev/sda1  286G  148G  124G  55% /
posted by bob at Wed Jul 15 05:48:04 2009
df it self can filter out, from the man page of df:


df displays the amount of disk space available on the file system containing each file name  argument.
posted by Ramūnas Gutkovas at Wed Jul 15 10:28:03 2009
For your own case, I'd recommend "df /", even if it's not a new utility...
posted by . at Wed Jul 15 10:43:43 2009
On Solaris it's posible to do a "df -h -F zfs" which only shows ZFS type filesystems and not all pseudo filesystems.
posted by Daniel van Eeden at Wed Jul 15 18:44:27 2009
On Solaris it's posible to do a "df -h -F zfs" which only shows ZFS type filesystems and not all pseudo filesystems. On linux the syntax is "df -h -t ext3".
posted by Daniel van Eeden at Wed Jul 15 18:45:37 2009
df / /home
posted by damjan at Wed Jul 15 19:21:14 2009
Thank you all for the answers, but I was more interested in the filtering logic (how can a tool determine which mountpoints are interesting?) than a specific answer for one particular case (df -h . is what I typically use).
posted by Marius Gedminas at Wed Jul 15 23:24:08 2009
You can add all non-interesting mountpoints to ~/.discusrc file, look at mine. I always use discus rather than df
posted by menesis at Thu Jul 16 11:18:20 2009
How the hell is that ironic? Tell me.
posted by L at Thu Jul 16 20:09:18 2009

Name (required)


E-mail (will not be shown)


URL


Comment (some HTML allowed)