Saturday, February 4, 2012

Common NFS errors & solutions

Common NFS errors & solutions:

1."Server Not Responding" Message
2.  "Access Denied" Message
3."Permission Denied" Message
4.  "Device Busy" Message

Error 1: If You Receive an NFS "Server Not Responding" Message

ping the nfs server from client "nfs serer name or ip"

2./usr/bin/rpcinfo -p servername

The rpcinfo command should display the following processes:

    * portmap
    * nfs
    * mountd
    * status
    * nlockmgr
    * llockmgr

If any of these processes is not running, follow the below steps:

a.Make sure the /etc/rc.config.d/nfsconf file on the NFS server contains the following lines:


b.Make sure that the /etc/inetd.conf file on the NFS server does not contain a line to start rpc.mountd.
If it does, make sure the START_MOUNTD variable in /etc/rc.config.d/nfsconf is set to 0.

c.Issue the following command on the NFS server to start all the necessary NFS processes:

#/sbin/init.d/nfs.server start

Error 2: If You Receive an "Access Denied" Message

a.check the FS is exported or not

#/usr/sbin/showmount -e server_name

(If it is not exported means u have to edit /etc/exports file in NFS server and put the necessary entry and
then run the command
/usr/sbin/exportfs -a)

Error 3 :If You Receive a "Permission Denied" Message

a.Check the mount options in the /etc/fstab file on the NFS client. A directory you are attempting to write to may have
been mounted read-only.

b.Issue the ls -l command to check the HP-UX permissions on the server directory and on the client directory
that is the mount point. You may not be allowed access to the directory.

c.Issue the following command on the NFS server:


Or, issue the following command on the NFS client:

/usr/sbin/showmount -e server_name

d. Check the export permissions on the exported directory. The directory may have been exported read-only to your client.
The system administrator of the NFS server can use the remount mount
option to mount the directory read/write without unmounting it

Error 4 : If You Receive a "Device Busy" Message

a.If you received the "device busy" message while attempting to mount a directory, try to access the mounted directory.
  If you can access it, then it is already mounted.
b.If you received the "device busy" message while attempting to unmount a directory, a user or process is currently using the directory. Wait until the process completes, or follow these steps:

 1.Issue the following command to determine who is using the mounted directory:

       /usr/sbin/fuser -cu local_mount_point

   The fuser(1M) command will return a list of process IDs and user names that are currently using the directory
   mounted under local_mount_point. This will help you decide whether to kill the processes or wait for them to complete.

 2. To kill all processes using the mounted directory, issue the following command:

            /usr/sbin/fuser -ck local_mount_point

 3. Try again to unmount the directory.

Short cut keys : Helpfull to every one

Different types of shell in UNIX and Linux

Unix Shell
A shell is  command interpreter between user and Unix kernel as well as provides a strong scripting language in UNIX
Following are the different types of Unix shells:
B shell - /bin/sh – This is the default Unix shell for many Unix operating systems .
Bourne shell was written by S. R. Bourne and its more emphasis is to use it as a scripting language rather than an interactive shell .
Some of the features are :
Provided support for environment variables using parameters and exportable variables.
Redirection of program output and error .
Command substitution using back quotes: `command`.
embed a file/commands using input redirector <<
“for ~ do ~ done” loops
“case ~ in ~ esac” for selecting and responding to a data value .
C-shell /bin/csh was designed to provide the interactive features lacking in b shell such as job control and aliasing .
K shell /bin/ksh – was created by David Korn and has features of both B shell and C shell along with some additional features .
Bash – the Bourne again shell was developed by GNU project .It is based on B shell language and has features of C and K shells.
tcsh is the default shell of FreeBSD and its descendants. Essentially it is C shell with programmable command line completion, command-line editing, and a few other features.
Zsh is a shell designed for interactive use and it has many of the useful features of bash, ksh, and tcsh along with many new features.

Unix Shell configuration files :

b shell
shell prompt : $
executable file : /bin/sh
Read on interactive/non interactive login to bash

bash shell
shell prompt : $
executable file : /bin/bash
Read on interactive/non interactive login to bash
Always read on invoking bash
/etc/profile login login login
~/.profile login login

csh shell
shell prompt : %
executable file : /bin/csh
Read on csh shell invocation .
Read on interactive/non interactive login to tcsh shell

shell prompt : $
executable file : /bin/ksh
Read on interactive/non interactive login to bash

tcsh shell
shell prompt : &
executable file : /bin/tcsh
Read on tcsh shell invocation .
Read on interactive/non interactive login to tcsh shell

shell prompt : $
executable file : zsh
Configuration files :
Always read on invoking zsh
~/.zshenv always
/etc/zshenv always
only read on interactive login to zsh.
Read on interactive/non interactive login to zsh
/etc/zprofile login
/etc/zlogin login
/etc/zlogout login
/.zprofile login
~/.zlogin login
~/.zlogout login

Repair Outlook PST File - Quick HOWTO

We need to Run the Inbox Repair Tool (scanpst.exe)  to repair the outlook PST file.
  1. Go to  "C:\Program Files\Microsoft Office\Office12"
  2. Double click the scanpst.exe file to open the program.
  3. Type the path and file name of the PST file, or Click Browse to locate the file.
  4. Click on the option which says Repair. (Ensure that backup check box is checked)
  5. This might take sometime depending on the size of the Outlook PST file.
You are done. This will repair most of the errors in PST file. Enjoy..!

Understanding VMSTAT Output - Explained

vmstat is a nice tool, to analyze the Linux / UNIX server performance.

 procs            memory                        swap        io       system    cpu
 r  b   swpd   free   buff  cache         si   so    bi    bo     in    cs       us sy id wa
 2  5 375912  19548  17556 477472    0    1     0     0      1     1        1  0  0  1
 0  4 375912  18700  17556 478264    0    0  1044   0     774  1329   8  1   0  91
 0  5 375912  17664  17556 479168    0    0  1160   0     764  1110   8  1   0  91
 1  8 375912  15836  17568 479796    0    0  1144   840  751  1622  16 7   0  78
 0  7 375912  19340  17576 480224    0    0  1224   148  587  1958  17 18  0  65
 2  0 375912  18288  17588 481036    0    0   812    0     845  1732  18 3  21  59
 0  2 375912  15868  17588 481528    0    0  1012   0     588   941   4   1  5   90 

r: How many processes are waiting for CPU time.
b: Wait Queue - Process which are waiting for I/O (disk, network, user 

swpd: shows how many blocks are swapped out to disk (paged). Total Virtual  
          memory usage. 
Note: you can see the swap area configured in server using "cat proc/swaps"

free: Idle Memory 
buff: Memory used as buffers, like before/after I/O operations
cache: Memory used as cache by the Operating System

si: How many blocks per second the operating system is swapping in. i.e 
    Memory swapped in from the disk (Read from swap area to Memory)
so: How many blocks per second the operating system is swaped Out. i.e 
     Memory swapped to the disk (Written to swap area and cleared from 

In Ideal condition, We like to see si and so at 0 most of the time, and we definitely don’t like to see more than 10 blocks per second.

bi: Blocks received from block device - Read (like a hard disk) 
bo: Blocks sent to a block device - Write

in: The number of interrupts per second, including the clock. 
cs: The number of context switches per second. 

us: percentage of cpu used for running non-kernel code. (user time, including 
     nice time) 
sy: percentage of cpu used for running kernel code. (system time - network, IO 
     interrupts, etc) 
id: cpu idle time in percentage.
wa: percentage of time spent by cpu for waiting to IO.

If you used to monitor this data, you can understand how is your server doing during peak usage times. 

Note: the memory, swap, and I/O statistics are in blocks, not in bytes. In Linux, blocks are usually 1,024 bytes (1 KB).

What is SSL? - Quick Overview

What is SSL?

  • SSL (Secure Sockets Layer) is the standard security technology for establishing an encrypted link between a web server and a browser. This link ensures that all data passed between the web server and browsers remain private and integral.
  • SSL is an industry standard and is used by millions of websites for the protection of their online transactions.
  • Founded by Netscape initially. Current version of SSL is 3.0

How it Works?

To create an SSL connection a web server requires an SSL Certificate. SSL Connection uses public key/private key to encrypt and decrypt the data transferred between the server and browser. The following are the step by step communications happens during a SSL connection:
  • A browser requests a secure page (https://)
  • The web server responds and sends its public key with its SSL Certificate.
  • The browser checks the following:

              Is the certificate was issued by a trusted party (trusted root CA)
              Is the certificate is still valid?
              Is the certificate is related to the site contacted?

  •  The Browser maintains the list of Certification Authority whom it trusts, if it fails on any one of these checks the browser will display a warning to the end user letting them know that the site is not secured by SSL.
  • The browser then encrypts the URL required as well as other http data using random symmetric encryption key and encrypts that random symmetric encryption key using the public key. Then sends it to the server with the encrypted.
  •  The web server decrypts the symmetric encryption key using its private key and uses that symmetric key to decrypt the URL and http data.
  • The web server sends back the requested html document and http data encrypted with the same symmetric key.
  • The browser decrypts the http data and html document using the symmetric key and displays the information.

How to obtain a SSL Certificate to use with Web Server?

You can obtain the certificate for your domain from the Trusted Certificate Providers like VeriSign, Comodo, GoDaddy. You may get charged for the certificate issuance. Alternatively, you can create and use a self-signed certificate with your web server.

What are the details a certificate holds?

Typically an SSL Certificate will contain,
  •            Your domain name
  •            Your company name
  •            Your address
  •           Your city
  •           Your state and your country
  •          The expiration date of the Certificate
  •          Details of the Certification Authority responsible for the issuance of the Certificate.

 How do you know whether the browser is using SSL?
  • The browsers provide users with a key indicator to let users know they are currently protected by an SSL encrypted session.
  • A lock icon in the lower right-hand corner or in the left-most side of the address bar indicating that, the server is using SSL connection.
  • Clicking on the lock icon displays your SSL Certificate and the details about it.
  • All SSL Certificates are issued to either companies or legally accountable individuals.