Wednesday, December 8, 2010

PXE BOOT IN RHEL5

PXE server helps to install the operating systems through network boot. Its very useful and very time saving.

This post tells how to configure a PXE Server in Redhat linux and other variants.
###PXE Configuration###

dhcp + tftp + syslinux

###Install the packages###
#yum -y install dhcp*
#yum -y install tftp*
#yum -y install syslinux*

###Open the dhcp configuration file and add the following###
#vi /etc/dhcpd.conf
subnet 192.168.1.0
netmask 255.255.255.0
gateway 192.168.1.1
range From 192.168.1.128 To 192.168.1.254

allow booting;
allow bootp;
next-server 192.168.1.3;
filename "pxelinux.0";
:wq

###Copy the pxlinux.0 file to /tftpboot###
#cd /tftpboot
#cp /usr/lib/syslinux/pxelinux.0 .

###Copy the kernel and initrd.img files from DVD[/media/images/pxeboot/] to /tftpboot/###
#cp -rv /media/images/pxeboot/initrd.img .
#cp -rv /media/images/pxeboot/vmlinuz .

###Add kickstart file to /tftpboot/###
#vi ks.cfg Only if wanted. Otherwise you have to do attended remote installation.
nfs --server 192.168.1.2 --dir /media/rhel5 Just an example line!

###Create PXE configuration directory###
#mkdir /tftpboot/pxelinux.cfg/
#cd /tftpboot/pxelinux.cfg/

###Create PXE configuration file### That is ###/tftpboot/pxelinux.cfg/default file###
#vi default
PROMPT 1 To give the prompt [boot: ]. Otherwise it will automatically install the default label
DISPLAY boot.msg It shows the 1st window for options.
TIMEOUT 100 Wait for the choice this much time and after that will continue with deafult.
DEFAULT main Defines the main installation method. The default one.
ONERROR LOCALBOOT 0 Asking me? Google it :P

LABEL main The declaration of main label. In case if we didint give choice, this will execute.
KERNEL vmlinuz If in /tftpboot/ directory. If it is in /tftpboot/RHEL5-NFS u've to give RHEL5-NFS/vmlinuz
APPEND initrd=initrd.img Path of initrd.img.
LABEL 1
KERNEL Kernel location of choice 1 in boot.msg
APPEND Location of initrd.img

An Example
kernel RHEL5-NFS/vmlinuz
append initrd=RHEL5-NFS/initrd.img ramdisk_size=6457 method=nfs:192.168.1.2:/media/rhel5 ip=dhcp
LABEL 2
settings for option 2.
:wq

###Creating options message for the PXE boot###
#cd /tftpboot/
#vi boot.msg
##########################
Installing RHEL5 You can design this as you like.
##########################

1. RHEL5 NFS
2. RHEL5 FTP Set all these according to the entries in /tftpboot/pxelinux.cfg/default
3. RHEL5 HTTP
4. RHEL5 RESCUE

##########################

NOTE: Give execute permission for all files in /tftpboot/

###Restart the services###
#service dhcpd start
#service xinetd start
#chkconfig tftp on

Sunday, September 5, 2010

HOW TO CONFIGURE NFS SERVER IN RHEL5 (LINUX)

NFS (Network file System)SERVER SIDE CONFIGURATION

The Network File system is one of the most widely used network services.NFS is based on the
Remote procedure call or Portmap Service.It allows the client to mount,automount and therefore,transparently
access the remote file systems on the network.

Portnumber use:-

Port: 2049 {udp,tcp} by nfs
port: 111 {udp,tcp,sunrpc} by portmap

So, NFS daemon should be listening on both standard ports 2049 and portmap on port 111.

You can Check the portnumber of any protocol or service using following command:-

#cat /etc/services | grep 111 (here 111 is portnumber of portmap service)

#cat/etc/services | grep 2049 (here 2049 is portnumber of nfs)


We can also check the functioning of NFS by rpcinfo command.

#rpcinfo -p

after this we need to define all export folder or directories (all directories u want to share)
in /etc/exports file.


#vim /etc/exports

/home/directoryname 10.0.0.1(rw,sync,no_root_squash)
/home/dir1 10.0.0.0/24(ro,sync)


sync=synchronized mode
no_root_squash= by using this the remote client root user will be treated as a root and will
be able to change any file and directory and work as a root for that directory



Then after this restart the nfs service :-


# /etc/init.d/nfs restart or service nfs restart



If you later add some more exports in the /etc/exports file you can restart the nfs service
or run the exportfs command:

#exportfs -ra

SUDO Configuration Linux (RHEL5)

Sudo is actually stands for SuperUserDO.

Now the question is what is the need of Sudo command in linux.Actually if you have some users in your organization who want to execute some commands or access some files or directories which can be access only by super user i.e root user. So now what will u do ?
You have to give root password to every users who want to run those commands or access those directories or files.

But Guys and Gals this is not the correct solution for this scenario.

You need to implement SUDO .

In SUDO you need not to provide root password to users just to run those commands or access the database. You need to define priviledges for those users on particular command or group of command or more.After that user need to run the same command but the command should start with "sudo".

Syntax of Sudo command:-

sudo

here is your full command including options and arguments.

for example:-

sudo ls -l /root

Monday, June 21, 2010

History Of Linux >>>>

How To Repair Corrupted Grub of RHEL 5

Hi students,

As you are bit in touch with linux and you want to install linux but some times when you install linux and you get some Bootmanager is corrupted or grub > error when you dual boot your linux with any other windows os .So today i will let you know how you can remove this error and boot your both the OSes.


1. Insert the dvd(or 1st cd ) of RHEL5.
2. when your linux cd boot your pc and you have a prompt like this

boot:_

Write linux rescue command here

boot: linux rescue

3. Now select the language and other appropriate options

4. Then select continue to mount your partition in read and write mode.

5. After mounting your partition in read and write mode type the command given below when you have sh shell prompt

chroot /mnt/sysimage

6. Now type this command

grub-install /dev/hda (if you have sata hard disk then use sda in place of hda)

7. Type exit

8. Type exit again

9. System will Reboot !!! enjoy