Boot linux from pxe

Boot linux from pxe

CODE EXAMPLE 4-1 shows a sample /etc/dhcpd.conf file

The important areas in this example are the address of the TFTP server
( next-server 172.16.11.8 ) and the filename of the stage 1 bootloader image ( filename «/
/sun/pxelinux.bin» ).

Note — Nameserver and web server software is provided with the Red Hat Enterprise Linux distribution. Installation and configuration of these applications is outside the scope of this document.

Note — If no Nameserver is configured, change get-lease-hostnames to off .

4.2.2.2 Configuring the TFTP Server

The TFTP server supplies the PXE boot with the stage 1 bootloader image. This image loads the installation kernel which performs the actual installation on the hard disk through the use of the custom initrd.img supplied by Red Hat.

Use the tftp-server package provided with your Linux distribution to provide TFTP services.

1. Create the TFTP directory. Ensure that all users have read/execute access to the TFTP directory:

2. Modify the /etc/xinetd.d/tftp file (for Red Hat) or the /etc/inetd.conf file (for SuSE) to allow TFTP services:


    If you are installing Red Hat, update the /etc/xinetd.d/tftp file. You need to change the server_args entry to -s /tftp . (The /tftp path is the directory in which the PXE images are copied.)

If you are installing SuSE, update the /etc/inetd.conf file by inserting the following line:

3. If you are installing SuSE skip to Step 4. If you are installing Red Hat, configure the TFTP server to be enabled at installation.

Change the disable entry to disable= no .

Note — At installation the TFTP server is disabled by default ( disable = yes ).

4. Enable the TFTP server.


    For Red Hat, type:

Note — No output is returned if the command succeeds.

5. Restart xinetd (for Red Hat) or inetd (for SuSE):


    For Red Hat, type:

6. Validate the configuration:

The output should be:

Example of the tftp File for Red Hat

shows an example of the /etc/xinetd.d/tftp file for Red Hat:

Example /etc/xinetd.d/tftp file for Red Hat

4.2.2.3 Configuring the NFS Server

The NFS server is used by the installation kernel to read all of the packages necessary to the installation process. The NFS server therefore needs to provide access to the directory structure containing the PXE images.

1. Update the /etc/exports file to include the export for the NFS server.

Insert the following line into file /etc/exports :

2. Enable the NFS server.


    For Red Hat, type:

Note — No output is returned if the command succeeds.

3. Restart the NFS server.

For Red Hat, type::

4. Validate the configuration:

The output should include the line:

4.2.3 Installing Linux on a Server Blade from a Linux PXE Boot Server

Note — IMPORTANT: Before installing Linux, ensure that the boot directory on the PXE server (/ tftp ) has enough space to accommodate the version of Linux you are installing. You will require about 6 Gbytes of free space.

Note — The PXE boot server should be running Enterprise Linux version AS 2.1 or EL 3.0, or SuSE Linux Enterprise Server 8, service pack 3.

Caution — Installing Linux will overwrite any data already on the destination server blade.

1. If you have configured a firewall, make sure that the TFTP, NFS, and DHCP protocols are not filtered on the server to be used as the PXE boot server.

2. Alternatively, disable the firewall and prevent it from running on subsequent reboots.


    To do this, for Red Hat, type:

Note — These examples assume that you are using iptable firewalls. iptable firewalls are not installed by default on SuSE.

3. Ensure that the DHCP server, NFS server and TFTP server have been configured correctly.

4. Install the PXE images onto the TFTP server:

Note — If you are running SuSE on your PXE boot server, replace /mnt/cdrom with /media/cdrom in the instructions below. For example, mount /mnt/cdrom would be mount /media/cdrom .

a. Copy the required Linux directory from the root of the Sun Fire B1600 Platform Documentation, Drivers, and Installation CD to the /tftp directory on your PXE boot server:

where Linux_dir > is as-2.1u2 , el-3.O or sles-8sp3 , depending on the version of Linux you are installing.

Note — The Linux directory contains the files required to perform a PXE installation.

b. Install the Linux installation CDs to the /tftp directory on your PXE boot server.



      For Red Hat, you need to install the CDs in reverse order. If you have two Red Hat installation CDs, install Disk 2 first; if you have four, install Disk 4 first. After inserting each CD, type the following command:

    where Linux_dir > is as-2.1u2 or el-3.O , depending on the version of Linux you are installing.



        For SuSE Linux Enterprise Server 8 service pack 3, you need to load each image into its own directory rather than into the same directory. This allows the SuSE installer to select the correct packages from each ISO image. Use the following commands:

      After inserting the SLES-8 disk:

      After inserting the first UnitedLinux 1.0 disk:

      After inserting the second UnitedLinux 1.0 disk:

      After inserting the third UnitedLinux 1.0 disk:

      After inserting the first United Linux 1.0 SP 3 disk:

      Note — The first SP 3 disk contains hard-linked directories. Do not use the cp, cpio or tar commands to copy this disk as these commands will fail to copy the directories correctly. The directory hierarchy created by pax requires about 2Gb of disk space.

      After inserting the second UnitedLinux 1.0 SP 3 disk:

      When you have copied all the disks, tie the ISO images together:

      5. Modify the configuration file to specify the address of your NFS server.


        For Red Hat, modify the / tftp/ Linux_dir >/sun/install/ks.cfg file. For example:

      where Linux_dir > is as-2.1u2 or el-3.O , depending on the version of Red Hat you are installing.

      Note — ks.cfg is a read-only file. You must change its permissions to read-write before making modifications.



        For SuSE, modify the /tftp/sles-8sp3/sun/install/autoyast.xml file to set the NFS server address. A sample command is as follows:

      6. Set your own root password in the Linux configuration file.

      Note — If you do not change the root password, you will be prompted to enter the root password each time you run a PXE boot installation.



        For Red Hat, modify the / tftp/ Linux_dir >/sun/install/ks.cfg file by removing the comment symbol (#) in the rootpw entry and then overwriting changeme with your own password:

      where nnnnnnn is your root password.


        For SuSE, specify the root password in the autoyast.xml file ( /tftp/sles-8sp3/sun/install/autoyast.xml ) by scrolling to the user password section of the file, removing the existing text between the key words, typing the password you want to use:

      Note — It is only possible to specify passwords for SuSE in an encrypted form.

      Note — The default password is changeme .

      7. Modify the /tftp/ Linux_dir /sun/pxelinux.cfg/default file to include the path to the kernel to be installed, and the location of the PXE server.

      The line of the default file containing the IP address of the PXE server and the path to the kernel software is the wrapped line beginning with the word «kernel» and ending » /initrd.img «:

      where Linux_dir > is as-2.1u2 or el-3.O , depending on the version of Red Hat you are installing. If you are installing SuSE Linux Enterprise Server 8 service pack 3, the Linux directory will be sles-8sp3 .

      Note — By default the PXE device is eth0 ( ksdevice=eth0 ). This means that the PXE boot is performed via the SSC in slot 0. If you want to PXE boot via SSC 1, you can change this parameter to ksdevice=eth1 .

      Note — The default file is a read-only file. You must change its permissions to read-write before making modifications.

      8. Log into the B1600 System Controller.

      See the Sun fire B1600 Blade System Chassis Software Setup Guide for further details.

      Note — The following steps assume that the blade is already installed in the system chassis. For information on installing blades, see Chapter 3.

      9. Boot the blade to begin the PXE boot from the SC prompt.

      where n is the slot number of the server blade on which you want to install the operating system.

      10. Access the blade’s console to monitor the progress of the installation.

      At the SC prompt, type:

      where n is the number of the slot containing the blade.

      Note — If you are installing SuSE, the system will become idle for about 40 seconds during the boot and subsequent reboots. During this idle time a blank screen is displayed. This behavior is due to an old version of the bootloader that ships with SuSE, and does not indicate that there is a problem with booting the blade.

      When the installation is complete the blade automatically reboots.

      Note — For information on troubleshooting the PXE boot installation see Chapter 9.

      This section tells you how to install Linux on a server blade from a PXE boot server running Solaris.

      Note — IMPORTANT: Before installing Linux, ensure that the boot directory on the PXE server (/ tftpboot ) has enough space to accommodate the version of Linux you are installing. You will require about 6 Gbytes of free space.

      4.3.1 Files Relevant to PXE Boot Installation

      A summary of the files required by the Solaris PXE boot server during PXE boot installation and their purpose is provided in TABLE 4-3.

      TABLE 4-3 Summary of Files Relevant to PXE Boot Installation

      The NFS server is used by the installation kernel to read the packages necessary to the installation process. The NFS server needs to provide access to the directory structure containing the required packages. Prior to installation you will update the /etc/dfs/dfstab file to provide access to this directory structure.

      /tftpboot/
      /sun/
      install/ks.cfg

      The Red Hat PXE boot installation is controlled by the ks.cfg configuration file. The SuSE PXE boot installation is controlled by the autoyast.xml file. Prior to installation you will update this file to use the correct NFS server address.

      For more information on the configuration file for your version of Linux, refer to your Red Hat or SuSE documentation.

      /tftpboot/
      /sun/
      pxelinux.cfg/*

      The /tftpboot/
      /sun/pxelinux.cfg/* files control where pxelinux.bin finds a kernel to boot from and how it should boot that kernel. The files in this directory are named based on the
      IP address that should read them. For example, if the client is given an IP address of 9.10.11.12, pxelinux.bin will attempt to download (using TFTP and the PXE NIC support code) the following files in order:

      The first file downloaded successfully is used to select the kernel image and runtime arguments.

      The TFTP server supplies the PXE boot with the stage 1 bootloader image. This image loads the installation kernel that performs the installation on the hard disk. The inetd daemon must be configured to run a TFTP daemon. This TFTP daemon supplies the services necessary to download the PXE loader, the linux kernel and the linux initrd image.

      The DHCP server supplies the PXE boot plug-in with an IP address and TFTP server address, and the stage 1 image boot-loader name to download and execute. The instructions in this chapter tell you how to modify these files using the DHCP Manager utility.

      Note — The Linux directory called Linux_dir > depends on the version of Linux you are installing. Files for Enterprise Linux Advanced Server 2.1 update 2 are in a directory called as-2.1u2 , the files for Enterprise Linux version 3.0 are in a directory called el-3.O , and the files for SuSE Linux Enterprise Server 8 service pack 3 are in a directory called sles-8sp3 .

      4.3.2 Preparing to Install Linux

      1. Connect a network port on the SSC to a subnet containing both the Network Install Server you intend to use as the PXE boot server and the DHCP server you intend to use to allocate IP addresses to the server blade.

      If you have a redundant SSC in the blade system chassis, duplicate this connection on the second SSC.

      2. Find out the MAC address of the first interface on the blade you intend to install Linux onto.

      To do this, log into the System Controller, and at the sc> prompt, type:

      where the : character indicates omitted data. The MAC address listed for each blade is the MAC address of the first interface (by default, bge0 ).

      For a basic installation that uses only one active network interface (for example, for setting up a blade to boot Linux from the network), you only need the MAC address of the first network interface.

      However, if you are intending to set up redundant connections to the network, you also need to calculate the MAC addresses for bge1 , bge2 , and bge3 .

      Make a note of the MAC addresses for each interface on the blade.

      3. Make sure the DHCP server you intend to use is properly set up and functioning.

      For information about setting up a Solaris DHCP server, refer to the Solaris DHCP Administration Guid e.

      4. If you want the DHCP server to allocate IP addresses dynamically to the server blade, then reserve a block of addresses on the DHCP server for this purpose.

      For information about how to do this, refer to the Solaris DHCP Administration Guid e.

      4.3.3 Configuring the PXE Boot Servers

      Linux is installed on the server blade using the PXE boot system. Three server processes are required to perform the installation:

      This section provides information on how to configure the DHCP and NFS servers, and how to enable the TFTP server, for use with the PXE boot installation.

      Note — This chapter assumes that all server processes are running on the same physical host.

      4.3.3.1 Configuring the DHCP Server

      PXE booting is supported by DHCP services, and this means that there are a number of setup steps you need to perform involving the DHCP server. The DHCP server needs to be configured for each individual blade otherwise the network installation will not work.

      1. Log into the Network Install Server as root , and start the DHCP Manager by typing:

      where mydisplay is the name of the system (for example, a desktop workstation) that you are using to display the DHCP Manager’s GUI (Graphical User Interface).

      2. Add the global PXE macro to the DHCP server to enable it to support Linux PXE boot clients.

      To define the global PXE macro:

      a. In the main window of DHCP Manager’s GUI, click the Macros tab, and select Create from the Edit menu.

      b. In the Name field of the Create Macro window, type the name of the global macro that enables the DHCP server to support PXE booting (PXEClient:Arch:00000:UNDI:002001).

      Note — Step b only needs to be performed once on the DHCP server. If you already have this macro defined correctly, skip this step and go to Step c.

      Caution — The global PXE macro is named PXEClient:Arch:00000:UNDI:002001. You must ensure that you type this name correctly. If you make a mistake, the blades will not be able to perform a PXE boot of the Linux operating system.

      c. In the Option Name field, type BootSrvA . And in the Option Value field type the IP address that was listed for the Boot Server (that is, the Network Install Server). Then click Add.

      d. In the Option Name field, type BootFile . And in the Option Value field type the path to the file pxelinux.bin , for example / Linux_dir >/sun/pxelinux.bin, (where
      is either as-2.1u2 ,
      el-3.O or sles-8sp3 , depending on the version of Linux you are installing). Then click Add.

      To view the properties of the macro you have created, select it from the list of macros displayed on the left of the Macros tab, then select Properties from the Edit menu (see FIGURE 4-1).

      FIGURE 4-1 The Properties Defined for the Global PXE Macro

      3. Click OK to save the settings.

      4.3.3.2 Configuring the NFS Server

      The NFS server is used by the installation kernel to read all of the packages necessary to the installation process. The NFS server therefore needs to provide access to the directory structure containing the PXE images.

      1. Make the tftpboot directory available to all machines running NFS.

      Update the /etc/dfs/dfstab file by adding the following line :

      Источник

      Читайте также:  Как отключить накопительное обновление для windows 10
      Оцените статью