Preparing an NFS Server

In this section, we ll look at configuring an NFS server with the Red Hat installation files from the CDs. When you ve configured the server, you ll be able to use the shared NFS directory after Red Hat Linux is installed for the RPM packages that you may need in the future.

This assumes you already have a Linux or Unix computer, with the appropriate NFS services installed. We ll look at the basic commands that you need to set up an NFS installation server, but the details of how NFS works are not covered in this chapter. If you want to know more about NFS, see Chapter 28 .

We also assume that you re making changes as the root user .

Copying Files

The first step is to set up a directory with the Red Hat Linux installation files. You ll need a /RedHat directory, with base and RPMS subdirectories. You need to copy the files in the /RedHat/base directory from the first Red Hat installation CD. You ll also need to copy the RPM packages from all three installation CDs to the /RedHat/RPMS directory.

This is actually a fairly easy process:

  1. Find room for the Red Hat installation files. You ll need nearly 2GB of space.

  2. Create a separate directory. Make sure it s in a partition with sufficient space. For more information on managing partitions, see Chapter 07 . For the purpose of this exercise, I ve named the directory /mnt/inst .

     # mkdir /mnt/inst 
  3. Mount the first Red Hat Linux 9 installation CD:

     # mount -r /dev/cdrom /mnt/cdrom 
  4. Copy the applicable files from the CD:

     # cp -ar /mnt/cdrom/RedHat /mnt/inst 
  5. Unmount the first installation CD. Mount the second Red Hat installation CD. Copy the applicable files from that CD:

     # umount /mnt/cdrom # mount -r /dev/cdrom /mnt/cdrom # cp -ar /mnt/cdrom/RedHat /mnt/inst 
  6. Repeat step 5 with the third Red Hat installation CD:

     # umount /mnt/cdrom # mount -r /dev/cdrom /mnt/cdrom # cp -ar /mnt/cdrom/RedHat /mnt/inst 

Now you re ready with a Red Hat Linux installation source.

You could also install Red Hat Linux from .iso files on a shared NFS directory. I don t include that option in this book, since I believe that it is not as useful. While you can mount .iso files like regular Red Hat installation CDs, that approach does not provide a single source for RPM packages after Red Hat Linux is installed.

Sharing Directories

If you ve installed NFS on your computer, you can now export the shared directory with the Red Hat Linux installation files. Exports are documented in the /etc/exports configuration file. Open it in the text editor of your choice.

Note  

Several text editors are available in Linux. For more information on the vi text editor, see Chapter 06 .

Based on the previous section, we ll share the /mnt/inst directory with the Red Hat Linux installation files. It s not difficult; just follow these steps:

  1. Add the following line to /etc/exports :

     /mnt/inst      *(ro,sync) 

    Make sure that there are no spaces after the asterisk; NFS may misinterpret them. Save your changes to /etc/exports .

  2. Next , export the shared directory with the following command:

     # exportfs -a 
  3. Now you can make sure that NFS is ready to share your directory. Stop the service. If NFS isn t yet running, the following messages may look like they re creating error messages. Don t worry about it.

     # service nfs stop 
  4. Copy the applicable files from the CD (this process will probably take several minutes):

     # service nfs start 
  5. Check your exports. Show the directories that can be mounted with the following command:

     # showmount -e 
  6. If you ve installed a firewall during the installation process, it s easiest to disable it. While you could punch holes in the firewall, that requires more complex skills (see Chapter 23 ). For now, this flushes all firewall rules from your Linux computer:

     # iptables -F 

    (If you have a slightly older version of Linux, you may need to use the ipchains -F command.)

Now you ve set up a directory with Red Hat Linux installation files, and have shared it using NFS.

Note  

If you want to continue sharing the installation directory the next time you boot Linux, the chkconfig --level 2345 nfs on command can help. For more information on chkconfig , see Chapter 13 .

Installation Parameters

To use the NFS directory that you ve shared, you ll need two things: the address of the NFS server and the location of the /RedHat directory. The address of the NFS server could be a computer name , such as NFSserver , or a fully qualified domain name, such as www.example.com . But this requires a working DNS (Domain Name Service) server, which may not apply to all networks.

Alternatively, you can use the IP address of the NFS server. If you don t know that address, run the ifconfig command. It should give you output similar to Figure 4.1.

click to expand
Figure 4.1: IP address information

The important piece of information is the IP address; in Figure 4.1, it s 10.252.113.63 For more information on IP addressing and the other concepts in this section, see Chapter 20 . To summarize, once you ve set up shared directories on a running NFS server, you need the following bits of information during the installation process:

The IP address of the NFS server If you have a working DNS server for your network, you could substitute the computer name or fully qualified domain name of the server.

The location of the /RedHat directory Based on the actions taken earlier in this chapter, that is /mnt/init . If you ve set up the Red Hat installation files in a different directory, the location changes accordingly .

You ll get a chance to see how this works in the section Text Mode: Step by Step, later in this chapter.

 


Mastering Red Hat Linux 9
Building Tablet PC Applications (Pro-Developer)
ISBN: 078214179X
EAN: 2147483647
Year: 2005
Pages: 220

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net