Sunday, May 8, 2011

LVM In Linux

LVM

For easier hard disk storage management, you can set up your system to use the Logical Volume Manager (LVM), creating LVM partitions that are organized into logical volumes to which free space is automatically allocated. Logical volumes provide a more flexible and powerful way of dealing with disk storage, organizing physical partitions into logical volumes in which you can easily manage disk space. Disk storage for a logical volume is treated as one pool of memory, though the volume may in fact contain several hard disk partitions spread across different hard disks. Adding a new LVM partition merely increases the pool of storage accessible to the entire system.












Using the LVM Commands :-

lvdisplay :- Display detailed information about logical volumes
lvcreate :- Create logical volumes
lvrename :- Rename a logical volume
lvextend :- Extend the size of a logical volume
lvreduce :-Reduce the size of a logical volume
lvremove :-Remove logical volumes
pvdisplay :- Display detailed information about LVM physical partition
pvcreate :-Create LVM physical partitions
pvremove :-Delete LVM physical partitions
vgdisplay :-Display detailed information about volume groups
vgreduce :-Remove physical partitions from a volume group
vgremove :-Delete a volume group
vgextend :-command adds a new partition to a logical group.

Process to create LVM

Change the partition name and no only according to your system . Remain follow the same process without any change to create lvm .
# fdisk /dev/sda
N
Press Enter
+10G
N
Press Enter
+10G
T
6 (Declare Partition No.)
8e
T
7 (Declare Partition No.)
8e
W
# partprobe /dev/sda
# pvcreate /dev/sda{6,7}
# vgcreate vg0 /dev/sda{6,7}
# lvcreate –L 5G –n /dev/vg0/a
# lvcreate –L 5G –n /dev/vg0/b
# mkfs.ext4 /dev/vg0/a
# mkfs.ext4 /dev/vg0/b
# mkdir /lvm;mkdir /lvm1;mkdir /lvm/lvm2
# mount /dev/vg0/a /lvm/lvm1
# mount /dev/vg0/b /lvm/lvm2
# vi /etc/fstab
/dev/vg0/a /lvm/lvm1 ext4 defaults 0 0
/dev/vg0/b /lvm/lvm2 ext4 defaults 0 0
# lvextend -L +5G /dev/vg0/a
# lvdisplay
# df –h
# resize2fs /dev/vg0/a 15G
blog comments powered by Disqus
 

About Me

A Networking Media Copyright © 2010 Community is Customised by Steptotech