How to install Linux RedHat 5.x or 6.x using kickstart over HTTP or CD-ROM (or .iso)

The following procedure apply for RedHat version 5.x or 6.x using a Windows or Linux webserver.
This post will not cover basic windows or Linux command that you must know before following this procedure.

=> installing linux system using Kickstart method over HTTP, ks.cfg and rpms will be downloaded from the server to the client. It is possible to configure DHCP or Static address for installation.

=> installing linux system using Kickstart method with local CD-ROM, ks.cfg will be downloaded from the server to the client and rpms will be readed locally from the CD-ROM. It is possible to configure DHCP or Static address for installation.

Please follow those steps in order to install Linux using kickstart method:

1) install VirtualBox
2) create a Linux VM
3) install WAMP if your kickstart server is running Windows or httpd package for Linux
4) modify the file http.conf as follow:

For Windows

<Directory “c:/wamp/www/pub/”>
    Options +Indexes
    AllowOverride AuthConfig
    Order allow,deny
    Allow from all 
</Directory>

For Linux

<Directory /var/www/html/pub>
    Options +Indexes
    AllowOverride AuthConfig
    Order allow,deny
    Allow from all
</Directory>

5) create the directory

For Windows

c:\wamp\www\pub

For Linux

/var/www/html/pub

6) create the following sub-directories

For Windows under c:\wamp\www\pub

disc1
disc2
disc3
disc4
disc5
kickstart

For Linux under /var/www/html/pub

disc1
disc2
disc3
disc4
disc5
kickstart

(INFO: discs 3,4,5 are not necessary for installation , but it will fail if they are not present while running anaconda script)

7) copy the file ks.cfg under

For Windows

c:\wamp\www\pub\kickstart

For Linux

/var/www/html/pub/kickstart

8) modidfy the file ks.cfg as follow:

=> If you plan to install over HTTP with DHCP address for the client, then use the following template (modify the text between <> with your data):

install
text
url –url http://<ip_address>/pub
key –skip
lang en_US.UTF-8
keyboard be-latin1
network –bootproto=dhcp –device=eth0 –noipv6

=> If you plan to install over HTTP with static address for the client, then use the following template (modify the text between <> with your data):

install
text
url –url http://<ip_address>/pub
key –skip
lang en_US.UTF-8
keyboard be-latin1
network –device eth0 –bootproto static –ip=<ip_address> –netmask=<netmask> –gateway=<gateway> –nameserver=<nameserver1,nameserver2> –hostname=<hostanme> –noipv6

=> If you plan to install using CD-ROM with DHCP address for the client, then use the following template (modify the text between <> with your data):

install
text
cdrom
key –skip
lang en_US.UTF-8
keyboard be-latin1
network –bootproto=dhcp –device=eth0 –noipv6

=> If you plan to install using CD-ROM with static address for the client, then use the following template (modify the text between <> with your data):

install
text
cdrom
key –skip
lang en_US.UTF-8
keyboard be-latin1
network –device eth0 –bootproto static –ip=<ip_address> –netmask=<netmask> –gateway=<gateway> –nameserver=<nameserver1,nameserver2> –hostname=<hostanme> –noipv6

9) modify the boot order of the Virtual Machine

CD-ROM -> HardDisk

10) copy the complete DVDs (disc1, disc2, …) in the following location on your kickstart server:

For windows

c:\wamp\www\pub\disc1
c:\wamp\www\pub\disc2
….
c:\wamp\www\pub\disc5

For Linux

/var/www/html/pub/disc1
/var/www/html/pub/disc2

/var/www/html/pub/disc5
11) mount the .iso linux image on your virtual machine
12) Power on your virtual machine
13) At boot menu (spalshscreen RedHat) type F2 if you install RedHat 5.x or esc if you install RedHat 6.x
14) At the boot prompt, type the following command:

=> If you plan to install over HTTP with DHCP address for the client, type the following command (modify the text between <> with your data)

linux ks=http://<ip_address>/pub/kickstart/ks.cfg

=> If you plan to install over HTTP with Static address for the client, type the following command (modify the text between <> with your data)

linux ks=http://<ip_address>/pub/kickstart/ks.cfg append ip=<ip_address> netmask=<netmask>

15) At the End of the installation, power off the virtual machine (kickstart configuration will only shutdown after full installation automatically) and change the boot order to :

HardDisk -> CD-ROM

16) power on your virtual machine
17) you are done!

Comments Off on How to install Linux RedHat 5.x or 6.x using kickstart over HTTP or CD-ROM (or .iso) Posted in Kickstart

How to create a kickstart ISO boot disk for RedHat

1) logon as root

2) create a directory name bootdisk/RHEL

mkdir -p bootdisk/RHEL

3) copy the directory isolinux from your RedHat DVD or other location containing RedHat binaries in bootdisk/RHEL

example: cp -R /mnt/isolinux/* ~/bootdisk/RHEL/

4) change direcotry to ~/bootdisk/RHEL/

cd ~/bootdisk/RHEL/

5) create (or copy) your ks.cfg  (it will be discussed  later in another post how to create a kickstart file) in ~/bootdisk/RHEL/

example: cp ks.cfg ~/bootdisk/RHEL/

6) Now, you can create the ISO boot disk as follow (make sure you run the command from ~/bootdisk/RHEL/) :

mkisofs -r -T -J -V “RedHat KSBoot” -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -v -o linuxboot.iso .

7) Burn your iso linuxboot.iso into a blank cd-rom or mount it as it is on a Virtual Machine for example

8) At linux boot prompt, type the following command:

linux ks=cdrom:/ks.cfg

if you need to install using a specific IP address using a specific Ks boot device, type the following:

linux ks=cdrom:/ks.cfg append ip=<IPaddress> netmask=<netmask> ksdevice=<NICx>

example: linux ks=cdrom:/ks.cfg append ip=10.10.10.10 netmask=255.255.255.0 ksdevice=eth0

9) your are done!

Comments Off on How to create a kickstart ISO boot disk for RedHat Posted in Kickstart

How to find WWPN of HBA on RedHat 6.x

Method 1)

To Find all HBA insterface on your system:

lspci -nn | grep -i hba

To Identify the WWPN(s):

ls -lrt /sys/class/fc_host/host[0-9]*/port_name

To Check the WWPN(s) number(s):

cat /sys/class/fc_host/host[0-9]*/port_name

Method 2)

Download and install the following packages:

rpm -ivh libsysfs-2.1.0-6.1.el6.x86_64.rpm
rpm -ivh sysfsutils-2.1.0-6.1.el6.x86_64.rpm

or

yum install sysfsutils

Find the device(s) attached to your system

ls -lrt /sys/class/fc_host/host[0-9]/port_name

To find FC HBA info on your system

systool -c fc_host -v -d hostx (example systool -c fc_host -v -d host5)

To find SCSI adapter info on your system

systool -c scsi_host -v -d hostx (example systool -c scsi_host -v -d host5)
You’re done!

Comments Off on How to find WWPN of HBA on RedHat 6.x Posted in Linux, RedHat

How to load data from file into table

If you want to load data into a table from a local file, do as follow:

load data local infile ” into table table_name fields terminated by ” lines terminated by ”;

example:

load data local infile ‘/input/data’ into table TEMPLATE fields terminated by ‘,’ lines terminated by ‘\n’;

Comments Off on How to load data from file into table Posted in Database, MySQL

How to disable IPV6 on RedHat 6.x

1. Add the following lines in the files listed below:

/etc/modprobe.d/modprobe.conf

options ipv6 disable=1
alias net-pf-10 off
alias ipv6 off
install ipv6 /bin/true

(for Redhat 5.x, file location is /etc/modprobe.conf)

/etc/sysconfig/network

NETWORKING_IPV6=no
IPV6INIT=no

/etc/sysconfig/network-scripts/ifcfg-ethx (x=0, 1, 2 …)

IPV6INIT=no

2. Disable ip6tables service

chkconfig ip6tables off

3. Reboot your system

init 6

or

reboot

or

shutdown -r now

4. Once your system if fully started:

rmmod ipv6

5. Make sure ipv6 module is not loaded

lsmod | grep ipv6

Comments Off on How to disable IPV6 on RedHat 6.x Posted in Linux, RedHat

How to rename column from table

To rename a column from an existing table, run the following command:

alter table table_name change old_column_name new_column_name attribute;

example:

alter table EXAMPLE change ONE TWO varchar(25);

Comments Off on How to rename column from table Posted in MySQL