Tuesday 28 April 2015

rsh configuration in linux

How to configure rsh in linux centos or redhat ..............????


This post shows you how to configure rsh in cluster environment

[root@lenovo ~]# yum install rsh rsh-server -y 

 Edit the configuration file for enabling rsh and rlogin

[root@lenovo ~]#vim /etc/xinetd.d/rsh

 service shell
 {
  socket_type             = stream
  wait                    = no
  user                    = root
  log_on_success          += USERID
  log_on_failure          += USERID
  server                  = /usr/sbin/in.rshd
  disable                 = no
 }
  you have to change only option "disable = no" .

 

[root@lenovo ~]# service xinetd restart 

 .rhosts file must be present in users home directory. This file allows a users to login without a password, Now i am going to create this file under root users home directory.

[root@lenovo ~]# vim ~/.rhosts
 

[root@lenovo ~]# cat ~/.rhosts
localhost
lenovo.example.com
client1.example.com
client2.example.com

 

[root@lenovo ~]# chmod 0600 ~/.rhosts

[root@lenovo ~]# vim /etc/securetty

Edit file /etc/securetty & append these entry

rsh 

rexec 

rlogin 

 

 


 

 


Friday 17 April 2015

How to create GPT disk label in RHEL or CentOS....???error "sda Must have a GPT disk label"


GPT(GUID Partition Table)
MBR and GPT are two different ways of storing the partitioning information. In RHEL6 the default way of partitioning a harddisk is to use a MS-DOS disk label.This type of partitioning a hard disk is an old method.Unfortunately this way of partitioning does have some problems that is MBR works with disks up to 2TB, But it can't handle disks more than 2TB.

NOTE:- RHEL 6.3 or later the installer will automatically use GPT partitioning for disks larger than 2TB in size.

Have you ever seen this error "sda Must have a GPT disk label" while installing RHEL (or) CentOS

 
Disable UEFI Mode in your machine BIOS setup 

[OR] 

Another way you can use PARTED Utility to resolve this issue:-

parted is a command which is used for disk partitioning and partition resizing program.

First PRESS CTRL+ALT+F2 to go to terminal for running parted utility from GUI

# parted
(parted) print /dev/sda

(parted) select /dev/sda

(parted) mklabel gpt

(parted) yes

(parted) print /dev/sda

(parted) quit

 Finally PRESS CTRL+ALT+F1 for return back to GUI mode.

Monday 13 April 2015

How to identify 64 bit processor in linux

[root@server Desktop]# grep flags /proc/cpuinfo | grep 'lm'

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm arat epb xsaveopt pln pts dtherm fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid

[Note:- Check Flag Entry in above output "lm" If you see lm flag then you can able to run 64bit Operating System in your machine]

[root@server Desktop]# uname -m
x86_64

uname is a command used to print system information x86_64 means 64bit operating system, i686,i386 means 32 bit.
[ If your CPU is 64 bit machine then it will support both 32bit & 64bit operating system, But If your machine[CPU] is 32bit it will support only 32bit operating system not 64bit  ]

How to install and configure OpenMPI in linux

Message Passing Interface (MPI)

MPI is mostly used in High Performance Computing.The Message Passing Interface (MPI) is a library specification that allows HPC to pass information between its various nodes and clusters. Also call MPI "is a message-passing application programmer interface, It is a language-independent used to program parallel computers.

Downloading OpenMPI From here


http://www.open-mpi.org/software/ompi/v1.8/

# wget http://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.4.tar.gz

# tar -xvzf openmpi-1.8.4.tar.gz

# ./configure --prefix=/opt/openmpi

# make

# make install

Setting Up Environment Variables


# vim .bashrc

export PATH=/opt/openmpi/bin:$PATH

export LD_LIBRARY_PATH=/opt/openmpi/lib:$LD_LIBRARY_PATH 

To view your path type the following command

# echo $PATH

How to run mpi program in parallel computing is mentioned below

[user@lenovo ~]$ mpirun -np 4 -hostfile hostfile ./helloworld.sh



Wednesday 8 April 2015

How to find processor speed on Linux OS

The File called cpuinfo_max_freq contains the maximum frequency in KHz

[root@lenovo ~]# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
3000000

(OR)

[root@lenovo ~]# cat /proc/cpuinfo
processor    : 0
vendor_id    : GenuineIntel
cpu family    : 6
model        : 23
model name    : Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz
stepping    : 6
cpu MHz        : 2000.000
cache size    : 6144 KB
physical id    : 0
siblings    : 2
core id        : 0
cpu cores    : 2
apicid        : 0
initial apicid    : 0
fpu        : yes
fpu_exception    : yes
cpuid level    : 10
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority
bogomips    : 5984.89
clflush size    : 64
cache_alignment    : 64
address sizes    : 36 bits physical, 48 bits virtual
power management:

processor    : 1
vendor_id    : GenuineIntel
cpu family    : 6
model        : 23
model name    : Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz
stepping    : 6
cpu MHz        : 3000.000
cache size    : 6144 KB
physical id    : 0
siblings    : 2
core id        : 1
cpu cores    : 2
apicid        : 1
initial apicid    : 1
fpu        : yes
fpu_exception    : yes
cpuid level    : 10
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority
bogomips    : 5984.89
clflush size    : 64
cache_alignment    : 64
address sizes    : 36 bits physical, 48 bits virtual
power management:

(OR)

[root@lenovo ~]# dmesg | grep CPU
SMP: Allowing 2 CPUs, 0 hotplug CPUs
NR_CPUS:4096 nr_cpumask_bits:2 nr_cpu_ids:2 nr_node_ids:1
PERCPU: Embedded 31 pages/cpu @ffff880002200000 s94872 r8192 d23912 u1048576
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 0
mce: CPU supports 6 MCE banks
CPU0: Thermal monitoring handled by SMI
CPU0: Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz stepping 06
CPU1: Thermal monitoring handled by SMI
Brought up 2 CPUs
microcode: CPU0 sig=0x10676, pf=0x1, revision=0x60c
microcode: CPU1 sig=0x10676, pf=0x1, revision=0x60c
microcode: CPU0 updated to revision 0x60f, date = 2010-09-29
microcode: CPU1 updated to revision 0x60f, date = 2010-09-29