Date: Thu, 18 Jun 2009 14:05:12 +0200 From: Nick Hibma <nick@van-laarhoven.org> To: FreeBSD Embedded Mailing List <freebsd-embedded@FreeBSD.org> Subject: nanobsd disk usage display Message-ID: <200906181405.13008.nick@van-laarhoven.org>
index | next in thread | raw e-mail
We use an extra function to display the amount of free space on the image.
But it is not entirely accurate:
disk_usage () {
sync; sync; sync
set -- `du -sk $NANO_WORLDDIR/`
used=$1
set -- `ls -sk $NANO_DISKIMGDIR/_.disk.image`
size=$1
avail=$(( $size - $used ))
availp=$(( ${avail}00 / $size))
pprint 1 "disk usage: $used of $size used, $avail available
($availp%)"
}
last_orders () {
disk_usage
}
Shall I commit this or does anyone have a better idea on how to do this?
Nick
-------------------------------------------------------
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906181405.13008.nick>
