<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux Windows System Administrator Help &#187; Logical Volume Manager</title>
	<atom:link href="http://linuxwindowsmaster.com/tag/logical-volume-manager/feed/" rel="self" type="application/rss+xml" />
	<link>http://linuxwindowsmaster.com</link>
	<description></description>
	<lastBuildDate>Wed, 15 Feb 2012 17:58:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Logical Volume Manager HOWTO: What is LVM?</title>
		<link>http://linuxwindowsmaster.com/logical-volume-manager-howto-what-is-lvm/</link>
		<comments>http://linuxwindowsmaster.com/logical-volume-manager-howto-what-is-lvm/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 18:18:34 +0000</pubDate>
		<dc:creator>Alex P</dc:creator>
				<category><![CDATA[Dedicated Server]]></category>
		<category><![CDATA[fdisk]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[Logical Volume Manager]]></category>
		<category><![CDATA[lvcreate]]></category>
		<category><![CDATA[lvdisplay]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[mke2fs]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[pvcreate]]></category>
		<category><![CDATA[pvdisplay]]></category>
		<category><![CDATA[pvscan]]></category>
		<category><![CDATA[vgcreate]]></category>
		<category><![CDATA[vgdisplay]]></category>

		<guid isPermaLink="false">http://linuxwindowsmaster.com/logical-volume-manager-howto-what-is-lvm/</guid>
		<description><![CDATA[LVM stands for Logical Volume Manager is most useful method for deploying logical partition rather than physical partition, LVM is a method of allocating hard drive space into logical volumes that can be easily resized instead of partitions. A physical disk is divided into one or more physical volumes, The Volume Groups are created by [...]]]></description>
			<content:encoded><![CDATA[<p><strong>LVM</strong> stands for <strong>Logical Volume Manager</strong> is most useful method for deploying logical partition rather than physical partition, LVM is a method of allocating hard drive space into logical volumes that can be easily resized instead of partitions.</p>
<p>A physical disk is divided into one or more physical volumes, The Volume Groups are created by combining physical volumes. These volume groups are in turn subdivided into virtual disks called Logical Volumes. The logical volumes may be used just like regular disks with file system created on them and mounted in the Unix/Linux file system tree. The logical volumes can span multiple disks.</p>
<p><strong> Benefits of Logical Volume Management</strong></p>
<p>1.	Logical volumes can be easily resized without any downtime or rebooting server.<br />
2.	LVM created in conjunction with RAID can provide fault tolerance coupled with scalability and easy disk management.</p>
<p><strong>Drawback of Logical Volume Management</strong></p>
<p>1. LVM cannot be used for the /boot because the boot loader can not read it. If you want to have the root / partition on a logical volume, you will need to create a separate /boot partition with normal ext3 file system type which is not a part of a volume group.<br />
2.	The physical volumes can’t be resized.</p>
<p><strong>LVM Configuration</strong></p>
<p>There are two way to configure LVM.</p>
<p><strong>1)	While installing fresh OS</strong> -<br />
LVM can be configured during the graphical installation of Red Hat Linux You can use the utilities from the lvm package to create your LVM configuration. An overview of the steps required to configure LVM:</p>
<p>•	Create physical volumes from the hard drives.<br />
•	Create volume groups from the physical volumes.<br />
•	Create logical volumes from the volume groups and assign the logical volumes mount points.</p>
<p><strong>2)	After OS reinstallation </strong></p>
<p>One of our client want big size of /home partition with LVM support so I am considering /dev/sda7 on first HDD and /dea/sdb1 partition on secondary HDD, I want to combine both HDD space one partition as /home .</p>
<p>To create a LVM, follow following step process.</p>
<p><strong><span style="color: darkred;">A.</span></strong> The first step in setting up LVM need to create these physical partitions properly with &#8216;Linux LVM&#8217; &#8211; 0x8e so that they can be recognized by the LVM system. If we&#8217;re adding a physical partition. If it is normal ext3 partition please run fdisk command to change file system type and set it as as &#8216;Linux LVM&#8217; &#8211; 0x8e’, you can follow the following steps</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;"><span style="font-size: x-small;"><strong>fdisk /dev/sdb</strong></p>
<p>* Enter  p to display the current parttion created on this HDD<br />
* Enter t to change the default Linux partition type ext3 type (0×83) to LVM partition type (0×8e),<br />
* Enter w to write the partition table .</p>
<p></span></td>
</tr>
</tbody>
</table>
</div>
<p><strong><span style="color: darkred;">B.</span></strong>The first command pvcreate will &#8220;initialize a disk or partition for use by LVM&#8221;.</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;"># <strong><span style="font-size: x-small;">pvcreate /dev/sda7 /dev/sdb1<br />
# pvscan</span></strong></td>
</tr>
</tbody>
</table>
</div>
<p>The above step creates a physical volume from 2 partitions which I want to initialize for inclusion in a volume group.</p>
<p>You can use following command to check  various attributes of physical volume(s)</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;"><span style="font-size: x-small;"><strong>#pvdisplay</strong> </span></td>
</tr>
</tbody>
</table>
</div>
<p>It will show result like this</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;"><strong><span style="font-size: x-small;"># pvdisplay<br />
&#8212; Physical volume &#8212;<br />
PV Name               /dev/sda7<br />
VG Name               vg<br />
PV Size               423.76 GB / not usable 3.54 MB<br />
Allocatable           yes (but full)<br />
PE Size (KByte)       4096<br />
Total PE              108481<br />
Free PE               0<br />
Allocated PE          108481<br />
PV UUID               cB2G1L-i8w2-Qynm-6p3H-IrEr-1HEZ-dtAtqb</p>
<p>&#8212; Physical volume &#8212;<br />
PV Name               /dev/sdb1<br />
VG Name               vg<br />
PV Size               465.76 GB / not usable 1.50 MB<br />
Allocatable           yes (but full)<br />
PE Size (KByte)       4096<br />
Total PE              119234<br />
Free PE               0<br />
Allocated PE          119234<br />
PV UUID               40WuGe-iHs9-3bNR-22wq-da71-ZmPt-0MeFwu</p>
<p></span></strong></td>
</tr>
</tbody>
</table>
</div>
<p><strong><span style="color: darkred;">C.</span></strong>The second command vgcreate create the Volume Group vg with a physical extent size (PE size) of 16M , The default extent size (4 MB) limits the volume to about 256 GB; a size of 1 TB would require extents of atleast 16 MB</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;"><span style="font-size: x-small;"><strong># vgcreate -s 16M vg1 /dev/sda7 /dev/sdb1</strong></span></td>
</tr>
</tbody>
</table>
</div>
<p>You can use vgdisply  command to display volume group information , It will show output like this</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;"><strong><span style="font-size: x-small;"># vgdisplay<br />
&#8212; Volume group &#8212;<br />
VG Name               vg<br />
System ID<br />
Format                lvm2<br />
Metadata Areas        2<br />
Metadata Sequence No  4<br />
VG Access             read/write<br />
VG Status             resizable<br />
MAX LV                0<br />
Cur LV                1<br />
Open LV               1<br />
Max PV                0<br />
Cur PV                2<br />
Act PV                2<br />
VG Size               889.51 GB<br />
PE Size               4.00 MB<br />
Total PE              227715<br />
Alloc PE / Size       227715 / 889.51 GB<br />
Free  PE / Size       0 / 0<br />
VG UUID               6vE0NI-mMP0-mKYr-VB5B-xtjs-gUl0-0YVJ3S</span></strong></td>
</tr>
</tbody>
</table>
</div>
<p><span style="color: darkred;"><strong>D.</strong></span>Now next step needs to create of one or more &#8220;logical volumes&#8221; using the volume group which you have created previous step. The following commands create a 50GB logical volume (LV) called lvol0 on volume group vg:</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;"><strong><span style="font-size: x-small;"># lvcreate -L 50GB -n lvol0 vg<br />
Where –L = LogicalVolumeSize<br />
-n = LogicalVolumeName</span></strong></td>
</tr>
</tbody>
</table>
</div>
<p>The above  will create a softlink /dev/vg/lvol0 point to a correspondence block device file called /dev/mapper/vg-lvol0.</p>
<p>You can use <strong>lvdisplay</strong> command to check the information about a logical volume , It will show output look this</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;"><strong><span style="font-size: x-small;"># lvdisplay<br />
&#8212; Logical volume &#8212;<br />
LV Name                /dev/vg/lvol0<br />
VG Name                vg<br />
LV UUID                63Oepd-akBS-2ISP-6trP-GYpx-f8HS-rfK4iR<br />
LV Write Access        read/write<br />
LV Status              available<br />
# open                 1<br />
LV Size                889.51 GB<br />
Current LE             227715<br />
Segments               2<br />
Allocation             inherit<br />
Read ahead sectors     auto<br />
- currently set to     256<br />
Block device           253:0<br />
</span></strong></td>
</tr>
</tbody>
</table>
</div>
<p><strong><span style="color: darkred;">E.</span></strong>The Linux LVM configuration almost done , Now next step to format this logical volume lvol0 with a Linux supported file system, i.e. EXT2 , EXT3 file system etc.., You can use following command to format logical volumes with ext3 journalized ( -j =journaling support) file system .</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;"># <strong><span style="font-size: x-small;">mke2fs –j /dev/vg/lvol0 ( name of logical volume )</span></strong></td>
</tr>
</tbody>
</table>
</div>
<p><strong><span style="color: darkred;">F.</span></strong>Once it formatted use following command to mount the created file system</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;"><strong><span style="font-size: x-small;">#mount  /dev/vg/lvol0 /home</span></strong></td>
</tr>
</tbody>
</table>
</div>
<p>To confirm the LVM setup has been completed successfully, the <strong>df -h</strong> command should display the output same as below</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;"><strong><span style="font-size: x-small;"># df -h<br />
Filesystem            Size  Used Avail Use% Mounted on<br />
/dev/sda1             4.9G  350M  4.3G   8% /<br />
/dev/sda6             2.0G   41M  1.8G   3% /tmp<br />
/dev/sda3              15G  678M   14G   5% /var<br />
/dev/sda2              15G  2.2G   12G  16% /usr<br />
tmpfs                1013M     0 1013M   0% /dev/shm<br />
/dev/mapper/vg-lvol0  876G  199G  669G  23% /home</span></strong></td>
</tr>
</tbody>
</table>
</div>
<p>Also do not forget to add the corresponding line in the /etc/fstab file:<br />
#File: <strong>/etc/fstab</strong></p>
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;"><strong><span style="font-size: x-small;">/dev/mapper/vg-lvol0  /home ext3 defaults 0 0</span></strong></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://linuxwindowsmaster.com/logical-volume-manager-howto-what-is-lvm/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

