Monday, December 2, 2013

LVM (Logical Volume Management)

LVM (Logical Volume Management)

  With LVM, we can create logical partitions that can span across one or more physical hard drives. First, the hard drives are divided into physical volumes, then those physical volumes are combined together to create the volume group and finally the logical volumes are created from volume group.

How to Create LVM

fdisk /dev/sda

n                               (create 3 new partition)

t                                (change partition ID  to 8e)

w                              (save partition)

partprobe /dev/sda

pvcreate /dev/sda{8,9,10}                        (To create physical volume)
pvdisplay                                                   (To get detail of  physical volume)
vgcreate vg00 /dev/sda{8,9,10}               (To create virtual Group)

vgdisplay                                                   (To get detail of virtual Group)

lvcreate -L +100M -n lv01 /dev/vg00        (To create 1st logical volume)
lvcreate -L +100M -n lv02 /dev/vg00        (To create 2nd logical volume)
lvdisplay                                                    (To get detail of logical volume)

mke2fs -j /dev/vg00/01                              (To format 1st logical volume)
mke2fs -j /dev/vg00/02                              (To format 2nd logical volume)

mkdir xyz

mkdir xyz1

mount /dev/vg00/lv01 xyz                            (To mount 1st logical volume)   
mount /dev/vg00/lv02 xyz1                          (To mount 2nd logical volume)

mount -a                                                       (update mount)

vi /etc/fstab                                                   (update entry)



Expand and Reduce LV

lvextend –L +50M /dev/vg00/lv01
lvdisplay /dev/vg00/lv01
lvextend –L +50M /dev/vg00/lv01



Remove  LV, VG, PV partition


umount xyz
umount xyz1
lvremove /dev/bg00/lv01
lvremove /dev/bg00/lv02
vgremove /dev/vg00
pvremove /dev/sda{8,9,10}
vi /etc/fstab                                            (To delete entry)

fdisk /dev/sda                                        (press d to  delete partition )

Step by Step Configuration of YUM Server

How to Configure YUM

Most of the beginners in Linux faces a big problem when they are deploying a package i.e.; dependency failure. To resolve this issue Redhat introduced a technology called YUM.
YUM is a repository system contains information about packages and files inside every RPMs, Now Don’t worry about redhat repository .Create your own Yum repository in a local system and enjoy






Pre quest of yum server
I assume that you have completed these pre quest of yum server

1st) A Linux system with hostname Server.example.com and with ip address of 192.168.0.254

2nd) Dump of RHEL disk on /var/ftp/pub location

Once you have completed these pre quests follow this guide. change directory to /var/ftp/pub/Server








yum and createrepo rpm are required for yum server install them

 

Now install createrepo by rpm  command.




After installing necessary package change directory to /var/ftp/pub




Now create repository of Server directory

repository of all rpm will be created in few minute 



Now create repository for VT