[BusyBox] booting, NFS root and busybox issues

Robert P. J. Day rpjday at mindspring.com
Thu Dec 11 21:29:30 UTC 2003


  after much more experimentation, here's my current dilemma. in all
fairness, i think it has as much to do with mounting a root filesystem
over NFS as it does with busybox, but after you read it, i'm definitely
open to suggestions.

  first, i'm using the same kernel in all of the below.  to begin
with, i have a root filesystem i got from elsewhere, with properties:

  devfs-based
  busybox-0.60.3 (with mount capability)
  a separate /sbin/mount executable

this root filesystem is staying on the server, and is exported "rw"
to the eval board.  when i download the kernel, i use a linux boot
line with (in part) the parameter:

  nfsroot=10.0.0.1:/<rootfs on server>

in this first configuration, i get the kernel messages:
------------------------------
...
Looking up port of RPC 100003/2 on 10.0.0.1                                     
Looking up port of RPC 100005/1 on 10.0.0.1                                     
VFS: Mounted root (nfs filesystem) readonly.                                    
Mounted devfs on /dev                                                           
init started:  BusyBox v0.60.2 (2002.03.20-02:39+0000) multi-call 
Remounting th.
Mounting local file systems...                                                  
not mounted anything                                                            
Initializing random number generator... done.                                   
                                                                                
Please press Enter to activate this console.                                    
sh-2.05# 
-------------------------------

  so the boot process looks good and, most importantly, i can
verify:

  sh-2.05# mount                                                                  
  /dev/root on / type nfs 
  (rw,v2,rsize=4096,wsize=4096,hard,udp,nolock,addr=10.0.)  <--- "rw"
  none on /dev type devfs (rw)                                                    
  /proc on /proc type proc (rw)                                                   
  sh-2.05# 

so the root filesystem is NFS-mounted read-write as it should be,
and the /dev directory has also been populated with a couple dozen
entries.  so far, so good.  on to the next test.

  since i can verify ("busybox --help") that this version of busybox has
mount capability, i can remove the /sbin/mount executable, and replace it
with a symlink to busybox.  i do that, and things still work just fine --
all the output is similar to the above, and the root FS mount is still
read-write.

  now, the third test, i return to the original root filesystem (with the
actual mount executable), and replace /bin/busybox with a 1.00-pre4 
version.  so i have a new busybox (with "mount" capability built in),
but i've returned to using the original mount executable, just to be
thorough.  once again, everything is fine, system boots, root filesystem
is mounted read-write.

  *finally*, as my last test, i use the 1.00-pre4 busybox, remove the
executable /sbin/mount and link mount to busybox, reboot and get:
--------------------------------------------
...
Looking up port of RPC 100003/2 on 10.0.0.1                                     
Looking up port of RPC 100005/1 on 10.0.0.1                                     
VFS: Mounted root (nfs filesystem) readonly.                                    
Mounted devfs on /dev                                                           
init started:  BusyBox v1.00-pre4 (2003.12.11-09:03+0000) 
multi-cRemounting the.
mount: Mounting /dev/root on / failed: No such file or directory                
rm: unable to remove `/etc/mtab': Read-only file system                         
ln: /etc/mtab: File exists                                                      
Mounting local file systems...                                                  
Initializing random number generator... urandom start: failed.                  
done.                                                                           
                                                                                
Please press Enter to activate this console.                                    
sh-2.05# mount                                                                  
/dev/root on / type nfs 
(ro,v2,rsize=4096,wsize=4096,hard,udp,nolock,addr=10.0.)
none on /dev type devfs (rw)                                                    
/proc on /proc type proc (rw)                                                   
sh-2.05# 
-----------------------------------------------

  note not only the error messages, but the fact that the root
filesystem is mounted read-only.  not good.  and this is based on
simply switching to the mount command (applet?) in busybox 1.00-pre4.

  i've verified that i do *not* have real /etc/mtab support in this
version of BB.  the top level "linuxrc" file is in fact linked to
busybox, so something is happening fairly early in the boot procedure
here that is crashing out and leaving my NFS-based root filesystem
mounted read-only.

  anyone have any suggestions?  i'm about to head back in and check
the init-related options for busybox, since it looks like that's where
things are going awry. 

  but i'm definitely open to suggestions.

rday

p.s.  sorry for being so long-winded, but i've been fighting with this
for a while, so i figured it was worth explaining fully.




More information about the busybox mailing list