Friday, April 19, 2013

Installing PHP on Linux (CentOS release 6.4 Final)


Mount the DVD go to the Packages directory and install the packages manually with rpm command.
You can do this task with yum too, for that you will have to setup YUM repository.

[root@cluster1 Packages]# rpm -ivh php-common-5.3.3-22.el6.x86_64.rpm
warning: php-common-5.3.3-22.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:php-common             ########################################### [100%]
[root@cluster1 Packages]# rpm -ivh php-cli-5.3.3-22.el6.x86_64.rpm
warning: php-cli-5.3.3-22.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:php-cli                ########################################### [100%]
[root@cluster1 Packages]# rpm -ivh php-5.3.3-22.el6.x86_64.rpm
warning: php-5.3.3-22.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:php                    ########################################### [100%]


[root@cluster1 Packages]# php -v
PHP 5.3.3 (cli) (built: Feb 22 2013 02:51:11)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies


Thanks!

Thursday, April 11, 2013

Useful One liners.


Excellent example of appending the "/home/" in front of all the users name in a file
which has 3222 records.


%s/^/\/home\//g


----------------------------------------------


 df -hl | awk '{ print $1 "; " "\t" $5}' | sort -n

------------------------------------------

AUTOENV=/opt/CA/WorkloadAutomationAE/autouser.PRD/autosys.sh.trs20

--------------------------------------------

Following command will create 1 GB File system

dd if=/dev/zero of=test.iso2 bs=1024 count=1000000

--------------------------------------------


Following command will count the file size in GB/MB i.e. in human readable form:

for i in `du -sh * |sort -n |cut -f2`; do du -sh $i; done

--------------------------------------------

# tar -xvf etc.tar -C test/  ---> Untar the tarball in test directory.

# tar -tvf etc.tar ---> To view the tarball contents without actually extracting.

--------------------------------------------

Use dd command to create an ISO image

# if=/dev/cdrom of=/datacdimg.iso

thats it!

--------------------------------------------

# cut -d: '' -f1 passwd ---> Will print first column

# cut -d: -f1,6 passwd ---> will extract user &  home directory.

--------------------------------------------
awk:bash

awk -F':' '{print $1}' passwd  ---> This will get the first column separated by : ex. passwd file.
How to create shortcut:  For DOS command on the desktop



Note: Not a good idea for security conscious people!

Putty root@11.11.11.11 -pw %$#ytYGH77


Follow the screen shots:

1. right click the desktop ---> New ---> Shortcut


2. Type the command you want to create a shortcut:



3. Lets say you want to create a shortcut for putty command to login with saved passwd



4. Name the shortcut


5. You will see the shortcut on the desktop click it and login 



Thats it!

Friday, April 5, 2013

VSFTPD server setup

How to set up vsftpd on RHEL 6




[root@cluster1 Packages]# rpm -ivh ftp-0.17-53.el6.x86_64.rpm
warning: ftp-0.17-53.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:ftp                       ########################################### [100%]

# rpm -ivh vsftpd-2.2.2-11.el6_3.1.x86_64.rpm

[root@cluster1 mnt]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]

edit /etc/vsftpd/vsftpd.conf

# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES

# You may fully customise the login banner string:
ftpd_banner=Welcome to Rajftpd  FTP service.

# Uncomment this to allow local users to log in.
local_enable=YES



C:\Users\raj>ftp 164.87.119.22
Connected to 144.77.109.90.
220 Welcome to Rajftpd  FTP service.
User (144.77.109.90:(none)): joe
331 Please specify the password.
Password:
230 Login successful.
ftp> dir
200 PORT command successful. Consider us
150 Here comes the directory listing.
226 Directory send OK.
ftp> bye
221 Goodbye.

C:\Users\raj>ftp 164.87.119.22
Connected to 144.77.109.90.
220 Welcome to Rajftpd  FTP service.
User (144.77.109.90:(none)): raj
331 Please specify the password.
Password:
230 Login successful.

Wednesday, February 27, 2013

Create a dummy file in Linux.

This is a one liner to create a dummy file in Linux/Unix for testing purpose:

 dd if=/dev/zero of=dummyfile1.txt bs=1234567801 count=1

-rw-r--r-- 1 root root 1234567801 Feb 25 05:16 dummyfile1.txt


[root@RHEL5 ~]# du -sh dummyfile1.txt
1.2G    dummyfile1.txt

Creating RAID 5 with LVM and testing the disk failure.


Create 4 disks  of same size. scan the bus, run the fdisk -l command to view the newly created partitions
and follow the blog for the next steps.......

[root@RHEL5 ~]# echo "- - -" >  /sys/class/scsi_host/host0/scan

[root@RHEL5 ~]# fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         382     3068383+  83  Linux
/dev/sda2             383        1019     5116702+  83  Linux
/dev/sda3            1020        1503     3887730   83  Linux
/dev/sda4            1504        2610     8891977+   5  Extended
/dev/sda5            1504        1885     3068383+  83  Linux
/dev/sda6            1886        2076     1534176   82  Linux swap / Solaris
/dev/sda7            2077        2203     1020096   83  Linux
/dev/sda8            2204        2241      305203+  83  Linux

Disk /dev/sdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table

Disk /dev/sdd: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdd doesn't contain a valid partition table
[root@RHEL5 ~]#


------------------------------------------------------------

[root@RHEL5 ~]# mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc /dev/sdd
mdadm: layout defaults to left-symmetric
mdadm: chunk size defaults to 64K
mdadm: size set to 1048512K
mdadm: array /dev/md0 started.

------------------------------------------------------------

[root@RHEL5 ~]# mdadm --detail /dev/md0
/dev/md0:
        Version : 00.90.03
  Creation Time : Mon Feb 25 04:13:51 2013
     Raid Level : raid5
     Array Size : 2097024 (2048.22 MiB 2147.35 MB)
    Device Size : 1048512 (1024.11 MiB 1073.68 MB)
   Raid Devices : 3
  Total Devices : 3
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Mon Feb 25 04:13:51 2013
          State : clean, degraded, recovering
 Active Devices : 2
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 1

         Layout : left-symmetric
     Chunk Size : 64K

 Rebuild Status : 83% complete

           UUID : a1ed8a09:8b0a0913:c2f6d8b1:5c67dfeb
         Events : 0.1

    Number   Major   Minor   RaidDevice State
       0       8       16        0      active sync   /dev/sdb
       1       8       32        1      active sync   /dev/sdc
       3       8       48        2      spare rebuilding   /dev/sdd


------------------------------------------------------------

[root@RHEL5 ~]# mdadm --detail /dev/md0
/dev/md0:
        Version : 00.90.03
  Creation Time : Mon Feb 25 04:13:51 2013
     Raid Level : raid5
     Array Size : 2097024 (2048.22 MiB 2147.35 MB)
    Device Size : 1048512 (1024.11 MiB 1073.68 MB)
   Raid Devices : 3
  Total Devices : 3
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Mon Feb 25 04:14:29 2013
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

           UUID : a1ed8a09:8b0a0913:c2f6d8b1:5c67dfeb
         Events : 0.2

    Number   Major   Minor   RaidDevice State
       0       8       16        0      active sync   /dev/sdb
       1       8       32        1      active sync   /dev/sdc
       2       8       48        2      active sync   /dev/sdd


------------------------------------------------------------

[root@RHEL5 ~]# pvcreate  /dev/md0
  Physical volume "/dev/md0" successfully created

[root@RHEL5 ~]# vgcreate lvm-raid /dev/md0
  Volume group "lvm-raid" successfully created

------------------------------------------------------------

[root@RHEL5 ~]# vgs
  VG       #PV #LV #SN Attr   VSize VFree
  lvm-raid   1   0   0 wz--n- 2.00G 2.00G

[root@RHEL5 ~]# pvs
  PV         VG       Fmt  Attr PSize PFree
  /dev/md0   lvm-raid lvm2 a-   2.00G 2.00G


------------------------------------------------------------

 Free  PE / Size       511 / 2.00 GB


[root@RHEL5 ~]# lvcreate -L 511 lvm-raid -n lvm0
  /dev/cdrom: open failed: Read-only file system
  Rounding up size to full physical extent 512.00 MB
  Logical volume "lvm0" created


------------------------------------------------------------

[root@RHEL5 /]# mke2fs -j /dev/lvm-raid/lvm0
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
131072 inodes, 524288 blocks
26214 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
64 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409

Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

------------------------------------------------------------

[root@RHEL5 /]# mount /dev/lvm-raid/lvm0 /data/
[root@RHEL5 /]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             2.9G  262M  2.5G  10% /
tmpfs                 506M     0  506M   0% /dev/shm
/dev/sda8             289M   11M  264M   4% /home
/dev/sda2             4.8G  138M  4.4G   4% /opt
/dev/sda7             965M   18M  898M   2% /tmp
/dev/sda5             2.9G  2.2G  531M  81% /usr
/dev/sda3             3.6G  124M  3.3G   4% /var
/dev/mapper/lvm--raid-lvm0
                      496M   19M  452M   4% /data

------------------------------------------------------------

Take the /dev/sdb out of the raid array.

[root@RHEL5 /]# mdadm /dev/md0 -f /dev/sdb
mdadm: set /dev/sdb faulty in /dev/md0
[root@RHEL5 /]# mdadm --detail /dev/md0
/dev/md0:
        Version : 00.90.03
  Creation Time : Mon Feb 25 04:13:51 2013
     Raid Level : raid5
     Array Size : 2097024 (2048.22 MiB 2147.35 MB)
    Device Size : 1048512 (1024.11 MiB 1073.68 MB)
   Raid Devices : 3
  Total Devices : 3
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Mon Feb 25 04:35:37 2013
          State : clean, degraded
 Active Devices : 2
Working Devices : 2
 Failed Devices : 1
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

           UUID : a1ed8a09:8b0a0913:c2f6d8b1:5c67dfeb
         Events : 0.4

    Number   Major   Minor   RaidDevice State
       0       0        0        0      removed
       1       8       32        1      active sync   /dev/sdc
       2       8       48        2      active sync   /dev/sdd

       3       8       16        -      faulty spare   /dev/sdb


--------------------------------------------------------------

[root@RHEL5 /]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@RHEL5 /]# fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         382     3068383+  83  Linux
/dev/sda2             383        1019     5116702+  83  Linux
/dev/sda3            1020        1503     3887730   83  Linux
/dev/sda4            1504        2610     8891977+   5  Extended
/dev/sda5            1504        1885     3068383+  83  Linux
/dev/sda6            1886        2076     1534176   82  Linux swap / Solaris
/dev/sda7            2077        2203     1020096   83  Linux
/dev/sda8            2204        2241      305203+  83  Linux

Disk /dev/md0: 2147 MB, 2147352576 bytes
2 heads, 4 sectors/track, 524256 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md0 doesn't contain a valid partition table

Disk /dev/sdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table

Disk /dev/sdd: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdd doesn't contain a valid partition table

Disk /dev/sde: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sde doesn't contain a valid partition table

Noe lets add the newly created device in the array.

--------------------------------------------------------------

[root@RHEL5 /]# mdadm /dev/md0 -a /dev/sde
mdadm: added /dev/sde


See the output the device is seen:

[root@RHEL5 /]# mdadm --detail /dev/md0
/dev/md0:
        Version : 00.90.03
  Creation Time : Mon Feb 25 04:13:51 2013
     Raid Level : raid5
     Array Size : 2097024 (2048.22 MiB 2147.35 MB)
    Device Size : 1048512 (1024.11 MiB 1073.68 MB)
   Raid Devices : 3
  Total Devices : 4
Preferred Minor : 0
    Persistence : Superblock is persistent


    Update Time : Mon Feb 25 04:41:01 2013
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 1
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

           UUID : a1ed8a09:8b0a0913:c2f6d8b1:5c67dfeb
         Events : 0.6

    Number   Major   Minor   RaidDevice State
       0       8       64        0      active sync   /dev/sde
       1       8       32        1      active sync   /dev/sdc
       2       8       48        2      active sync   /dev/sdd

       3       8       16        -      faulty spare   /dev/sdb


--------------------------------------------------------------

Thanks.


























Tuesday, January 22, 2013

LVM - Create Physical/Logical volume group and adding new physical volumes to the volume group

Create three physical partitions:

/dev/sde
/dev/sdf
/dev/sdg

I have allocated all the space to the sde sdf sdg respectively.

Lets create physical volumes out of the partitions we created.

[root@rajcentos ~]# pvcreate /dev/sde1 /dev/sdf1 /dev/sdg1
  Physical volume "/dev/sde1" successfully created
  Physical volume "/dev/sdf1" successfully created
  Physical volume "/dev/sdg1" successfully created

I have named the volume group as raj_vg

[root@rajcentos ~]# vgcreate raj_vg /dev/sde1 /dev/sdf1 /dev/sdg1
  Volume group "raj_vg" successfully created

If you run pvscan:

[root@rajcentos ~]# pvscan
  PV /dev/sde1   VG raj_vg       lvm2 [48.00 MB / 48.00 MB free]
  PV /dev/sdf1   VG raj_vg       lvm2 [28.00 MB / 28.00 MB free]
  PV /dev/sdg1   VG raj_vg       lvm2 [16.00 MB / 16.00 MB free]
  PV /dev/sda2   VG VolGroup00   lvm2 [7.88 GB / 32.00 MB free]
  Total: 4 [7.96 GB] / in use: 4 [7.96 GB] / in no VG: 0 [0   ]

Here is the vgdisplay output:

[root@rajcentos ~]# vgdisplay
  --- Volume group ---
  VG Name               raj_vg
  System ID
  Format                lvm2
  Metadata Areas        3
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                3
  Act PV                3
  VG Size               92.00 MB
  PE Size               4.00 MB
  Total PE              23
  Alloc PE / Size       0 / 0
  Free  PE / Size       23 / 92.00 MB
  VG UUID               hinsab-4Ube-dinI-HmsK-TQ19-UWu1-j9h0bF

[root@rajcentos ~]# vgs
  VG         #PV #LV #SN Attr   VSize  VFree
  VolGroup00   1   2   0 wz--n-  7.88G 32.00M
  raj_vg       3   0   0 wz--n- 92.00M 92.00M

[root@rajcentos ~]# pvs
  PV         VG         Fmt  Attr PSize  PFree
  /dev/sda2  VolGroup00 lvm2 a-    7.88G 32.00M
  /dev/sde1  raj_vg     lvm2 a-   48.00M 48.00M
  /dev/sdf1  raj_vg     lvm2 a-   28.00M 28.00M
  /dev/sdg1  raj_vg     lvm2 a-   16.00M 16.00M

Now create logical volume groups from the "raj_vg"

[root@rajcentos ~]# lvcreate -n lv_one --size 20M raj_vg
  Logical volume "lv_one" created
[root@rajcentos ~]# lvcreate -n lv_two --size 20M raj_vg
  Logical volume "lv_two" created
[root@rajcentos ~]# lvcreate -n lv_three --size 20M raj_vg
  Logical volume "lv_three" created

[root@rajcentos ~]# lvs
  LV       VG         Attr   LSize   Origin Snap%  Move Log Copy%
  LogVol00 VolGroup00 -wi-ao   7.34G
  LogVol01 VolGroup00 -wi-ao 512.00M
  lv_one   raj_vg     -wi-a-  20.00M
  lv_three raj_vg     -wi-a-  20.00M
  lv_two   raj_vg     -wi-a-  20.00M

[root@rajcentos ~]# vgs
  VG         #PV #LV #SN Attr   VSize  VFree
  VolGroup00   1   2   0 wz--n-  7.88G 32.00M
  raj_vg       3   3   0 wz--n- 92.00M 32.00M

Lets format the filesystem:

[root@rajcentos ~]# mkfs -t ext3 /dev/mapper/raj_vg-lv_one
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
5136 inodes, 20480 blocks
1024 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=20971520
3 block groups
8192 blocks per group, 8192 fragments per group
1712 inodes per group
Superblock backups stored on blocks:
        8193

Writing inode tables: done
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@rajcentos ~]# mkfs -t ext3 /dev/mapper/raj_vg-lv_two
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
5136 inodes, 20480 blocks
1024 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=20971520
3 block groups
8192 blocks per group, 8192 fragments per group
1712 inodes per group
Superblock backups stored on blocks:
        8193

Writing inode tables: done
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@rajcentos ~]# mkfs -t ext3 /dev/mapper/raj_vg-lv_three
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
5136 inodes, 20480 blocks
1024 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=20971520
3 block groups
8192 blocks per group, 8192 fragments per group
1712 inodes per group
Superblock backups stored on blocks:
        8193

Writing inode tables: done
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

run lvs now:

[root@rajcentos ~]# lvs
  LV       VG         Attr   LSize   Origin Snap%  Move Log Copy%
  LogVol00 VolGroup00 -wi-ao   7.34G
  LogVol01 VolGroup00 -wi-ao 512.00M
  lv_one   raj_vg     -wi-a-  20.00M
  lv_three raj_vg     -wi-a-  20.00M
  lv_two   raj_vg     -wi-a-  20.00M

Creating the directories so that the newly created volumes can be mounted:

[root@rajcentos ~]# mkdir /apps
[root@rajcentos ~]# mkdir /vontu
[root@rajcentos ~]# mkdir /ppm

To mount the volumes refer to the path:

[root@rajcentos ~]# mount /dev/mapper/raj_vg-lv_one /apps

[root@rajcentos ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      7.3G  1.2G  5.7G  18% /
/dev/sda1              99M   13M   81M  14% /boot
none                  125M     0  125M   0% /dev/shm
/dev/mapper/raj_vg-lv_one
                       20M  1.2M   18M   7% /apps

[root@rajcentos ~]# mount /dev/mapper/raj_vg-lv_two /vontu

[root@rajcentos ~]# mount /dev/mapper/raj_vg-lv_three /ppm

[root@rajcentos ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      7.3G  1.2G  5.7G  18% /
/dev/sda1              99M   13M   81M  14% /boot
none                  125M     0  125M   0% /dev/shm
/dev/mapper/raj_vg-lv_one
                       20M  1.2M   18M   7% /apps
/dev/mapper/raj_vg-lv_two
                       20M  1.2M   18M   7% /vontu
/dev/mapper/raj_vg-lv_three
                       20M  1.2M   18M   7% /ppm


[root@rajcentos ~]# pvscan
  PV /dev/sde1   VG raj_vg       lvm2 [48.00 MB / 8.00 MB free]
  PV /dev/sdf1   VG raj_vg       lvm2 [28.00 MB / 8.00 MB free]
  PV /dev/sdg1   VG raj_vg       lvm2 [16.00 MB / 16.00 MB free]
  PV /dev/sda2   VG VolGroup00   lvm2 [7.88 GB / 32.00 MB free]
  Total: 4 [7.96 GB] / in use: 4 [7.96 GB] / in no VG: 0 [0   ]
[root@rajcentos ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       7579576   1254184   5940368  18% /
/dev/sda1               101086     13240     82627  14% /boot
none                    127364         0    127364   0% /dev/shm
/dev/mapper/raj_vg-lv_one
                         19827      1202     17601   7% /apps
/dev/mapper/raj_vg-lv_two
                         19827      1202     17601   7% /vontu
/dev/mapper/raj_vg-lv_three
                         19827      1202     17601   7% /ppm


Adding a new physical volume to the volume group. You can use vgextend:
/dev/sdb1 and 2 I have created saperately so that those could be added to the
existing raj_vg.

[root@rajcentos ~]# lvs
  LV       VG         Attr   LSize   Origin Snap%  Move Log Copy%
  LogVol00 VolGroup00 -wi-ao   7.34G
  LogVol01 VolGroup00 -wi-ao 512.00M
  lv_one   raj_vg     -wi-a-  20.00M
  lv_three raj_vg     -wi-a-  20.00M
  lv_two   raj_vg     -wi-a-  20.00M

[root@rajcentos ~]# vgextend raj_vg /dev/sdb1

  Volume group "raj_vg" successfully extended
[root@rajcentos ~]# vgs
  VG         #PV #LV #SN Attr   VSize   VFree
  VolGroup00   1   2   0 wz--n-   7.88G  32.00M
  raj_vg       4   3   0 wz--n- 404.00M 344.00M
[root@rajcentos ~]# vgextend raj_vg /dev/sdb2
  Volume group "raj_vg" successfully extended

Now see the change in the size of raj_vg

[root@rajcentos ~]# vgs
  VG         #PV #LV #SN Attr   VSize   VFree
  VolGroup00   1   2   0 wz--n-   7.88G  32.00M
  raj_vg       5   3   0 wz--n- 500.00M 440.00M