On Thu, Feb 10, 2005 at 06:19:56AM -0600, Ron Johnson wrote:
> I'll file bugs against gtkdiskfree & pydf. Now that I understand
> this more (thanks, MdI), I see that df has a way to exclude bind
> mounts.
>
> $ df -T
> Filesystem Type 1K-blocks Used Available Use% Mounted on
> /dev/hda3 ext3 9843308 5430908 3912380 59% /
> tmpfs tmpfs 501936 0 501936 0% /dev/shm
> /dev/hda2 ext3 46668 20415 23844 47% /boot
> /dev/hda5 reiserfs 2995936 1988176 1007760 67% /home
> /dev/hda6 ext3 105280504 79520128 20412340 80% /data
> /dev unknown 9843308 5430908 3912380 59% /.dev
> none tmpfs 5120 2564 2556 51% /dev
>
> $ df -x unknown
> Filesystem 1K-blocks Used Available Use% Mounted on
> /dev/hda3 9843308 5430908 3912380 59% /
> tmpfs 501936 0 501936 0% /dev/shm
> /dev/hda2 46668 20415 23844 47% /boot
> /dev/hda5 2995936 1987864 1008072 67% /home
> /dev/hda6 105280504 79523152 20409316 80% /data
> none 5120 2564 2556 51% /dev
Hm. On my system, at least, df -T has "none", not "unknown", in the
Type column for bind mounts.
But in any case, excluding all bind mounts doesn't work in general.
Consider an example:
mount /dev/hda7 /mnt/
mount --bind /mnt/foo /A
mount --bind /mnt/bar /B
umount /mnt/
Now you're left with two different pieces of the filesystem on /dev/hda7
mounted. But both mounts are bind mounts. Surely you don't want to
exclude both. You could include only one but not the other if you
wanted, though this is somewhat inelegant since the choice is completely
arbitrary--there's no way to decide whether /A or /B is the more
important mountpoint to list.
So --bind mounts are just like hard links; multiple names for the same
object (or parts of the same object).
In something like df I think the sensible thing to do is just to
continue to list all bind mounts, even when it's redundant.
For a graphical tool I think you'd only want one visual object for each
filesystem, but you'd want all the paths that filesystem is mounted on
listed, so you might end up with filesystems that are labeled by a list
of names instead of a single name.
--Bruce Fields