[BusyBox] Serious bug in find_mount_point.c

Brent Roman brent at mbari.org
Fri Mar 11 20:16:02 UTC 2005


Larry,

I'm copying this to the list in case anyone there wants to
dig into this issue...

OK.  Guess I jumped the gun.
Here's some info, if you want to dig further

The system that produced the /dev/root: no such file or directory message
is running Fedora 2 with kernel 2.6.7.   Here's its /proc/mounts:

rootfs / rootfs rw 0 0
/dev/root / ext3 rw 0 0
/proc /proc proc rw,nodiratime 0 0
/sys /sys sysfs rw 0 0
none /dev/pts devpts rw 0 0
usbdevfs /proc/bus/usb usbdevfs rw 0 0
/dev/hda2 /boot ext3 rw 0 0
none /dev/shm tmpfs rw 0 0
/dev/hda6 /home ext3 rw 0 0
automount(pid1899) /net autofs rw 0 0
automount(pid1897) /misc autofs rw 0 0

When I run busybox df /dev/root on this box, it complains:

./df /dev/root
Filesystem           1k-blocks      Used Available Use% Mounted on
df: /dev/root: can't find mount point.

The system where coreutils df /dev/root produces:

$ /bin/df /dev/root
Filesystem           1K-blocks      Used Available Use% Mounted on
none                         0         0         0   -  /dev

$ /bin/df --version
df (coreutils) 5.2.1

$ uname -a
Linux bufflehead 2.4.26-win4lin-r12 #22 Wed Mar 9 22:55:58 PST 2005 i686
Pentium III (Coppermine) GenuineIntel GNU/Linux

$ cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / ext3 rw,noatime 0 0
none /dev devfs rw 0 0
none /proc proc rw 0 0
none /proc/bus/usb usbfs rw 0 0
none /dev/shm tmpfs rw 0 0
/dev/sdb2 /tmp ext3 rw,noatime 0 0
/dev/sdb5 /home ext3 rw,noatime 0 0
/dev/sda7 /redhat ext3 ro 0 0
/dev/hda3 /archive ext3 ro 0 0
/dev/hda1 /boot ext2 ro 0 0
/dev/sdb1 /boot-scsi ext2 ro 0 0
automount(pid2201) /net autofs rw 0 0
automount(pid2211) /smb autofs rw 0 0
automount(pid2221) /misc autofs rw 0 0
/dev/auto/cdr /misc/cdr iso9660 ro,nosuid,nodev 0 0


This box is running the latest gentoo "release"
busybox df /dev/root works properly on this box.

At *this* point I'm starting to suspect a change in glibc behavior
might be the root cause of this.  The busybox systems run
libc-2.2.5.  The gentoo box runs libc-2.3.4.  The fedora 2 box
runs libc-2.3.3.

-brent



Larry Doolittle wrote:

>Brent -
>
>  
>
>>It appears that the kernel version impacts df's behavior.
>>With a 2.4 Kernel you will see the behavior I originally
>>described, on 2.6 Kernel based systems, df /dev/root
>>behaves as you describe.  Neither seem correct to
>>me. /dev/root is, by definition, the root filesystem device.
>>So, df /dev/root should return the stats for the root filesystem.
>>
>>Anyway, I only mentioned it because, with busybox, we
>>usually assume that we must emulate the coreutils, warts
>>and all.
>>
>>By the way, my busybox systems all run 2.4 kernels.
>>    
>>
>
>$ df /dev/root
>df: `/dev/root': No such file or directory
>$ uname -a
>Linux clones 2.4.25-1-386 #2 Wed Apr 14 19:38:08 EST 2004 i686 GNU/Linux
>$ cat /etc/debian_version
>3.1
>$ mount
>/dev/hda1 on / type ext3 (rw,errors=remount-ro)
>proc on /proc type proc (rw)
>devpts on /dev/pts type devpts (rw,gid=5,mode=620)
>tmpfs on /dev/shm type tmpfs (rw)
>/dev/hda6 on /home type ext3 (rw)
>usbfs on /proc/bus/usb type usbfs (rw)
>$
>
>I suspect it has less to do with kernel version than
>general system setup and boot architecture.  Debian
>tends to be somewhat more spartan than most other
>Linux distributions, and as time permits I get out
>the weed-whacker to trim it back even more.
>
>     - Larry
>  
>


-- 
Brent Roman                                   MBARI
Software Engineer               Tel: (831) 775-1808
7700 Sandholdt Road,         Moss Landing, CA 95039
mailto:brent at mbari.org  http://www.mbari.org/~brent




More information about the busybox mailing list