Powered By Blogger

Thursday, 27 June 2013

LVM

Logic Volume Manager
LVM is a software that allows Logical Partition Management. LVM is use for extend  and reduce size of the partition according to the requirement.
Physical Volume(PV)
Adding the new hardware for LVM is called Physical Volume.
Volume Group(VG)
Collection of physical volume is called Volume group.
Logical Volume(LV)
The space of volume group which is used for storing the data is called Logical Volume.

Implement of Logical Volume

#fdisk /dev/sda ( to create a new partition of 8e type)

Create Physical Volume
#pvcreate /dev/sda12 (sda12 is your new partition or new HDD)
#pvdisplay
Create Volume Group
#vgcreate kaushal /dev/sda12 (here kaushal is VG Name and /dev/sda12 is PV)
#vgcreate -S 16M kaushal /dev/sad12 (you can also create VG through this command. -s showing the size for VG 16m is the size for VG. kaushal is the name of VG)
#vgdisplay
#vgextend kaushal /dev/sda13 (to extend the size of VG)
#resize2fs -f /dev/kaushal/thakur
Create Logical Volume 
#lvcreate --size +1000M -n thakur kaushal ( here thakur is LV name and kaushal is VG name)
#lvdisplay
after that mount the volume
#mount /dev/kaushal/thakur /rhel (kaushal=VG, thakur=LV, Rhel=Mount Directory)
After that format the volume
#mkfs.ext3 /dev/kaushal/thakur

Extend The Size Of LV

#lvextend --size +1000M /dev/kaushal/thakur
#resize2fs -f /dev/kaushal/thakur

Remove LV, VG, PV

#lvremove lvname 
#vgremove vgname
#pvremove pvname

LV Reducing 

first of all unmount  the volume
#umount  /kaushal/thakur /rhel
#e2fsck -f /dev/kaushal/thakur
#regize2fs -f /dev/kaushal/thakur 500M
#lvreduse --size 500M /dev/kaushal/thakur 
#mount /dev/kaushal/thakur /rhel
Permanent Mount Of VG
#vim /etc/fstab
create here entry for your VG 



     

DHCP


Dynamic Host Configuration Protocol
DHCP is use for to provide the dynamic IP address and other network configuration such as getway address, DNS address  to host connected in the network.

                        Package = dhcp
                        Deamon = dhcpd
                        Port number = UDP 67 for dhcp server , 68 for dhcp clients
                        Configuration file = /etc/dhcp/dhcpd.conf

Configuration
                        # /etc/dhcp/dhcpd.conf
if you did not see any content in the file then copy all configuration content from the sample file. for this
                         # cp -p /usr/lib/dhcpd/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
edit /etc/dhcp/dhcpd.conf file
                         1) give here network address and subnet mask
                         2) give here server IP address NIS Domain, Domain and DNS domain name if you have.
                         3) after that give the range of IP you want to use in the network.
                         4) you can also reserve IP for future use
                         5) at last of file you can spicify the IP address for perticulre MAC address.
after that save and exit from the file and restart the DHCP service.
                          #service dhcpd restart 
On client 
 set automatically IP address under the LAN card property.
                           #dhclient ( for requesting the IP from server)