root@pep:/bin # df Filesystem 1K-blocks Used Available Use% Mounted on /dev/root 984871 332387 652484 34% / /dev/ram 452360 536 451824 0% /var root@pep:/bin # df -m /var Filesystem 1M-blocks Used Available Use% Mounted on /dev/ram 442 1 441 0% /var root@pep:/bin # df -m / Filesystem 1M-blocks Used Available Use% Mounted on that's it, no output.
root@pep:/bin # df -m /dev/root Filesystem 1M-blocks Used Available Use% Mounted on df: /dev/root: can't find mount point df works fine on /dev/ram as well as other devices mounted
Fix: http://busybox.net/downloads/fixes-1.14.2/busybox-1.14.2-df.patch # ./busybox df -m / Filesystem 1M-blocks Used Available Use% Mounted on /dev/root 942 611 283 68% / Please confirm that it works for you. > root@pep:/bin # df -m /dev/root > Filesystem 1M-blocks Used Available Use% Mounted on > df: /dev/root: can't find mount point df (GNU coreutils) 6.9 can't do it too on my home machine. Why? It does not work if /dev/root actually does not exist. find_mount_point() stat's /dev/root and matches its device number to each entry in /proc/mounts, it does not do only textual match. So, if there is not /dev/root, stat fails and nothing matches.
patch fixes the "df /" issue. propose to close this bug entry as "df /dev/root" for not existing mount point behaves like coreutils. Thanks!