星期三, 一月 21, 2009

Hardware and Installation-0122

Configuring a Network Installation
1: copy the installation files from each CD to a common directory
2: configure sharing on the directory
3: activate the NFS, FTP, or HTTP network

Creating an NFS Installation Server
NFS is the most efficient way to share files between Linux and Unix computers.
1. Create a directory for your installation files.
# mkdir /inst

2. Insert the first Red Hat Enterprise Linux installation CD/DVD into its drive.
# mount /dev/cdrom /media
# mount -ro loop /tmp/firstcd.iso /media( if all you have are the ISO files in the /tmp directory)

3. Copy the required files from the first Red Hat Enterprise Linux installation CD. Use the cp -ar /source/. /inst command, where source is the mount directory (such as /media/RHEL 5 i386 Disc 1).Don't forget the dot (.); it copies hidden files, including the .discinfo file from the first Red Hat Enterprise Linux installation CD.

4. Unmount the first Red Hat Enterprise Linux installation CD. If it's an installation DVD, skip to step 6. Use the umount /source command.

5. Repeat steps 2, 3, and 4 with the remaining Red Hat Enterprise Linux installation CDs.

6. Set up an NFS share. Add the following line to /etc/exports. You can do it with a text editor such as vi or the system-config-nfs utility.
/inst *(ro,sync)

7. Export the shared directory
# exportfs -a

8. Make sure there's nothing blocking access to NFS. The default Red Hat Enterprise Linux firewall blocks access to an NFS server. While inelegant, the following command "flushes," or turns off, the standard Linux firewall from the local computer. If you've enabled SELinux, you'll also have to use the SELinux Management Tool to change the associated NFS boolean variable to "Allow the reading on any NFS file system". Don't forget to restart NFS to activate all of your changes.
# iptables -F

9. Now you can activate the NFS service. The following commands assume that it's already running (which you can check using the service nfs status command)
# service nfs stop
# service nfs start

10. Finally, you can check the status of your share. If it's working, you should see the contents of the /etc/exports directory when you run the following command.
# showmount -e