
                              NFS-Root Mini-Howto
                                       
: Andreas Kostyrka, [1]andreas@ag.or.at
: Jing-Jong SHYUE, [2]shyue@sonoma.com.tw

   V8, 8 August 1997
     _________________________________________________________________
   
    Mini HOWTO 趨һ "޴ŵ"  Linux վ. 
   վĸĿ¼ϵͳ NFS ķʽ. ļ°
   ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/mini/NFS-Root һ
    sunsite ӳվ̨ҵ.
     _________________________________________________________________
   
1. Ȩ(˶β)

     * 1.1 ֧Ԯ
       
2. һ

3. ŷ趨

     * 3.1 
     * 3.2 Ŀ¼ϵͳ
       
4. վ

     * 4.1 ʹÿΨ
     * 4.2 ʹԭʼĺĴƬ
     * 4.3 ʹ bootloader  RARP
     * 4.4 ʹ bootloader ʹ RARP
       
5. ֪

     * 5.1 /sbin/init ޷.
     * 5.2 /dev .
       
6. 
     _________________________________________________________________
   
1. Ȩ(˶β)

   (c) 1996 Andreas Kostyrka (e9207884@student.tuwien.ac.at or
   andreas@ag.or.at)
   
   Unless otherwise stated, Linux HOWTO documents are copyrighted by
   their respective authors. Linux HOWTO documents may be reproduced and
   distributed in whole or in part, in any medium physical or electronic,
   as long as this copyright notice is retained on all copies. Commercial
   redistribution is allowed and encouraged; however, the author would
   like to be notified of any such distributions.
   
   All translations, derivative works, or aggregate works incorporating
   any Linux HOWTO documents must be covered under this copyright notice.
   That is, you may not produce a derivative work from a HOWTO and impose
   additional restrictions on its distribution. Exceptions to these rules
   may be granted under certain conditions; please contact the Linux
   HOWTO coordinator at the address given below.
   
   In short, we wish to promote dissemination of this information through
   as many channels as possible. However, we do wish to retain copyright
   on the HOWTO documents, and would like to be notified of any plans to
   redistribute the HOWTOs.
   
   If you have questions, please contact Andreas Kostyrka
   <mailto:andreas@ag.or.at>, the author of this mini-HOWTO, or Tim
   Bynum, the Linux HOWTO coordinator, at
   <mailto:linux-howto@sunsite.unc.edu> via email.
   
1.1 ֧Ԯ

     * Avery Pennarun <apenwarr@foxnet.net> ( Linux ʹ
       LILO)
     * Ofer Maor <ofer@hadar.co.il> (ṩһϺõ "޴ŵվ"
       HOWTO.)
     * Christian Leutloff <leutloff@sundancer.tng.oche.de> (ṩ·
       Ѷ.)
       
2. һ

   һ˵, Ĺվе:
     * ϵͳ֪רõ IP λ, Ҫ Ethernet ̬.
     * ϵͳ֪ NFS ŷλ, Ŀ¼Ĺ·.
       
   Ŀǰ (1.3.7x)  NFSROOT ʵṩĽ:
     * IP λÿ RARP ȡ;  Ethernet ̬ LILO 
       LOADLIN Ĳݸ.
     * Ҫص NFS ·úĵĲ. ûڴָ, 
        RAPR ŷͬʱҲ NFS ŷ, úıʱԤ·.
       (ĿǰԤ· /tftpboot/<  IP λ>.
     * ͻ˵̬Ҳ BOOTP ȡ.
       
   ڿʼ趨޴ŵ֮ǰ, ǷҪʹ LILO  LOADLIN ϵ
   ͳ. ַʽĺôǽе, ȱٶȽ. ʹ LILO 
   ٶȻϿ. о.
   
3. ŷ趨

3.1 

    RARP ֧Ԯ뵽Ǹ÷. 㲻ʱݶĲ
   , 뽫뵽. ͻ˲ͬһ·, 
   ʽû.
   
   վĺе֧Ԯ:
     * NFS ϵͳ֧Ԯ. (Ҫ ext2 ϵͳ֧Ԯ뵽, ģ
       ʽ͹.)
     *  "Root on NFS" Ĺ.
     * · Ethernet ʽ뱻ں.
     *  NFS Ŀ¼ϵͳ RARP  BOOTP 뵽.
       (Ҳǵ make config ִʱ,  NFS ѡ֮趨.)
       
   㲻ڹվʱݲ, ѸĿ¼豸趨
   0:255.  mknod /dev/nfsroot b 0 255 һװÿƵ. 
   , ԰ѺڵĸĿ¼· rdev <kernel-image>
   /dev/nfsroot ָ.
   
3.2 Ŀ¼ϵͳ

  Ƶϵͳ
  
   : Щָܿ, ʾ. 춽
   Ŀ¼ϵͳĽϼѷʽο Ofer Maor <ofer@hadar.co.il> д
   NFS-Root-Client mini howto.
   
   ˸Ŀ¼ķ·, ָ mkdir -p <·>, ִ
   
   tar cClf / - | tar xpCf <·> -.
   
   㲻 LILO , Ŀ¼· /tftpboot/<IP λ>. 
   㲻ϲλ, ޸ĺԭʼ Makefile, ҵ
   в޸
   NFS_ROOT = -DNFS_ROOT="\"/tftpboot/%s\""
   , ±.
   
  Ŀ¼ϵͳĸı
  
   Ҫĵ, Ҽ /etc/rc.d ָ. һЩص:
     *  eth0 趨. վʱҪ eth0, ùվʹŷ
        IP λÿɲһ. (ڱ㷸)
     * һص /etc/fstab 趨. Ӧ nfs ϵͳ.
     * : ҪŷĸĿ¼ϵͳͻ˹վĸĿ¼ϵͳŪ. (
       ŷϵ rc.inet1, ΪιվȻ)
       
  ϵͳȥ
  
   ҪĿ¼ϵͳվָ exports(5). ڸı趨, 
    nfsd  mountd.  RedHat , ֻҪִ
   /etc/rc.d/init.d/nfs stop ; /etc/rc.d/init.d/nfs start Ϳ.
   
  趨 RARP
  
   ·ϱһ RARP ŷ. ʱͬʱû趨 nfsroot , 
   RARP ŷ NFS ŷ. ͨ RARP ŷ NFS ŷ
   . Ҫ趨, ĺıҪ RARP ֧Ԯ.
   
   ұִָ (ͨ /etc/rc.d ):
   
   /sbin/rarp -s <ip λ> <Ӳλ>
   
   
   
   ip λ
          ǹվ IP λ, 
          
   Ӳλ
          ǹվ·̫·λ.
          
   : /sbin/rarp -s 131.131.90.200 00:00:c0:47:10:12
   
   Ҳʹ÷ȡ IP λ, ŷҵӦ
   IP λ. (趨 /etc/hosts , Ǿ DNS ѯ)
   
   BOOTP
  
   Ҫ趨 BOOTP, ༭ /etc/bootptab.  bootpd(8) Լ
   bootptab(5) ˵ҳ.
   
  ѰӲλ
  
   Ҳ֪·Ӳλ, Ҹβѯ?
     * ĺĴƬ, Ѱ·ȷϵĲ. ͨ
       6  16 λλԪ, Ӧþ·Ӳλ.
     * ֧Ԯ TCP/IP ҵϵͳվ. Ȼŷ ping 
       վ, ָѯŷϵ ARP ȡ.
       /sbin/arp -a
       
4. վ

4.1 ʹÿΨ

   ûùӵķ, ֻṩķ (Christian
   Leutloff <leutloff@sundancer.tng.oche.de> ṩ):
     * 㲻ʹ "һ" Ψ.
     * Gero Kuhlmann ṩһ netboot ׼,  Linux õĿΨ
       Ѷ. 㵱ص Linux ӳվ̨ҵ netboot ׼; 
       Ǵ Debian ׼ȡ (netboot-0.4).
     * ϸĶĿΨֲ.
     * ܱŷϵ tftpd, ĿΨ
       ķʽ.
     * ѰʹõĿΨ幫˾ṩ Linux ޲, û
       ɳʽΨ¼:(
       (رסŷ)ӭ, ¼.
       
4.2 ʹԭʼĺĴƬ

   ĸĿ¼ϵͳѾԤȷķȥ,  NFS ŷ
   ͬʱҲ RARP ŷ (ЩҲͬһ·), ֱӰ
   ĸƵƬ, ƬƬ. (ںаѸĿ¼豸
   0:255) ĸĿ¼ϵͳŷ /tftpboot/IP λ
   ·֮. (·Ծ޸ıʱ趨ı.)
   
4.3 ʹ bootloader  RARP

   ڿʱбҪĲ,  nfsroot=<ŷ IP λ>:<·
   > .  ŷ IP λ  NFS ŷ IP λ,  ·
   ǸĿ¼ϵͳŵ·.
   
   :
     * ʹ LILO ʱ, ʹ "" : ֻҪڵһĲ,
        "lock" , һοʱ LILO ʱ.
     * ҪվרÿƬʱ,  lilo.cong ʹ append= 
       .
       
4.4 ʹ bootloader ʹ RARP

   һʹ nfsroot ķǸĲ:
   nfsaddrs=<wst-IP>:<srv-IP>:<gw-IP>:<netmask>:<hostname> Ľ
   Ĳ趨 eth0.
   
   wst-IP
          վ IP λ
          
   srv-IP
          NFS ŷ IP λ
          
   gw-IP
          բ IP λ
          
   netmask
          ·
          
   hostname
          վ
          
5. ֪

5.1 /sbin/init ޷.

   һ /sbin/init ĳЩ׼Ƕ̬, ṩһ
   ȷ /lib ͻ˹վ. һ򵥵ķǰ /sbin/init ɾ̬
    "Hello World" ʽ, ˱ȷǷԶ̬.
   
5.2 /dev .

   㿪ʱյһѹ tty ĴѶϢ, ڿͻ˹վ /dev ·
   ִ "MAKEDEV" ʽ. Щҥ˵ 64 λԪŷ.
   , ŷҵϵͳ汾. һܵĽʽϵ
   ͳڽһС͵ /dev ŵ, 趨װõĽڵλ.
   
6. 

     *  ftp://sunsite.unc.edu/system/Network/admin/bootpc.v045.tgz 
       BOOTP Ŀͻ˳ʽ.
       ʽ Linux 2.0 е initrd ʽ, ԺܺõӦ޴
       վ. 춸ض趨, initrd Ǹܺõѡ.
     *  Linux 2.0 а BOOTP ѡ RARP, ԿܲҪ
       bootpd.
     * ںԭʼ˵ļ, һ NFS Ŀ¼ϵͳļ.
     * ˼ĸһ޲ʽ, Ծ NFS 趨û, Ū
        :(
       ܿ http://www.linuxhq.com/ ķǹٷ޲ҵ޲
       .
     * andreas@ag.or.at  PGP Կָ: F1 F7 43 D5 07 C4 6C 87 BF
       6B 33 A2 2C EE 5A F9.

References

   1. mailto:andreas@ag.or.at
   2. mailto:shyue@sonoma.com.tw
