Lesson 2: 1/28/2003


System Installation, Configuration, and Upgrade.
RedHat 9.0 Installation Reference I. Linux installation (custom interactive). II. Post-install configuration. III. Automated installation, Kickstart IV. Package and Kernel upgrade.
I. Custom Linux installation. A) Interactive installation. B) Kickstart (pre-configured) installation.
Interactive installation. Installation methods (location of Linux distribution): CD-ROM, Hard Disk, FTP, NFS We are going to use either FTP or NFS. NFS allows install in graphics mode, but slower than FTP. FTP doesn't allow install in graphics mode, but faster than NFS. Boot methods A. Boot from CD-ROM In the Bios, select CD-ROM as the first bootable device; restart the computer B. Boot from floppy (in our case) Create boot floppy in Windows (DOS prompt):
    C:\> d: D:\> cd \dosutils D:\dosutils> rawrite Enter disk image source file name: ..\images\boot.img Enter target diskette drive: a: Please insert a formatted diskette into drive A: and press --ENTER-- : [Enter] D:\dosutils>
Create boot floppy in Unix (Linux) using dd command: If CD is available, mount Redhat CD, insert formatted diskette and run dd:
    mount /dev/cdrom /mnt/cdrom cd /mnt/cdrom/images dd if=bootdisk.img of=/dev/fd0 bs=1440k count=1
In our case, we NFS mount a directory with Red Hat 9.0 distribution from remnant, IP address 192.168.5.250. You need to mount directory /usr/src/files/pub/cd90 and create two diskettes, boot floppy and drivers floppy:
    mkdir /mnt/nfs mount -t nfs 192.168.5.250:/usr/src/files/pub/cd90 /mnt/nfs cd /mnt/nfs/images
Boot floppy: Drivers floppy:
Run Installation Boot from the floppy; when the installation starts, press Enter at "boot:" prompt. NOTE: , you may get prompted with message "No driver found". Select "Use a driver disk"; choose "fd0"; insert the second floppy and hit Enter. You may be prompted to choose a network driver from a given list. If you are on a Dell machine in Unisys lab, choose "3 com 3c590/3c595/3c90x/3cx980 (3c59x)". If you are on HP VectraVL, choose "Intel EtherExpress Pro 100B (eepro100)" 1. Selecting an Installation Method: FTP (prefered) or NFS 2. Language Selection English (default) 3. Keyboard Configuration us (default) 4. Install method: FTP or NFS image 5. Configure TCP/IP: use dynamic IP config (DHCP) 6. If using FTP install, FTP server name: 192.168.5.250 Image directory: . Do not check "use non-anonymous FTP". If using NFS install, NFS server name: 192.168.5.250 Red Hat directory: /usr/src/files/pub/cd90 7. Mouse on most of the Dell machines: Microsoft Intellimouse PS/2 (default) check-in "Emulate 3 buttons"; on HP VectraVL, select Logitech MouseMan+/... (PS/2). 8. Install Options: Custom 9. Manually partition the file system with fdisk or Disk Druid. At hda hit Recommended partitions in our case:
    /boot 128 MB / 512 MB swap 2 x (size of RAM) /var 512 MB /tmp 512 MB /home 1024 MB /usr the rest of the disk
Choose /dev/hda Using fdisk Sec. 19.2 Main commands you need:
    P - show partition table n - create a new partition d - delete a partition l - list partition type t - change patition type w - write partition table and exit
If you use Disk Druid for partitioning, it gives you menue for partition sizes. 10. Using Disk Druid to mount the partitions. 11. Installing GRUB or LILO in MBR 12. Hostname Configuration: Accept DHCP settings 13. Firewall Configuration: no firewall 14. Time zone configuration: New York EST 15. Language support: English 16. Account configuration: root account you can also create one user account for yourself 17. Authentication: Enable MD5 and Shadow passwords; No NIS, No LDAP, No Kerberos 18. Packages. Check-in only the following package bundles:
    GNOME Desktop Environment Graphics Office/Productivity Printing Support Text-based Internet X Window System
19. Configure the monitor, choose resolution 1024 x 768 20. Choose login type "text" 21. Wait until the installation finishes 22. Skip creating the boot floppy Installation is complete; re-boot the system. If your mouse behaves fuzzy on an HP VectraVL machine, run command mouseconfig in text mode and select "Logitech MouseMan+/... (PS/2)".
II. Post-install configuration. Create the following entries in the file /etc/hosts 127.0.0.1 localhost.localdomain localhost 192.168.5.1 unisys01.rutgers.edu unisys01 192.168.5.2 unisys02.rutgers.edu unisys02 192.168.5.3 unisys03.rutgers.edu unisys03 192.168.5.4 unisys04.rutgers.edu unisys04 192.168.5.5 unisys05.rutgers.edu unisys05 192.168.5.6 unisys06.rutgers.edu unisys06 192.168.5.7 unisys07.rutgers.edu unisys07 192.168.5.8 unisys08.rutgers.edu unisys08 192.168.5.9 unisys09.rutgers.edu unisys09 192.168.5.10 unisys10.rutgers.edu unisys10 192.168.5.11 unisys11.rutgers.edu unisys11 192.168.5.12 unisys12.rutgers.edu unisys12 192.168.5.13 unisys13.rutgers.edu unisys13 192.168.5.14 unisys14.rutgers.edu unisys14 192.168.5.15 unisys15.rutgers.edu unisys15 192.168.5.16 unisys16.rutgers.edu unisys16 192.168.5.17 unisys17.rutgers.edu unisys17 192.168.5.18 unisys18.rutgers.edu unisys18 192.168.5.240 capone.rutgers.edu capone 192.168.5.250 remnant.rutgers.edu remnant Make sure in your /etc/resolv.conf there are the following entries: search rutgers.edu nameserver 128.6.238.13 nameserver 128.6.224.114 In /etc/nsswitch.conf, the line with entry "hosts" should look as follows: hosts: files dns Check what packages got installed: rpm -qa | less If there are un-needed packages, like kernel-pcmcia-cs-3.1.31-13 krbafs-1.1.1-9 gtkam-0.1.7-3 gphoto2-2.1.0-7 hotplug-2002_04_01-17 wireless-tools-25-8 ypbind-1.11-4 yp-tools-2.7-5 un-install them using RPM (Red Hat Package Manager): rpm -e package_name To avoid annoyeing messages that may appear when you don't type the full package name, you can use --allmatches option, for example, To remove the last two packages in the list, use rpm -e --allmatches yp-tools ypbind If you run into trouble with deleting some of the packages above due to numerous dependencies, skip their removal. Create a file with the list of installed packages: rpm -qa > original-inst.txt It is also highly recommended to secure your system, but we are skipping it for now. We'll talk about security in details later. Boot Loaders The kernel is loaded in computer RAM by a loader, either LILO or GRUB in our case. If you have installed GRUB (default option) and want to switch to LILO, do the following: cp /etc/lilo.conf.anaconda /etc/lilo.conf /sbin/lilo -v reboot Alternatively, if you like GRUB better and want to switch from LILO to GRUB. Make sure that file /boot/grub/grub.conf exists and contains the right kernel entry. /sbin/grub-install /dev/hda
III. Kickstart. Kickstart lets you automate most of a Red Hat Linux installation, including:
    Language selection Mouse configuration Keyboard selection Boot loader installation Disk partitioning Network configuration NIS, LDAP, Kerberos, Hesiod, and Samba authentication Firewall configuration Package selection X Window System configuration
The information above is all included in the kickstart file. Where to Put A Kickstart File A) On a boot disk mcopy ks.cfg a: B) On a network with DHCP and NFS server. On DHCP server /etc/dhcpd.conf there are necessary entries: filename "/home/(username)/"; next-server (server name); There should be a kickstart file in /home/(username)/(ip-addr)-kickstart Starting a Kickstart Installation In case when you have ks.cfg on a floppy: boot: linux ks=floppy or boot: linux ks=hd:fd0/ks.cfg In case you have (ip-addr)-kickstart on a network NFS server: boot: linux ks=nfs:(server):/(path) For example, boot: linux ks=nfs:192.168.5.240:/home/alexei/ The Kickstart File Kickstart file ks.cfg can be created manually from scratch, can be made from /root/anaconda-ks.cfg (just modify partitions and nfs/url entries), or can be generated Kickstart Configurator Kickstart Configurator comes with RPM redhat-config-kickstart-2.3.6-4.noarch.rpm . To verify if you have it installed, run command rpm -qa | grep redhat-config-kickstart. If it doesn't show anything, mount the distribution over NFS and get it installed: mkdir /mnt/nfs mount -t nfs 192.168.5.250:/usr/src/files/pub/cd90 /mnt/nfs cd /mnt/nfs/RedHat/RPMS rpm -ivh redhat-config-kickstart-2.3.6-4.noarch.rpm Run command /usr/sbin/redhat-config-kickstart to start the configurator. Below is ks.cfg file generated by Kickstart Configurator:

#Generated by Kickstart Configurator

#System language
lang en_US

#Language modules to install
langsupport en_US

#System keyboard
keyboard us

#System mouse
mouse --emulthree msintellips/2

#System timezone
timezone --utc America/New_York

#Root password
rootpw Alpha

#Reboot after installation
reboot
#Install Red Hat Linux instead of upgrade
install

#Use FTP installation media
url --url ftp://192.168.5.250/.

#System bootloader configuration
bootloader --location=mbr

#Clear the Master Boot Record
zerombr yes

#Clear all partitions from the disk
clearpart --all --initlabel

#Disk partitioning information
part /boot --fstype ext3 --size 64 --ondrive hda
part / --fstype ext3 --size 512 --ondrive hda
part swap --fstype ext3 --size 128 --ondrive hda
part /var --fstype ext3 --size 512 --ondrive hda
part /tmp --fstype ext3 --size 512 --ondrive hda
part /home --fstype ext3 --size 512 --ondrive hda
part /usr --fstype ext3 --size 512 --grow --ondrive hda

#Use DHCP networking
network --bootproto dhcp

#System authorization information
auth  --useshadow  --enablemd5

#Firewall configuration
firewall --disabled
#XWindows configuration information
#Probe for video card
#Probe for monitor
xconfig  --depth 16 --resolution 1024x768 --defaultdesktop=GNOME

%packages --resolvedeps
@X Window System
@GNOME Desktop Environment
@Editors
@Text-based Internet
@Office/Productivity
@Graphics
@Printing Support


%post
echo "127.0.0.1   localhost.localdomain localhost" > /etc/hosts
echo "192.168.5.1             unisys01.rutgers.edu unisys01" >> /etc/hosts
echo "192.168.5.2             unisys02.rutgers.edu unisys02" >> /etc/hosts
echo "192.168.5.3             unisys03.rutgers.edu unisys03" >> /etc/hosts
echo "192.168.5.4             unisys04.rutgers.edu unisys04" >> /etc/hosts
echo "192.168.5.5             unisys05.rutgers.edu unisys05" >> /etc/hosts
echo "192.168.5.6             unisys06.rutgers.edu unisys06" >> /etc/hosts
echo "192.168.5.7             unisys07.rutgers.edu unisys07" >> /etc/hosts
echo "192.168.5.8             unisys08.rutgers.edu unisys08" >> /etc/hosts
echo "192.168.5.9             unisys09.rutgers.edu unisys09" >> /etc/hosts
echo "192.168.5.10            unisys10.rutgers.edu unisys10" >> /etc/hosts
echo "192.168.5.11            unisys11.rutgers.edu unisys11" >> /etc/hosts
echo "192.168.5.12            unisys12.rutgers.edu unisys12" >> /etc/hosts
echo "192.168.5.13            unisys13.rutgers.edu unisys13" >> /etc/hosts
echo "192.168.5.14            unisys14.rutgers.edu unisys14" >> /etc/hosts
echo "192.168.5.15            unisys15.rutgers.edu unisys15" >> /etc/hosts
echo "192.168.5.16            unisys16.rutgers.edu unisys16" >> /etc/hosts
echo "192.168.5.17            unisys17.rutgers.edu unisys17" >> /etc/hosts
echo "192.168.5.18            unisys18.rutgers.edu unisys18" >> /etc/hosts
echo "192.168.5.250           remnant.rutgers.edu remnant" >> /etc/hosts

echo "search rutgers.edu" > /etc/resolv.conf
echo "name server 128.6.238.13" >> /etc/resolv.conf
echo "name server 128.6.224.114" >> /etc/resolv.conf

After kickstart installation is completed, you need to customize the system and run package upgrade similar to what you have done after the interactive installation last time. You can automate this task via writing a simple script. If your mouse behaves fuzzy on an HP VectraVL machine, run command mouseconfig in text mode and select "Logitech MouseMan+/... (PS/2)".
IV. Package and Kernel upgrade. Updated rpm packages come from www.Redhat.com/errata or mirror sites for your Redhat distribution. You need to mount the server directory with the errata: and run the package freshening RPM: mkdir /mnt/nfs mount -t nfs remnant:/usr/src/files/pub/cd90 /mnt/nfs cd /mnt/nfs/Errata/Packages rpm -Fvh package_name.rpm To automate packages upgrade, you can do it through a simple script, run-rpm.x:

#!/bin/bash
#
for files in $*
do
 fname=`basename $files`
 if [ -f $files -a $files != "run-rpm.x" -a "${fname%%-*}" != "kernel" ]
 then
  echo $files
  rpm -Fvh --nosignature $files
 fi
done

Make it executable and run for the rpm files: chmod u+x run-rpm.x ./run-rpm.x rpm-directory/* Where rpm-directory is /mnt/nfs/Errata/Packages You may need to run it several times to install some dependences. If you see conflicts with upgrading some runtime libraries, you may need to stop the applications that use these libraries. The kernel upgrades are located in directory /mnt/nfs/Errata/Kernel Pick up the compatible kernel and install it with RPM: cd /mnt/nfs/Errata/Kernel rpm -ivh kernel-name.rpm Kernel name, can be identified with command uname -a In our case, it is kernel-2.4.20-20.9.i686.rpm After finishing all the upgrades, unmount the Errata directory: umount /mnt/nfs Update the boot loader If you use LILO, modify /etc/lilo.conf to boot the new kernel. Your /etc/lilo.conf should look as follows:

    prompt timeout=50 default=linux boot=/dev/hda map=/boot/map install=/boot/boot.b message=/boot/message linear image=/boot/vmlinuz-2.4.20-20.9 label=linux initrd=/boot/initrd-2.4.20-20.9.img read-only append="root=LABEL=/" image=/boot/vmlinuz-2.4.20-8 label=linux-up initrd=/boot/initrd-2.4.20-8.img read-only append="root=LABEL=/"
Run LILO updates: /sbin/lilo -v If you use GRUB, make sure there is entry in /boot/grub/grub.conf:

default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-20.9)
        root (hd0,0)
        kernel /vmlinuz-2.4.20-20.9 ro root=LABEL=/
        initrd /initrd-2.4.20-20.9.img
title Red Hat Linux (2.4.20-8)
        root (hd0,0)
        kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
        initrd /initrd-2.4.20-8.img

Then run /sbin/grub-install /dev/hda You now should be able to boot into one of the kernels, the new and the old ones. Package Upgrade by using APT For easier system upgrade, you can use APT It allows you to avoid dependences problem during upgrades. To install and configure APT for RedHat 9, click on the "Latest version of apt" and download the RPM file, apt-0.5.5cnc6-fr1.i386.rpm. Install it by running rpm -ivh apt-0.5.5cnc6-fr1.i386.rpm Click on sources.list and save it as /etc/apt/source.list. Now you are ready to run system upgrade through APT: apt-get update apt-get dist-upgrade
Assignment due by 2/4/2003 Linux custom installation: A) Interactive over FTP B) Kickstart: create ks.cfg with /usr/sbin/redhat-config-kickstart and put it on a boot floppy. If you can't find redhat-config-kickstart in /usr/sbin, it is most likely the package is not installed. Check it running rpm -qa | grep redhat-config-kickstart If the package is not there, install it from the server installation directory using rpm: mkdir /mnt/nfs mount -t nfs 192.168.5.250:/usr/src/cd90 /mnt/nfs cd /mnt/nfs/RedHat/RPMS rpm -ivh redhat-config-kickstart-2.3.6-4.noarch.rpm umount /mnt/nfs Now you should be able to use Kickstart configurator. Btw, this is how you can install any software coming with Red Hat 9.0 distribution. Post-install configuration on your computer; Package upgrade (using the script and APT); Change GRUB for LILO, then LILO for GRUB; Read RedHat 9.0 Installation Reference; Read Red Hat 9 Kickstart manual; Read about disk partitioning with fdisk in Sec. 19.2.