ding:netboot
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
ding:netboot [2006/11/13 12:26] – 206.161.205.190 | ding:netboot [2007/10/16 18:23] – old revision restored andi | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Diskless System ====== | ||
+ | [[ding:: | ||
+ | |||
+ | I try to explain how everything is setup here. First thing you need is a seperate server somewere (running linux of course) and the second thing is a good network card which is able to netboot. I use a [[http:// | ||
+ | |||
+ | |||
+ | ===== Before we start ===== | ||
+ | |||
+ | The client is the diskless machine named ding.my.home using the IP 192.168.1.30 assigned via DHCP. The server serves NFS, | ||
+ | |||
+ | When I say boot I mean boot the client - I assume the server is running fine ;-) | ||
+ | |||
+ | ===== Client-Setup ===== | ||
+ | |||
+ | The 3COM 905C-TX Network Interface Card (NIC) comes with a boot-ROM which allows to boot a remote bootimage. It will configure the NICs IP via DHCP and then get the bootimage via TFTP. | ||
+ | To enable this press '' | ||
+ | |||
+ | Boot Method: PXE | ||
+ | Default Boot: Network | ||
+ | |||
+ | For the curious: PXE is short for Pre eXecution Environment. Thats all for the client. Everything from now on will be done on the server (xerxes). | ||
+ | |||
+ | ===== Rootfilesystem ===== | ||
+ | |||
+ | The whole rootfilesystem of the client will be served as a NFS share by the server. Remember: a real rootfilesystem has to contain everything including ''/ | ||
+ | |||
+ | I created mine from a backup of the broken harddisk but you can copy any existing rootfilesystem e.g. extract one from a Rescue CD image or even copy the one from the file server. I created it in ''/ | ||
+ | |||
+ | Now you need an NFS server running (''#> | ||
+ | |||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | The '' | ||
+ | |||
+ | ===== TFTP ===== | ||
+ | |||
+ | TFTP is a authenticationless file transfer protocol used to get the bootimage. For PXE we need a slightly enhanced TFP server. Install it with '' | ||
+ | |||
+ | < | ||
+ | tftp dgram | ||
+ | </ | ||
+ | |||
+ | The last parameter is the rootdirectory of the TFTP server and by giving the '' | ||
+ | |||
+ | #> / | ||
+ | |||
+ | ===== DHCP ===== | ||
+ | |||
+ | To autoconfigure the NIC you need a running DHCP server. Install it with | ||
+ | |||
+ | #> apt-get install dhcp3-server | ||
+ | |||
+ | Now change your ''/ | ||
+ | |||
+ | < | ||
+ | # option definitions common to all supported networks... | ||
+ | option domain-name " | ||
+ | option domain-name-servers 192.168.1.10; | ||
+ | |||
+ | option subnet-mask 255.255.255.0; | ||
+ | option broadcast-address 192.168.1.255; | ||
+ | option routers 192.168.1.10; | ||
+ | |||
+ | default-lease-time 600; | ||
+ | max-lease-time 7200; | ||
+ | |||
+ | #For GRUB net-booting | ||
+ | option grub-config code 150 = text; | ||
+ | |||
+ | # If this DHCP server is the official DHCP server for the local | ||
+ | # network, the authoritative directive should be uncommented. | ||
+ | authoritative; | ||
+ | |||
+ | # Use this to send dhcp log messages to a different log file (you also | ||
+ | # have to hack syslog.conf to complete the redirection). | ||
+ | log-facility local7; | ||
+ | |||
+ | host ding { | ||
+ | hardware ethernet 00: | ||
+ | fixed-address 192.168.1.30; | ||
+ | filename "/ | ||
+ | option grub-config " | ||
+ | next-server 192.168.1.10; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Most things are for setting up IP, DNS and gateway. Have a look at the host entry for ding. Interesting is the ' | ||
+ | |||
+ | Be sure to restart DHCP after changing the config: | ||
+ | |||
+ | #> / | ||
+ | |||
+ | ===== GRUB ===== | ||
+ | |||
+ | Usually the NIC should fetch a kernel-image and boot it. But the image has to fit into the low memory which is only 640kb. I wasn't able to compile a 2.4.x kernel with less than ~750kb so another solution had to be found. The solution is GRUB - a great bootloader with network support. | ||
+ | |||
+ | Debian comes with a precompiled version but this one has no network support so we compile our own. Get the sources from the [[http:// | ||
+ | |||
+ | GRUB configures itself in two stages: First it executes a compiledin " | ||
+ | |||
+ | $> echo " | ||
+ | |||
+ | Now we can build GRUB with network support by selecting the correct driver and the just created preset. For a list of available network driver see the included '' | ||
+ | |||
+ | $> ./configure --enable-3c90x --enable-diskless --enable-preset-menu=mypreset | ||
+ | $> make | ||
+ | |||
+ | The build process creates a file named '' | ||
+ | |||
+ | $> cp stage2/ | ||
+ | $> chmod 666 / | ||
+ | |||
+ | It's half time in our config marathon. | ||
+ | |||
+ | You may try to boot the client a first time at this point. Because we have no kernel and no GRUB config it will not boot your system. But it should configure the NICs IP, download and execute the GRUB image and present a GRUB shell. Got it so far? Lets go on... | ||
+ | |||
+ | ===== Kernel ===== | ||
+ | |||
+ | We need a special kernel to boot with a NFS-only rootfilesystem. You have to build the networkdriver into the kernel (not as module), enable DHCP autoconfiguration and rootfilesystem on NFS: | ||
+ | |||
+ | < | ||
+ | Networking options | ||
+ | | ||
+ | | ||
+ | Network device support | ||
+ | | ||
+ | [*] Ethernet (10 or 100Mbit) | ||
+ | | ||
+ | < | ||
+ | File systems | ||
+ | | ||
+ | < | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | Configure everything else as usual, compile it and copy the kernel to your desired location (accessable by TFTP) | ||
+ | |||
+ | #> cp arch/ | ||
+ | |||
+ | ===== Some final configs ===== | ||
+ | |||
+ | Create a GRUB config in ''/ | ||
+ | |||
+ | < | ||
+ | title Kernel 2.4.24 | ||
+ | root (nd) | ||
+ | kernel / | ||
+ | |||
+ | </ | ||
+ | |||
+ | '' | ||
+ | |||
+ | Be sure to change some settings in your rootfilesystem: | ||
+ | |||
+ | * Disable all network-configuration (/ | ||
+ | * Add your rootfilesystem to / | ||
+ | |||
+ | < | ||
+ | 192.168.1.10:/ | ||
+ | </ | ||
+ | |||
+ | Thats it - Now boot and pray :-) |
ding/netboot.txt · Last modified: 2008/06/04 19:40 by ach