Skip to main content

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

Comments

Popular posts from this blog

Find and replace with sed command in Linux

Find and replace feature is always handy. It can turn into a torture when it comes to change or delete a simple constant string in a text file. There is a handy tool in linux for doing these kind of tihngs. Actually sed is not a text editor but it is used outside of the text file to make changes.

Sending Jboss Server Logs to Logstash Using Filebeat with Multiline Support

In addition to sending system logs to logstash, it is possible to add a prospector section to the filebeat.yml for jboss server logs. Sometimes jboss server.log has single events made up from several lines of messages. In such cases Filebeat should be configured for a multiline prospector.
Filebeat takes lines do not start with a date pattern (look at pattern in the multiline section "^[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}" and negate section is set to true) and combines them with the previous line that starts with a date pattern.

server.log file excerpt where DatePattern: yyyy-MM-dd-HH and ConversionPattern: %d %-5p [%c] %m%n
Logstash filter: