home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / LINUX / HOWTO / mini / diskless.txt < prev    next >
Text File  |  1997-07-07  |  15KB  |  371 lines

  1.   Diskless Linux Mini Howto
  2.   by Robert Nemkin buci@math.klte.hu
  3.   v0.0.3 12 Sep 1996
  4.  
  5.   This document describes how to set up a diskless Linux box and copy¡
  6.   righted by Robert Nemkin. Copyright policy is GPL.  I whish to thank
  7.   to Bela Kis <bkis@cartan.math.klte.hu> for translating this document
  8.   to English.
  9.  
  10.   1.  Changes
  11.  
  12.   ╖  v0.0.3 12 Sep 1996: Some minor error fixes
  13.  
  14.   2.  How to set up a diskless Linux box
  15.  
  16.   This document is about setting up a diskless Linux box. Sometimes it
  17.   might be necessary to run Linux on PC's which have neither hard disks
  18.   nor floppy drives. If a network, another Unix system with bootp, tftp,
  19.   an NFS server, and an eprom burner is available then it is possible to
  20.   set up and operate Linux without hard/floppy disks.
  21.  
  22.   3.  Related documents
  23.  
  24.   ╖  NFS-root Mini Howto
  25.  
  26.   ╖  Linux NET-2/3-HOWTO by Terry Dawson, 94004531@postoffice.csu.edu.au
  27.  
  28.   ╖  /usr/src/linux/README about configuring and compiling new kernels
  29.  
  30.   4.  Hardware
  31.  
  32.   Whatever is described here was checked on the following configuration
  33.  
  34.   ╖  Sun-OS 4.1.3 as boot server
  35.  
  36.   ╖  Slackware 2.3 + Linux 1.2.8 + wd 8013 ethercard.
  37.  
  38.   ╖  Working Ethernet lan
  39.  
  40.   5.  Fundamental ideas
  41.  
  42.   The fundamental idea is as follows: the PC will get its IP address
  43.   from the boot server via the bootp protocol, using 0.0.0.0 as the
  44.   initial IP address and its kernel via the tftp protocol.  (-- Booting
  45.   across segments (via router) not a simple question, so either put both
  46.   the server and the diskless boxes on the same lan segment or configure
  47.   an UDP helper address in your router to the address of the server.
  48.   Refer to your router product manual for further info.--)
  49.  
  50.   For this follow the steps below.
  51.  
  52.   5.1.  Setting up the PC
  53.  
  54.   Get the nfsboot package (the package is available from your favourite
  55.   linux mirror site in the /pub/Linux/system/Linux-boot directory). It
  56.   contains a booteprom image for the wd8013 card which can be directly
  57.   burned in.
  58.  
  59.   There are alternative ways to prepare the PC:
  60.  
  61.   ╖  if your machine is not quite diskless, then you may use the little
  62.      DOS program, or
  63.  
  64.   ╖  the binary floppy image contained in the same package.  If you
  65.      choose the latter option you must write the image onto a floppy by
  66.      the dd command.
  67.  
  68.   These images contain a bootp and tftp client.  You need to prepare a
  69.   linux kernel too, which contains the nfs-root option.
  70.  
  71.   ╖  If you are using the latest stable kernel, linux-1.2.13, then you
  72.      need to patch the kernel with the patchfile included in the nfsboot
  73.      package  (-- Refer to patch(1)--)
  74.  
  75.   ╖  If you try to use the latest, but unstable kernel from the
  76.      linux-1.3.x series, then you have to configure in the nfs-root
  77.      option.
  78.  
  79.      You may or may not configure block device (floppy or hard disk)
  80.      support, but you must configure tcp/ip support, wd ethernet card
  81.      support, nfs filesystem support. Then recompile the kernel as
  82.      usual.
  83.  
  84.   5.2.  Setting up a bootpd on the server
  85.  
  86.   It can be found in package bootpd-2.4.tar.gz (which can be found on
  87.   your favourite linux mirror site in the
  88.   /pub/Linux/system/Network/boot.net directory). Get the package,
  89.   compile and install it. If your other Unix box happens to be a
  90.   Slackware Linux then you may skip this step for the standard
  91.   distributions contain a bootpd. The daemon can be run either directly
  92.   by issuing command
  93.  
  94.        ______________________________________________________________________
  95.                bootpd -s
  96.        ______________________________________________________________________
  97.  
  98.   or by using inetd. In this case you need to edit:
  99.  
  100.   ╖  /etc/inetd.conf to remove the hashmark from the start of these
  101.      lines:
  102.  
  103.        ______________________________________________________________________
  104.        # tftp   dgram   udp     wait    root    /usr/sbin/in.tftpd     tftpd /export
  105.        # bootps dgram   udp     wait    root    /usr/sbin/in.bootpd    bootpd
  106.        ______________________________________________________________________
  107.  
  108.   ╖  insert or uncomment the following two lines in /etc/services:
  109.  
  110.   ______________________________________________________________________
  111.   bootps          67/tcp          # BOOTP server
  112.   tftp            69/udp          # TFTP server
  113.   ______________________________________________________________________
  114.  
  115.   ╖  restart inetd by
  116.  
  117.        ______________________________________________________________________
  118.                kill -HUP <process id of inetd>.
  119.        ______________________________________________________________________
  120.  
  121.   5.3.  Configure the bootpd on the server.
  122.  
  123.   First of all, bootpd have a config file called bootptab which usually
  124.   resides in /etc. You must modify it by inserting the IP addresses of
  125.   your gateway, dns server, and the ethernet address(es) of your
  126.   diskless machine(s).  An example /etc/bootptab:
  127.  
  128.        ______________________________________________________________________
  129.  
  130.        global.prof:\
  131.                :sm=255.255.255.0:\
  132.                :ds=192.168.1.5:\
  133.                :gw=192.168.1.19:\
  134.                :ht=ethernet:\
  135.                :bf=linux:
  136.        machine1:hd=/export/root/machine1:tc=global.prof:ha=0000c0863d7a:ip=192.168.1.140:
  137.        machine2:hd=/export/root/machine2:tc=global.prof:ha=0800110244e1:ip=192.168.1.141:
  138.        machine3:hd=/export/root/machine3:tc=global.prof:ha=0800110244de:ip=192.168.1.142:
  139.        ______________________________________________________________________
  140.  
  141.   global.prof is a general template for host entries, where
  142.  
  143.   ╖  sm field contains the subnet mask
  144.  
  145.   ╖  ds field contains the address of the Domain Name Server
  146.  
  147.   ╖  gw field contains the default gateway address
  148.  
  149.   ╖  ht field contains the lan media hardware type
  150.  
  151.   ╖  bf field contains the name of the boot file
  152.  
  153.   After this, every machine must have a line:
  154.  
  155.   ╖  the first field contains the host name,
  156.  
  157.   ╖  hd field contains the directory of the bootfile,
  158.  
  159.   ╖  the global template can be included with the tc field,
  160.  
  161.   ╖  ha field contains the hardvare address of the ethernet card,
  162.  
  163.   ╖  ip field contains the assigned ip address.
  164.  
  165.   5.4.  Understanding tftp
  166.  
  167.   TFTP (Trivial File Transfer Protocol) is a file transfer protocol,
  168.   such as ftp, but it's much simpler to help coding it in EPROMs. TFTP
  169.   can be used in two ways:
  170.  
  171.   ╖  simple tftp: means that the client can acces to your whole file
  172.      system. It's simpler but it's a big security hole (anyone can get
  173.      your password file via tftp).
  174.  
  175.   ╖  secure tftp: the tftp server uses a chroot.2 system call to change
  176.      it's own root directory. Anything outside the new root directory
  177.      will be completelly inaccessible. Because of the chroot dir becomes
  178.      the new root dir, the hd filed in the bootptab must reflect the new
  179.      situation. For example: when using insecure tftp, the hd field
  180.      contains the full path to the boot directory:
  181.      /export/root/machine1.  When using secure tftp whith /export as
  182.      root dir, then /export becomes / and the hd field must be
  183.      /root/machine1.
  184.  
  185.      Almost every Unix implementation contains tfpt server, probably you
  186.      don't need to install your own one.
  187.  
  188.   5.5.  server.  Setting up a minimal Linux configuration on the remote
  189.  
  190.   This may contain packages a, ap, n, and x of the Slackware
  191.   distribution. To install more is OK; however the above packages
  192.   suffice for the purposes of a diskless X terminal. For the
  193.   installation you need a working Linux system. Find some disk space on
  194.   the remote machine and export it read-write. Mount the exported
  195.   directory onto somewhere (e.g. /mnt) on the file system of the Linux
  196.   box. Start Linux setup and change the root option in the setup from /
  197.   to /mnt. Then setup the above packages as usual. If you want to run no
  198.   more than one diskless Linux then no changes are needed. On the other
  199.   hand, if you plan to use more than one diskless machine then the above
  200.   setup will not work because some files and directories must be private
  201.   to the machines. The problem can be bypassed by moving the /usr (it
  202.   contains no private data) and then create a separate subdir for each
  203.   diskless machine. For example, if /export/linux