<?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>Honza's perspective &#187; lvm</title>
	<atom:link href="http://blog.stastnarodina.com/honza-en/tag/lvm/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.stastnarodina.com/honza-en</link>
	<description></description>
	<lastBuildDate>Mon, 03 May 2010 09:30:45 +0000</lastBuildDate>
	<language>cs</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>HOWTO: add disk to VMware Ubuntu guest without reboot using LVM</title>
		<link>http://blog.stastnarodina.com/honza-en/spot/howto-add-disk-to-vmware-ubuntu-guest-without-reboot-using-lvm/</link>
		<comments>http://blog.stastnarodina.com/honza-en/spot/howto-add-disk-to-vmware-ubuntu-guest-without-reboot-using-lvm/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 13:39:03 +0000</pubDate>
		<dc:creator>honza</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://blog.stastnarodina.com/honza-en/?p=46</guid>
		<description><![CDATA[
<p>This howto is mostly built on the great tutorial available at <a
href="http://www.comnetslash.com/">http://www.comnetslash.com/</a>…hout-reboot/.
My spot tries to be more Ubuntu and LVM specific. This manual was tested on
Ubuntu 9.04 (jaunty) Server edition guest OS. Add Virtual Hard Disk A new hard
disk can be added easily to a running virtual machine in VMWare Infrastructure
Web Access by […]</p>
]]></description>
			<content:encoded><![CDATA[
<p>This howto is mostly built on the great tutorial available at <a
href="http://www.comnetslash.com/2009/06/11/howto-vmware-add-disk-space-to-live-linux-guest-without-reboot/">http://www.comnetslash.com/…hout-reboot/</a>.
My spot tries to be more Ubuntu and LVM specific. This manual was tested on
Ubuntu 9.04 (jaunty) Server edition guest OS.</p>

<h3>Add Virtual Hard Disk</h3>

<p><img
src="http://blog.stastnarodina.com/honza-en/wp-content/uploads/2009/07/add-disk11-150x150.png"
alt="add-disk1" title="add-disk1" width="150" height="150"
class="alignleft size-thumbnail wp-image-48" /> A new hard disk can be added
easily to a running virtual machine in VMWare Infrastructure Web Access by
clicking Add Hardware and following the wizard.</p>

<p>Note: I assume that all of the commands given are run under superuser (root)
rights. To become root type</p>

<pre><code>sudo su root</code></pre>

<h3>Detect new SCSI Disk</h3>

<p>The package <a
href="http://packages.ubuntu.com/jaunty/scsitools">scsitools</a> provides the
script rescan-scsi-bus.sh, which does exacly what we need. Install it and
run it:</p>

<pre><code>apt-get install scsitools
rescan-scsi-bus.sh</code></pre>

<p>This should detect the newly added hard disk and make it available in
<code>/dev/</code> – <code>/dev/sdb</code> in the case you are adding a new
drive for the first time. The output of <code>fdisk -l</code> should include the
newly detected disk.</p>

<h3>Format the new disk</h3>

<p>Format the newly detected drive using fdisk</p>

<pre><code>fdisk /dev/sdb
    n (for new partition)
    p (for primary partition)
    1 (partition number)
    (keep the other values default)
    w (write changes)</code></pre>

<p>Change the type of the partition to LVM Linux:</p>

<pre><code>fdisk /dev/sdb
    t (change the partition type)
    8e (for Linux LVM)
    w (write changes)</code></pre>

<h3>LVM</h3>

<h4>Initialize LVM Physical Volume</h4>

<pre><code>pvcreate /dev/sdb1</code></pre>

<h4>Add Physical Volume to Volume Group</h4>

<p>List the Volume groups available at your machine.</p>

<pre><code>vgdisplay</code></pre>

<p>Replace <em>VolGroupName</em> with what you read from the output of the last
command.</p>

<pre><code>vgextend VolGroupName /dev/sdb1</code></pre>

<p>You should see the newly aquired free space in the output of</p>

<pre><code>vgdisplay</code></pre>

<h4>Resize Logical Volumes</h4>

<p>After adding some free space to your Volume Group, you can distribute it to
the Logical Volumes. The list of Logical Volumes can be obtained by running</p>

<pre><code>lvdisplay</code></pre>

<p>Run the following commands for each Logical Volume you want to resize (add
space to). Again – replace <em>/dev/VolGroupNa­me/Name</em> with the Logical
Volume name you can read from the output of the last command. The <em>+10G</em>
means <em>Add 10 GB</em></p>

<pre><code>lvextend -L +10G /dev/VolGroupName/Name</code></pre>

<p>The last step is to resize the ext3 filesystem (use different tool is you use
different filesystem):</p>

<pre><code>resize2fs /dev/VolGroupName/Name</code></pre>

<!-- by Texy2! -->]]></content:encoded>
			<wfw:commentRss>http://blog.stastnarodina.com/honza-en/spot/howto-add-disk-to-vmware-ubuntu-guest-without-reboot-using-lvm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
