On my WL-700gE (with root mounted from the internal harddrive), I have
the following problem:
# df /var/cache/polipo /
Filesystem 1k-blocks Used Available Use% Mounted on
#
Of course, this `df' is busybox's implementation of `df'.
# type df
df is a tracked alias for /bin/df
# l /bin/df
lrwxrwxrwx 1 root root 7 Jul 4 04:39 /bin/df -> busybox*
# opkg list_installed|grep busybox
busybox - 1.8.2-1 -
#
Now `df' without any arguments does list the relevant info, tho with
slightly odd information: note how /dev/hde1 is listed for the /rom
mounted from squashfs.
# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hde1 832 832 0 100% /rom
tmpfs 31208 16 31192 0% /tmp
tmpfs 512 0 512 0% /dev
/dev/hde1 9621848 3805500 5327572 42% /
/dev/hde2 965976588 575874500 390102088 60% /part3
#
In general, it's not like this is a big deal, but it breaks a little
script of mine that checks the disk's usage to know when my polipo cache
needs to be trimmed. `df' returns correctly the usage info when used on
other partitions:
# df /part3
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hde2 965976588 575874500 390102088 60% /part3
#
I tried the following, just to see if it made any difference, but to no avail:
# mount -o bind /var/cache /var/cache
# df / /var/cache/polipo
Filesystem 1k-blocks Used Available Use% Mounted on
#
The mount info is:
# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root /rom squashfs ro 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev 0 0
tmpfs /dev tmpfs rw,size=512k 0 0
devpts /dev/pts devpts rw,mode=600 0 0
/dev/hde1 / ext3 rw,noatime,errors=continue,data=ordered 0 0
/dev/hde2 /part3 ext3 rw,noatime,errors=continue,data=ordered 0 0
none /proc/bus/usb usbfs rw 0 0
#
Not sure if the problem is in the mount info, which results from
mounting squashfs at boot, then mounting my root onto /mnt, and finally
pivotting, which I do in /sbin/mount_root as follows:
rootdev=/dev/hde1
mount "$rootdev" /mnt && [ -x /mnt/sbin/init ] && {
echo "mounted $rootdev" >>/tmp/stef
. /bin/firstboot
pivot /mnt /rom
exit
}
This said, if I use Debian's `df' binary (from the coreutils package)
rather than busybox's, it works correctly:
# /debian/bin/df /var/cache/polipo/ /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hde1 9621848 3805500 5327572 42% /
/dev/hde1 9621848 3805500 5327572 42% /
#
So even if the mount data might not be completely correct, somehow
coreutils's `df' is able to sort it out.
Stefan
_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel