Pages

Installing linux over network using kickstart

What is required?
  • LAN infrastructure for network communication.
  • NFS, FTP or HTTP Service for data transfer.
  • DHCP service for ip distribution.
  • TFTP service for booting from network.
  • Linux OS kernel image.
  • Bootloader binary.
  • Linux installation tree should be accessible from nfs,http or ftp.


LAN infrastructure:
  • Client must have pxe supported NIC.
  • Network devices on the LAN have to carry bootp packages


HTTP service (we can use http service):
  • DocumentRoot /var/www/html (contains linux installation tree and repository)
  • ServerName <Server Name>
  • url might be like http://192.168.1.10/rhrepos/6.2-x86_64/


DHCP service:
ddns-update-style interim;
ignore client-updates;
authoritative;
allow booting;
allow bootp;
subnet    <ip subnet>    netmask    <ip netmask>
{
option routers       <router ip>;
option subnet-mask      <ip netmask>;
option domain-name      "<domain name>";
option domain-name-servers     <dns server ip>;
range dynamic-bootp <starting address for ip distribution block> <ending address for ip distribution block> ;
default-lease-time   21600;
max-lease-time   43200;
next-server   <tftp server ip>;
filename  "pxelinux.0";
}


TFTP Service (required files should be copied to /tftpboot directory):
  • menu.c32 (menu binary for displaying menu list)
  • initrd.img (bootloader image)
  • vmlinuz (Linux kernel image)
/tftpboot/pxelinux.cfg/default should look like:
Main Menu
DEFAULT menu.c32
MENU TITLE Red Hat Enterprise Linux Installation
TIMEOUT 200
ALLOWOPTIONS 0
NOESCAPE 1
PROMPT 0
LABEL RHEL-6.2-x86_64
      MENU   LABEL Redhat EL 6.2 64-bit
      kernel vmlinuz-RHEL6.2-x86_64
      append initrd=initrd-RHEL6.2-x86_64.img ks=http://192.168.1.10/rhrepos/6.2-x86_64/ks-RHEL-6.2-x86_64.cfg
MENU END

Kickstart Answer File (you can use kickstart configurator system-config-kickstart):
#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth  --useshadow  --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Use graphical install
graphical
# Skip installation key
key --skip
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard trq
# System language
lang en_US
# Installation logging level
logging --level=info
# Use network installation
url --url=http://192.168.1.10/rhrepos/6.2-x86_64/
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Root password
rootpw --iscrypted sdfDßggasd'3$#>£.


# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone  Europe/Istanbul
# Install OS instead of upgrade
install
# Disk partitioning information
part /boot --fstype="ext3" --size=200
part swap --fstype="swap" --recommended
part /tmp --fstype="ext3" --size=2048
part / --fstype="ext3" --grow --size=1


%packages
@ X Window System
@ Desktop
nfs-utils
samba-client


%post
groupadd -g 1453 <normal user>
useradd -d /home/<normal user> -g <normal user> -u 1071 -s /bin/bash -p sdfDßggasd'3$#>£. <normal user>


pxe booting

kickstart menu

loading vmlinuz

configuring eth

retrieving install.img

formatting disks

installing redhat linux 6

No comments:

Post a Comment