This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Thursday 14 March 2013

pxe boot installation in linux

Below are the steps to configure a Kick Start Server(192.168.0.254) ::
1:: mkdir -p /data/network-install/RPM
    mkdir /data/network-install/kickstart/
2:: copy entire DVD contents
    cp -r /media/* /data/network-install/RPM/
3:: configure httpd.conf as below then start httpd service and verify http://192.168.0.254/network-install/RPM/
NameVirtualHost 192.168.0.254
<VirtualHost 192.168.0.254>
  ServerName 192.168.0.254
  DocumentRoot /data/
</VirtualHost>
<Directory /data/network-install>
   Options +Indexes
   AllowOverride AuthConfig
   order allow,deny
   allow from all
</Directory>
4:: disable firewall and SELinux of configure to work accordingly
5:: yum install system-config-kickstart
6:: run system-config-kickstart  command to configure and save ks.cfg file into /data/network-install/kickstart/ folder
    http server == 192.168.0.254
    http path   == /network-install/RPM/
    install method == text
    configure disk partition accordingly
    if u want to stop cups , sendmail service in off condition the use below commands in % post script section
    chkconfig cups off
    chkconfig sendmail off

now it is ready for Kick Start installation.............
insert DVD and boot the server. Give below command to start kickstart installation
linux ks=http://192.168.0.254/network-install/kickstart/ks.cfg

 If you have not configured ks.cfg file and just configured a http server then insert DVD and give below command to start installation:
linux askmethod
when prompt comes for Web site name == 192.168.0.254
when prompt comes for Directory     == /network-install/RPM/
==========================================================================

If you want to configure PXE boot Installation Server on the same server then follow below steps:

1:: install below packages using yum command ::
  tftp-server-*
 dhcp-*
 xinetd-*
 system-config-netboot
 syslinux
2:: run below command ::
 cp /usr/lib/syslinux/menu.c32 /tftpboot/
 cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
 cp /media/images/pxeboot/initrd.img /tftpboot/rhel5/
 cp /media/images/pxeboot/vmlinuz /tftpboot/rhel5/
3::    create a file "/tftpboot/pxelinux.cfg/default" and write below lines into the file::
timeout 100
default menu.c32
menu title $$$$$$Boot Menu$$$$$$
label 1
  menu label ^ 1) RHEL5
  kernel rhel5/vmlinuz
  append initrd=rhel5/initrd.img  ks=http://192.168.0.254/network-install/kickstart/ks.cfg  ksdevice=eth0
4::   configure dhcpd.conf

Allow booting;
Allow bootp;
authoritative;
ddns-update-style ad-hoc;
subnet 192.168.0.0 netmask 255.255.255.0 {
option routers               192.168.0.100;
option subnet-mask           255.255.255.0;
option domain-name           "example.com";
option domain-name-servers   192.168.0.254;
default-lease-time           2600;
max-lease-time               4800;
range dynamic-bootp 192.168.0.10 192.168.0.150;
filename  "pxelinux.0";
next-server  192.168.0.254;
}
5:: vi /etc/xinetd.d/tftp
# Open the xinetd settings to enable tftp server.
# at line 14 set the parameter to no from yes.
Disable=no
service xinetd restart

now power on  a server on which you want to install RHEL 6. Select boot from network option  when prompt comes to select boot media or use BIOS options to boot from network.

Saturday 13 October 2012

unix basic commands Quick Reference

SOLARIS QUICK REFERENCE

 # uname –a        [Gives all details about the system]

 # uname –m      [Displays H/W platform (sun4u)]

 # uname –p        [Machine processor architecture (sparc or i386)]

 # uname –i         [Machine model architecture (SUNW, Ultra 5_10)]

 # uname –X        [Detailed description]

 # mkdir –p /data/dir  [Creates directory and sub directory in one shot]

 # rmdir –r /data    [Deletes the directory and all its subdirectory and files]

 # cp –r /data /data1    [It copies the directory]

# echo $MANPATH : /usr/local/samba/man:

# echo $PATH    [Shows environmental path /usr/sbin:/usr/bin

 Grep Command Options 

-i       Searches for both upper & lower case characters
-l       Lists the names of files with matching lines
-n      Proceeds each line with the relative line number in the file
-v      Inverts the search to display lines that do not match the pattern
-w     Searches for the expression as a complete word.

# find /kris –name file1  [Searches for file file1 in /kris directory]

# find /ris –name file1 –exec ls –l {} \;  [Search and display ]

# find /kris –type f –size 0 –exec ls –l {} \;  [Search for the file with size 0]

# find /kris –user user1                               [Shows file used by user ‘user1’]
$ PATH=$PATH:/usr/ccs/bin:/usr/ucb:  [It will get appended to the existing path]

 # ln –s <source filename> <destination filename>       [Creating symbolic link]
# ln <source filename> <destination filename>             [Creating hard link]

 Unix File Permission

r – 4, 
w –2, 
x – 1,
_rw_ r_ _ r_ _ (644)            [Default file permission] 
drwx r_x r_x (755)              [Default directory permission] 
O G O                                  [Permission categories]

# ls –n /var/adm
 drwxrwxr_x 5 4 4 512 nov 15 14:55 file1 
5 - No of hard link to the file or directory 4 – The UID of the owner 4 – The GID of the group 512 – Size 

# Chmod –R 755 <dirctory name>    [For inherit permission]

VI Editor 

 Inserting and Appending Text 

a       - Append text after the cursor 
A      - Appends text at the end of the line 
i        - Inserts text before the cursor 
I        - Inserts text at the beginning of the line 
o        - Opens a new line below the cursor 
O       - Opens a new line above the cursor 
:r <file name>       - Inserts text from another file into the current file 

Key Sequence for theVI Editor

 n, left arrow or backspace        Left one characters 
j or down arrow                         Down one line 
k or up arrow                             Up one line 
l, right arrow or spacebar          Right one character 
w          Forward one word 
b           Back one word 
e           To the end of the current word 
$          To the end of the line 
0          (zero) To the beginning of the line 
^          To the first non whitespace character on the line 
Return Down to the beginning of the next line 
G         Goes to the last line of the file 
1G       Goes to the first line of the file 
:n         Goes to the line n 
nG       Goes to the line n 
Ctrl F    Pages forward one screen 
Ctrl D   Scroll down one half screen 
Ctrl B    Pages back one screen 
Ctrl U   Scrolls up one half screen 
Ctrl L    Refreshes the screen 

 Editing files using the VI editing commands 

R        Overwrites or replace characters to the right of the cursor
C        Changes or overwrites characters to the end of the line 
s         Substitute a string for a character at the cursor 
x         Deletes a character at the cursor 
dw      Deletes a word or part of the word to the right of the cursor 
dd       Dletes the line containing the cursor 
D         Deletes the line from the cursor to the right end of the line 
:n,nd    Deletes the line n through n 

Using the Text Changing Commands

 u       Undoes the previous command 
U       Undoes all changes to the current line 
.         Repeats the previous command 

Search and Replace Command

 /string              Searches forward for the string 
?string              Searches backward for the string 
n                       Searches the next occurrence of the string 
N                      Searches for the previous occurrence of the string 
:%s/old/new/g  Searches for the old string and replace it with the new string globally

 Using the text copying and Text Pasting Commands

yy            Yanks a copy of a line 
p              Puts yanked or deleted text under the line containing the cursor 
P              Puts yanked or deleted text before the line containing the cursor
:n,n co n  Copies lines n through n and puts them after line n 
:n,n m n   Moves lines n through n to line n File Archives 

# tar –cvf bkp.tar file1 file2  [Will archive file1 & file2]

# tar –tvf bkp.tar                    [Shows the table of content]

# tar –xvf bkp.tar                   [It extracts file from the tar archive]

# jar –cvf bkp.tar 

# jar –tvf bkp.jar 

# jar –xvf bkp.jar 

# compress bkp.tar      [To compress tar archive]

# ls bkp.tar.z 

# uncompress bkp.tar.z  [To uncompress tar archive]

# gzip bkp.tar                [To create gzip file bkp.tar.gz]

# gunzip bkp.tar.gz        [To extract the tar archive by gunzip bkp.tar]

# zip out.zip bkp.tar       [To create zip archive]

# unzip out.zip                [To extract the zip archive]