Home > Enterprise Linux Tips > Administrator > How to install CentOS 5.2 via a Preboot Execution Environment
Enterprise Linux Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ADMINISTRATOR

How to install CentOS 5.2 via a Preboot Execution Environment


Austin Jorden, Contributor
01.19.2009
Rating: -4.00- (out of 5)


Enterprise IT tips and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Using a Preboot Execution Environment (PXE) server to install an operating system (OS) improves the OS installation experience. We all know how tedious OS installs can be -- wouldn't it be great to do them remotely? Imagine sitting at a desk instead of swapping CDs at a server chassis somewhere inside a data center while listening to the sound of HVACs. In this article, we'll learn how to install CentOS 5.2 via PXE.

Experience with trivial file transfer protocol (TFTP), hypertext transfer protocol (HTTP) and dynamic host configuration protocol (DHCP) will come in handy for this process. Experience with a network file system (NFS) and other types of PXE systems will enhance the experience.

Pre-install setup for PXE server
PXE is a stage that a computer goes into just after booting BIOS. It's booted using a network interface. It is completely separate from any internal devices (such as a hard-disk or CD-ROM). It's like booting into a temporary OS via the network.

The client machine will need to have the BIOS set up. Ensure that the Onboard BootROM is set to Enabled and that the first boot device shows as Network. This will ensure that the system boots up and uses the onboard BootROM/Network interface to boot to the network.

To set up on the PXE server, you'll need DHCP, HTTP and TFTP. NFS is optional. Here's how PXE operates:

  1. System boots up and requests DHCP.

  2. PXE server (DHCP server) replies back negotiating an IP address between server/client.

  3. Once the IP address is settled, the DHCP server replies back with a file called pxelinux.0. That tells the server to boot a temporary kernel and driver disk in a specific directory. In our case, it will be Yes, even though it says .cfg, it's still a directory, not a file.

  4. The system looks under via the TFTP server for a file named (or whatever its MAC address is).

The file's example contents are:

In this file, it te...


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
FreeBSD  (SearchEnterpriseLinux.com)
MEPIS  (SearchEnterpriseLinux.com)
Puppy Linux  (SearchEnterpriseLinux.com)
skinny Linux  (SearchEnterpriseLinux.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


lls the system to boot to the temporary kernel located at and the driver disk located at

The PXE server also communicates that it wants to install CentOS via text mode (no graphics). Graphics tend to use more RAM, which slows down the installation process. It tells the system where the kickstart file is going to be. The kickstart file tells Anaconda's or Red Hat's or CentOS's installer what to install and which partitions to set up. Next, you must configure the DHCP server. Here's an example of a DHCP server configuration:

This DHCP configuration allows subnets 172.22.0.50 to 172.22.0.254 to be given to clients. It also directs the clients to the file pxelinux.0, as previously stated.

Earlier, I showed you that the bootloader file directs the Anaconda installer to a kickstart file. This file directs the installer through a series of questions. Here is an example of a kickstart file, followed by an explanation:

  • Instructs the client to install using "text" mode.
  • Install in English (U.S.).
  • The network lines simply configure the interface(s) for the IP information. Erasing both of those lines will enable DHCP by default.
  • The NFS line tells the system to install from an NFS mount, which I'll address later in this tip.
  • It also tells it to install by clearing all master boot records (zerombr yes), to clear all partitions currently existing on the hard-disk (clearpart –all) and to install using the default partitioning scheme (autopart).
  • It tells the installer to install iptables (firewall) but to enable SSH.
  • Disable SELinux, and set the time zone to its proper place.
  • Then set the "rootpw" line to whatever you'd like. I used swordfish.
  • Everything past the line tells the system which specific packages to install.

Now, let's go back to the NFS option I mentioned earlier. This line simply represents how the installer will obtain the CentOS media -- whether it's from an NFS mount, a CentOS mirror, a CD or an FTP server. In order to utilize an NFS mount, you can use the line in the kickstart example above. However, if you don't have the experience to properly set up an NFS daemon/server, then I strongly suggest that you use a Red Hat/CentOS media mirror and simply replace the line with

Installing CentOS 5.2
Once you have ensured that the BIOS isset up, DHCP is configured, TFTP is sharing the directory and that HTTP is configured to hand out the kickstart file, then you should be able to reboot the machine and watch the install process.

While the installation runs, you can use two tty's (terminal windows) to make sure everything is going according to plan. To view them, hold down ALT and hit F1 or F3.

TTY3 (ALT+F3) will show more back-end things going on, such as "parsing kickstart." TTY1 (ALT+F1), on the other hand, will feed you more eye candy and give you status bars.

Was this tip helpful? Email the editors and let them know what you think.

ABOUT THE AUTHOR: Austin Jorden is a systems and network administrator for a large wireless Internet service provider located in Dallas, Texas. He has a genuine love for Linux, networking and wireless technologies.

Rate this Tip
To rate tips, you must be a member of SearchEnterpriseLinux.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Enterprise Linux Web Server & Application Server
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts