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

How to insert data from one table to another

To insert records from table to another, run the following command:

insert into table_name select fields1,field2…from table_name;

example:

mysql> insert into EXAMPLE select FIRST,LAST from TEST;

To insert records from table to another without duplicate, run the following command:

insert ignore into table_name select fields1,field2… from table_name;

example:

mysql> insert ignore into EXAMPLE select FIRST,LAST from TEST;

Comments Off on How to insert data from one table to another Posted in MySQL