Mandriva

100% Network Installation: PXE + NFS

There are three main reasons you might want to perform an installation entirely over the network:
  • Machines with neither CD nor floppy drives
  • When you are dealing with four or more machines and you do not want to burn 12 or more CDs to install Mandriva on them at the same time
  • When you are simply curious and wish to experiment with PXE and NFS

Required knowledge

To understand the following, you need to know a bit about networks: the basic workings of TCP/IP (IP addresses, DHCP...) and how to set up a LAN.

How does it work?

A network installation will use several protocols almost at once; these are the file transfer protocols. When a machine is booted over the network, the following things happen:

  1. Your network card contains a small BIOS, which boots the system.
  2. It will independently find an IP address. This address is provided by a DHCP server.
  3. It will then look for a server capable of sending it a small file. This server is called a TFTP server.
  4. It will download this file and transfer control of the system to it.
  5. This program, in our case, will be the 'stage 1' of the Mandriva installer, which is a very small text program to which you provide the location of the installation media (in this case, the Mandriva ISO files).
  6. We will tell this program to use NFS to find the ISO files and run the full installer from them.
  7. Finally, the first ISO will be launched as if it were a CD in the local machine.
Everything referred to as "the server" below will be the same machine in our example: the one which distributes the installation ISOs.

The server must be connected to the machine which will install Mandriva via a local network, which means it will need two network cards if it is connected to the internet through one (it is actually possible to do this with one physical network card, if you use a "virtual" interface, but this is outside the scope of this article). It is also of course possible to disconnect the server from the internet in order to connect it to the other machine via a local network.

Requirements

To complete a network installation, you will need several things on the server:

  • Mandriva ISOs on the hard disk
  • The 'drakpxelinux' package
  • The 'dhcp-server' package
  • The 'drakwizard' package
  • The 'nfs-utils' package

DHCP Configuration

Once you have all of this installed, open the Mandriva Control Center. If you did not have drakwizard installed before, you will notice several new functions. The one we are currently interested in is under Network and Internet: "Configure a DHCP server".

When you run it, it will ask several very simple questions. Make sure to read the explanations! Choose the card connected to the local network and provide two non-public IP addresses that define a range, for example: 192.168.0.10 to 192.168.0.250. Give the IP address of the server as the gateway and activate PXE.

dhcp.png

Your DHCP server is ready: the other machine should now be able to receive an IP address. Now we have to provide something for it to run: the Mandriva installer stage 1.

Providing stage 1

Stage 1 is provided in the form of a kernel and an initrd (which contains modules to be loaded by the kernel). It is located on the first Mandriva ISO.

Let's assume the ISOs are in the "/iso" directory and the first Mandriva ISO is called cd1.iso. Enter the following commands as root:

mkdir /mnt/tmp
mount -o loop /iso/cd1.iso /mnt/tmp

You can now access the contents of the ISO file in the /mnt/tmp directory. Enter the isolinux/alt0 subdirectory: you will see the stage1 kernel and initrd.

PXE Configuration: drakpxelinux

Now you can run drakpxelinux as root. A wizard will launch that will help you get PXE up and running on your DHCP server. At the right hand side of the screen you will see the 'default' profile - click on it. Then click on "Add a PXE entry" at the bottom of the screen. A second wizard will launch to configure the TFTP server which will distribute the stage1.

Give it the path of the kernel and initrd image which the TFTP server will provide to the other machine. Once the PXE configuration is done, select this entry (named "Mandriva" by default) as the boot time default at the bottom right of the screen.

entree_pxe.png

Go into the "Systems" tab. You will see a MAC address corresponding to the other machine (if it is on and connected to the network). If this is not the case, restart the other machine and boot it over the network: it should appear, even if it does not manage to boot correctly.

At the bottom right of the screen, choose "default", then select the entry corresponding to your machine and click on the two buttons: "Set the installation profile" and "Set the startup profile". Finally, click on OK, which will close drakpxelinux.

systeme.png

NFS server configuration

You are finished with the PXE configuration. Now you just have to configure the server to act as an NFS server, which is very simple: Edit the file /etc/exports. You must add this line:

/iso/ ip/netmask(sync)
Where /iso/ is the directory where the Mandriva ISOs are located, and ip/netmask is the address range of your local network, for example 192.168.0.0/255.255.255.0. (sync) indicates that transfers should be sent in synchronous mode between the server and the client (a little slower than asynchronous, but recommended).

To export the directory via NFS, run:

exportfs -a

Installation

Everything is now configured! All you have to do now is boot the machine which will receive the installation, choose the NFS method in stage 1, and provide the IP address of the server and the directory of the ISOs (/iso in our example). The installation will start from CD1 as if it was in the CD-ROM drive. You can now proceed to do a normal Mandriva installation.

KB - Installation 100% réseau : PXE + NFS
Version 1.2 last modified by awilliamson on 30/11/2005 at 19:07

 


fr en

RSS

Creator: awilliamson on 2005/11/30 19:07
(c) Mandriva 2007
18888888