df does not report my root file system

Rob Landley rob at landley.net
Tue Jul 11 14:56:25 UTC 2006


On Monday 10 July 2006 3:37 am, Ming-Ching Tiew wrote:
> This is the output of  these commands :-
>
> # ls -al /dev/ram0 /dev/root
> brw-rw----  1  root root 1, 0 July 10 15:30 /dev/ram0
> lrwxrwxrwx 1 root root     9 July 10 15:30 /dev/root -> /dev/ram0
> # cat /proc/mounts
> rootfs / rootfs rw 0 0
> /proc /proc proc rw 0 0
> # df
> Filesystem 1k-blocks Used Available
> (blank output except for the header )
>
> This is executed in initramfs.
>
> Now my problem is that 'df' does not report the root filesystem.
> What do I have to do to make it report the root files system ?
>
> Regards.

Yeah, df is broken.  I need to upgrade it.

I have a todo item to make df sort the mount points and show the most recent 
of each.  The problem is that rootfs is always mounted even when you're not 
using initramfs (or after you've pivoted off of it).  In most systems another 
partition gets mounted over it during normal use, and so we needed to add 
extra logic to avoid df showing a partition you can't access.

The _correct_ fix would have been to accumulate a list of mount points and 
kill duplicates, showing only the latest of each.  What we did is special 
case the root mount so we never show rootfs, which is wrong and broken and 
doesn't give the right result if something _else_ is overmounted.  (Which 
isn't a common case, but is easily possible with bind mounts or ubuntu 6.06's 
broken init scripts that mount /var/run and /var/lock _twice_ (it's tmpfs, 
they stack)...)

I'll fix it.

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list