Subject: Re: df vs devices
To: None <tech-userlevel@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 01/09/2006 14:23:03
>> Traditionally, on NetBSD (and on older BSDs), df on a disk device
>> has shown space on the filesystem on that device, even if the device
>> is not mounted anywhere at the time.

>> Doesn't work that way on 2.0; instead, it shows the space on the
>> filesystem holding the special device file (typically /).

> In the old days, df used to actually open the device and interpret
> the UFS data structures to glean the free space.

Well, obviously; it couldn't very well get it any other way.

> "Ick."

Why?

> I consider the current behavior to be correct.  Any other behavior
> would require adding file system-specific knowledge to df for every
> file system that works on NetBSD.

No, only those for which we want df on an unmounted device to work.  A
few (one? two?) of the commonest would win most of the gain with
comparatively little of the pain.

I certainly prefer it to having to wait for fsck to run - or risk
mounting the device without - just to get some idea how full it is.
It's not as if df would have to contain any significant fraction of the
ffs code; I think all the necessary values are in the superblock
itself, even.  (Filesystems for which no analogous statement is true
would be prime candidates for leaving out of df, of course.)

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B