Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Linux Tracker

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 217 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here




       lvm is a logical volume manager for Linux.  It enables you
       to concatenate several physical volumes (hard disks  etc.)
       into  a  so  called  volume group (VG, see pvcreate(8) and
       vgcreate(8) ) forming a storage pool, like a virtual disk.
       IDE,  SCSI disks as well as multiple devices (MD) are sup­
       ported.  The storage capacity of a  volume  group  can  be
       divided into logical volumes (LVs), like virtual disk par­
       titions. The size of a logical volume is in  multiples  of
       physical extents (PEs, see lvcreate(8) ).
       The size of the physical extents can be configured at vol­
       ume group creation time. If a logical volume is too  small
       or  too  large  you  can  change its size at runtime ( see
       lvextend(8) and lvreduce(8) ).  lvcreate(8) can be used to
       create  snapshots  of  existing logical volumes (so called
       original logical volumes in this context) as well.
       Creating a snapshot logical volumes grants access  to  the
       contents  of  the original logical volume it is associated
       with and exposes the read only contents  at  the  creation
       time  of  the  snapshot. This is useful for backups or for
       keeping several versions of filesystems online.
       If you run out of space in a volume group it  is  possible
       to  add one or more pvcreate'd disks to the system and put
       them into an existing volume group (  see  vgextend(8)  ).
       The space on these new physical volumes can be dynamically
       added to logical volumes in that volume group ( see  lvex­
       tend(8) ).
       To  remove  a physical volume from the system you can move
       allocated logical extents to different physical volumes  (
       see  pvmove(8) ). After the pvmove the volume group can be
       reduced with the vgreduce(8) command.
       Inactive volume groups must be activated with  vgchange(8)
       before  use.   vgcreate(8) automatically activates a newly
       created volume group.


       PV for physical volume, PE for  physical  extent,  VG  for
       volume  group,  LV  for logical volume, and LE for logical

Command naming convention

       All command names corresponding to physical volumes  start
       with  pv,  all the ones concerned with volume groups start
       with vg and all for logical volumes with lv.  General pur­
       pose commands for the lvm as a whole start with lvm.


       The volume group descriptor area (or VGDA for short) holds
       the necessary metadata to handle the LVM functionality. It
       is  stored  at  the beginning of each pvcreate'd disk.  It
       contains four parts: one PV descriptor, one VG descriptor,
       the LV descriptors and several PE descriptors. LE descrip­
       with  up  to  256  logical  volumes or anything in between
       these extreme examples.

       Depending on the physical extent size specified at  volume
       group creation time (see vgcreate(8) ), logical volumes of
       between a maximum of 512 Megabytes and 1 Petabyte  can  be
       created.   Actual  Linux  kernels  on IA32 limit these lvm
       possibilities to a maximum of 2 Terabytes per logical  and
       per  physical  volume as well. This enables you to have as
       much as 256 Terabytes under LVM control with all  possible
       128  scsi disk subsystems.  You can have up to 65534 logi­
       cal extents (on IA32) in a logical volume at the cost of 1
       Megabyte  in  kernel memory.  Physical volumes can have up
       to 65534 physical extents.

/proc filesystem support

       The operational state of active volume groups  with  their
       physical   and   logical  volumes  can  be  found  in  the
       /proc/lvm/ directory.  /proc/lvm/global contains a summary
       of  all  available  information regarding all VGs, LVs and
       PVs.  The two flags for PV status in brackets mean A/I for
       active/inactive  and  A/N  for allocatable or non-allocat­
       able.  The four flags for LV status in brackets  mean  A/I
       for  active/inactive, R/W for read-only or read/write, D/C
       for discontiguous or contiguous  and  L/S  for  linear  or
       striped.   S  can  optionally be followed by the number of
       stripes in the set.  At /proc/lvm/VGs/ starts a  subdirec­
       tory  hierarchy containing information about every VG in a
       different subdirectory named /proc/lvm/VGs/VolumeGroupName
       where  VolumeGroupName  stands  for  an arbitrary VG name.
       /proc/lvm/VGs/VolumeGroupName/ in turn holds a file  group
       containing  summary  information  for  the  VG as a total.
       /proc/lvm/VGs/VolumeGroupName/LVs/LogicalVolumeName  holds
       information  for  an  arbitrary LV named LogicalVolumeName
       /proc/lvm/VGs/VolumeGroupName/PVs/PhysicalVolumeName  con­
       tains  information for an arbitrary PV named PhysicalVolu­
       meName.   All  of  the  information  in  the  files  below
       /proc/lvm/VGs/ is presented in attribute/value pairs to be
       easyly parsable.


       We have disk partitions /dev/sda3, /dev/sdb1 and /dev/hda2
       free  for  use  and  want  to  create a volume group named
       "test_vg".  Steps required:

       1. Change partition type for these 3  partitions  to  0x8e
       with  fdisk.  (see pvcreate(8): 0x8e identifies LVM parti­

       2. pvcreate /dev/sda3 /dev/sdb1 /dev/hda2

       Now let's rock and roll.  For example create a file system
       with  "mkfs  -t ext2 /dev/test_vg/my_test_lv" and mount it
       with "mount /dev/test_vg/my_test_lv /usr1"

See also

       e2fsadm(8), lvchange(8), lvcreate(8), lvdisplay(8),
       lvextend(8), lvmchange(8), lvmdiskscan(8),
       lvmcreate_initrd(8), lvmsadc(8), lvmsar(8),
       lvreduce(8), lvremove(8), lvrename(8),
       lvscan(8), pvchange(8), pvcreate(8), pvdata(8),
       pvdisplay(8), pvmove(8), pvscan(8), vgcfgbackup(8),
       vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8),
       vgdisplay(8), vgexport(8), vgextend(8), vgimport(8),
       vgmerge(8), vgmknodes(8), vgreduce(8), vgremove(8),
       vgrename(8), vgscan(8), vgsplit(8)


       Heinz Mauelshagen <Linux-LVM@Sistina.com>

Heinz Mauelshagen           LVM TOOLS                      LVM(8)



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
You can get all the latest Site and Linux news by checking out our news page.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.15 Seconds