What does df command use to get Used column?

2009-03-12 Thread Peter Steele
A typical df command looks like this: 

# df -h 
Filesystem Size Used Avail Capacity Mounted on 
/dev/mirror/gm0a 4.8G 2.0G 2.4G 46% / 
devfs 1.0K 1.0K 0B 100% /dev 
linprocfs 4.0K 4.0K 0B 100% /proc 
/dev/mirror/gm0d 3.9G 88K 3.6G 0% /tmp 
/dev/mirror/gm0e 15G 79M 13G 1% /var 
/dev/ad4s3e 116G 2.3M 107G 0% /v0 
/dev/ad6s3e 116G 2.2M 107G 0% /v1 
/dev/ad8s3e 116G 2.1M 107G 0% /v2 
/dev/ad10s3e 116G 2.1M 107G 0% /v3 

I know what calls to make to get the Size and Avail columns. I'm not sure 
what df does to get the value for the Used column. Anyone know how df gets 
this value? 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: What does df command use to get Used column?

2009-03-12 Thread Bruce Cran
On Thu, 12 Mar 2009 15:59:54 -0700 (PDT)
Peter Steele pste...@maxiscale.com wrote:

 A typical df command looks like this: 
 
 # df -h 
 Filesystem Size Used Avail Capacity Mounted on 
 /dev/mirror/gm0a 4.8G 2.0G 2.4G 46% / 
 devfs 1.0K 1.0K 0B 100% /dev 
 linprocfs 4.0K 4.0K 0B 100% /proc 
 /dev/mirror/gm0d 3.9G 88K 3.6G 0% /tmp 
 /dev/mirror/gm0e 15G 79M 13G 1% /var 
 /dev/ad4s3e 116G 2.3M 107G 0% /v0 
 /dev/ad6s3e 116G 2.2M 107G 0% /v1 
 /dev/ad8s3e 116G 2.1M 107G 0% /v2 
 /dev/ad10s3e 116G 2.1M 107G 0% /v3 
 
 I know what calls to make to get the Size and Avail columns. I'm
 not sure what df does to get the value for the Used column. Anyone
 know how df gets this value? 

Line 417 of /usr/src/bin/df/df.c:

used = sfsp-f_blocks - sfsp-f_bfree;

-- 
Bruce
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: What does df command use to get Used column?

2009-03-12 Thread Peter Steele
Line 417 of /usr/src/bin/df/df.c: 
 
used = sfsp-f_blocks - sfsp-f_bfree; 

I keep forgetting that I can go directly to the source to answer questions like 
this. Thanks muchly; this is exactly what I need. 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org