<?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>SoftDux Technical Blog &#187; lvresize</title>
	<atom:link href="http://blog.softdux.com/tag/lvresize/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.softdux.com</link>
	<description>Software, Linux &#38; Networking Blog &#38; HOWTOs, Web Development</description>
	<lastBuildDate>Wed, 01 Sep 2010 14:23:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to resize a LVM volume</title>
		<link>http://blog.softdux.com/everything-todo-with-linux/how-to-resize-a-lvm-volume</link>
		<comments>http://blog.softdux.com/everything-todo-with-linux/how-to-resize-a-lvm-volume#comments</comments>
		<pubDate>Sat, 19 Dec 2009 10:22:27 +0000</pubDate>
		<dc:creator>Rudi</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[How]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[lv]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[lvresize]]></category>
		<category><![CDATA[resize]]></category>
		<category><![CDATA[to]]></category>
		<category><![CDATA[vg]]></category>

		<guid isPermaLink="false">http://blog.softdux.com/?p=277</guid>
		<description><![CDATA[Here&#8217;s a quick run-down on how to resize an existing LVM volume on Linux. I&#8217;m currently using LVM2. Let&#8217;s see what LVM volumes I have configured right now: [root@Rudi-PC ~]# lvscan ACTIVE &#8216;/dev/vg_rudipc/swap&#8217; [5.80 GB] inherit ACTIVE &#8216;/dev/vg_rudipc/var&#8217; [2.00 GB] inherit ACTIVE &#8216;/dev/vg_rudipc/home&#8217; [20.00 GB] inherit ACTIVE &#8216;/dev/vg_rudipc/root&#8217; [8.00 GB] inherit ACTIVE &#8216;/dev/vg_rudipc/data&#8217; [10.00 GB] [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick run-down on how to resize an existing <a href="http://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)">LVM </a>volume on Linux. I&#8217;m currently using LVM2. </p>
<p>Let&#8217;s see what <a href="http://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)">LVM </a>volumes I have configured right now:</p>
<blockquote><p>[root@Rudi-PC ~]# lvscan<br />
  ACTIVE            &#8216;/dev/vg_rudipc/swap&#8217; [5.80 GB] inherit<br />
  ACTIVE            &#8216;/dev/vg_rudipc/var&#8217; [2.00 GB] inherit<br />
  ACTIVE            &#8216;/dev/vg_rudipc/home&#8217; [20.00 GB] inherit<br />
  ACTIVE            &#8216;/dev/vg_rudipc/root&#8217; [8.00 GB] inherit<br />
  ACTIVE            &#8216;/dev/vg_rudipc/data&#8217; [10.00 GB] inherit
</p></blockquote>
<p>I used <a href="http://linux.die.net/man/8/lvscan" target="_new">lvscan </a>for this, but you can also use <a href="http://linux.die.net/man/8/lvs" target="_new" >lvs </a>or <a href="http://linux.die.net/man/8/lvdisplay" target="_new" >lvdisplay </a>to get more info on the volumes. </p>
<p>Now, I want to resize the data partition, so I run the following:</p>
<blockquote><p>
[root@Rudi-PC ~]# lvresize /dev/vg_rudipc/data -L +10GB<br />
  Extending logical volume data to 20.00 GB<br />
  Logical volume data successfully resized
</p></blockquote>
<p>With <a href="http://linux.die.net/man/8/lvresize">lvresize</a>, I basically told LVM to resize the <strong>data</strong> <a href="http://tldp.org/HOWTO/LVM-HOWTO/lv.html" target="_new">lv</a> with 10GB extra storage (with the <em>-L +10GB</em> switch) inside the <strong>vg_rudipc</strong>PV <a href="http://tldp.org/HOWTO/LVM-HOWTO/vg.html" target="_new">vg</a></p>
<p>As you can see below, the logical volume has been increased by 10GB. </p>
<blockquote><p>
[root@Rudi-PC ~]# lvscan<br />
  ACTIVE            &#8216;/dev/vg_rudipc/swap&#8217; [5.80 GB] inherit<br />
  ACTIVE            &#8216;/dev/vg_rudipc/var&#8217; [2.00 GB] inherit<br />
  ACTIVE            &#8216;/dev/vg_rudipc/home&#8217; [20.00 GB] inherit<br />
  ACTIVE            &#8216;/dev/vg_rudipc/root&#8217; [8.00 GB] inherit<br />
  ACTIVE            &#8216;/dev/vg_rudipc/data&#8217; [20.00 GB] inherit
</p></blockquote>
<p>This is the easy part. Now you still need to tell Linux that the LVM partition was resized. </p>
<blockquote><p>[root@Rudi-PC ~]# df -h<br />
Filesystem            Size  Used Avail Use% Mounted on<br />
/dev/mapper/vg_rudipc-root<br />
                      7.9G  3.8G  3.8G  51% /<br />
/dev/sda1             194M   15M  170M   8% /boot<br />
/dev/mapper/vg_rudipc-var<br />
                      2.0G  230M  1.7G  12% /var<br />
/dev/mapper/vg_rudipc-home<br />
                       20G  297M   19G   2% /home<br />
tmpfs                 2.0G  1.3M  2.0G   1% /dev/shm<br />
/dev/mapper/vg_rudipc-data<br />
                      9.9G  151M  9.2G   2% /data
</p></blockquote>
<p>As you can see, /data is still only 10GB, not 20GB as it is on the LVM partition</p>
<p>Now I resize the &#8220;/data&#8221; partition, using <a href="http://linux.die.net/man/8/resize2fs" target=_new">resize2fs</a> </p>
<blockquote><p>[root@Rudi-PC ~]# resize2fs /dev/vg_rudipc/data<br />
resize2fs 1.41.4 (27-Jan-2009)<br />
Filesystem at /dev/vg_rudipc/data is mounted on /data; on-line resizing required<br />
old desc_blocks = 1, new_desc_blocks = 2<br />
Performing an on-line resize of /dev/vg_rudipc/data to 5242880 (4k) blocks.<br />
The filesystem on /dev/vg_rudipc/data is now 5242880 blocks long.
</p></blockquote>
<p>Now, when I check the space, I can see that it&#8217;s been resized:</p>
<blockquote><p>[root@Rudi-PC ~]# df -h /data<br />
Filesystem            Size  Used Avail Use% Mounted on<br />
/dev/mapper/vg_rudipc-data<br />
                       20G  156M   19G   1% /data
</p></blockquote>
<p>Note: I used &#8220;df -h /data&#8221; to view the size of only the data partition, just to make it easier to process <img src='http://blog.softdux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Further reading: </p>
<ul>
<li>http://tldp.org/HOWTO/LVM-HOWTO/</li>
<li>http://linux.die.net/man/8/lvm</li>
<li>http://www.linux.org/docs/ldp/howto/LVM-HOWTO/lvm2faq.html</li>
</ul>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.softdux.com%2Feverything-todo-with-linux%2Fhow-to-resize-a-lvm-volume&amp;title=How%20to%20resize%20a%20LVM%20volume&amp;bodytext=Here%27s%20a%20quick%20run-down%20on%20how%20to%20resize%20an%20existing%20LVM%20volume%20on%20Linux.%20I%27m%20currently%20using%20LVM2.%20%0D%0A%0D%0ALet%27s%20see%20what%20LVM%20volumes%20I%20have%20configured%20right%20now%3A%0D%0A%0D%0A%0D%0A%0D%0A%5Broot%40Rudi-PC%20%7E%5D%23%20lvscan%0D%0A%20%20ACTIVE%20%20%20%20%20%20%20%20%20%20%20%20%27%2Fdev%2Fvg_rudipc%2Fswap%27%20%5B5.80%20GB%5D%20inher" title="Digg"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fblog.softdux.com%2Feverything-todo-with-linux%2Fhow-to-resize-a-lvm-volume" title="Sphinn"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fblog.softdux.com%2Feverything-todo-with-linux%2Fhow-to-resize-a-lvm-volume&amp;title=How%20to%20resize%20a%20LVM%20volume&amp;notes=Here%27s%20a%20quick%20run-down%20on%20how%20to%20resize%20an%20existing%20LVM%20volume%20on%20Linux.%20I%27m%20currently%20using%20LVM2.%20%0D%0A%0D%0ALet%27s%20see%20what%20LVM%20volumes%20I%20have%20configured%20right%20now%3A%0D%0A%0D%0A%0D%0A%0D%0A%5Broot%40Rudi-PC%20%7E%5D%23%20lvscan%0D%0A%20%20ACTIVE%20%20%20%20%20%20%20%20%20%20%20%20%27%2Fdev%2Fvg_rudipc%2Fswap%27%20%5B5.80%20GB%5D%20inher" title="del.icio.us"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.softdux.com%2Feverything-todo-with-linux%2Fhow-to-resize-a-lvm-volume&amp;t=How%20to%20resize%20a%20LVM%20volume" title="Facebook"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fblog.softdux.com%2Feverything-todo-with-linux%2Fhow-to-resize-a-lvm-volume&amp;title=How%20to%20resize%20a%20LVM%20volume" title="Mixx"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fblog.softdux.com%2Feverything-todo-with-linux%2Fhow-to-resize-a-lvm-volume&amp;title=How%20to%20resize%20a%20LVM%20volume&amp;annotation=Here%27s%20a%20quick%20run-down%20on%20how%20to%20resize%20an%20existing%20LVM%20volume%20on%20Linux.%20I%27m%20currently%20using%20LVM2.%20%0D%0A%0D%0ALet%27s%20see%20what%20LVM%20volumes%20I%20have%20configured%20right%20now%3A%0D%0A%0D%0A%0D%0A%0D%0A%5Broot%40Rudi-PC%20%7E%5D%23%20lvscan%0D%0A%20%20ACTIVE%20%20%20%20%20%20%20%20%20%20%20%20%27%2Fdev%2Fvg_rudipc%2Fswap%27%20%5B5.80%20GB%5D%20inher" title="Google Bookmarks"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="" title="De.lirio.us"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/" title="De.lirio.us" alt="De.lirio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=How%20to%20resize%20a%20LVM%20volume&amp;body=http%3A%2F%2Fblog.softdux.com%2Feverything-todo-with-linux%2Fhow-to-resize-a-lvm-volume" title="email"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="" title="Furl"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fblog.softdux.com%2Feverything-todo-with-linux%2Fhow-to-resize-a-lvm-volume&amp;headline=How%20to%20resize%20a%20LVM%20volume&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.softdux.com%2Feverything-todo-with-linux%2Fhow-to-resize-a-lvm-volume&amp;title=How%20to%20resize%20a%20LVM%20volume&amp;source=SoftDux+Technical+Blog+Software%2C+Linux+%26amp%3B+Networking+Blog+%26amp%3B+HOWTOs%2C+Web+Development&amp;summary=Here%27s%20a%20quick%20run-down%20on%20how%20to%20resize%20an%20existing%20LVM%20volume%20on%20Linux.%20I%27m%20currently%20using%20LVM2.%20%0D%0A%0D%0ALet%27s%20see%20what%20LVM%20volumes%20I%20have%20configured%20right%20now%3A%0D%0A%0D%0A%0D%0A%0D%0A%5Broot%40Rudi-PC%20%7E%5D%23%20lvscan%0D%0A%20%20ACTIVE%20%20%20%20%20%20%20%20%20%20%20%20%27%2Fdev%2Fvg_rudipc%2Fswap%27%20%5B5.80%20GB%5D%20inher" title="LinkedIn"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fblog.softdux.com%2Feverything-todo-with-linux%2Fhow-to-resize-a-lvm-volume&amp;t=How%20to%20resize%20a%20LVM%20volume" title="MySpace"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=How%20to%20resize%20a%20LVM%20volume&amp;url=http%3A%2F%2Fblog.softdux.com%2Feverything-todo-with-linux%2Fhow-to-resize-a-lvm-volume" title="Slashdot"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.softdux.com%2Feverything-todo-with-linux%2Fhow-to-resize-a-lvm-volume&amp;title=How%20to%20resize%20a%20LVM%20volume" title="StumbleUpon"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fblog.softdux.com%2Feverything-todo-with-linux%2Fhow-to-resize-a-lvm-volume" title="Technorati"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="" title="YahooMyWeb"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/" title="YahooMyWeb" alt="YahooMyWeb" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fblog.softdux.com%2Feverything-todo-with-linux%2Fhow-to-resize-a-lvm-volume&amp;partner=sociable" title="Print"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="" title="TwitThis"><img src="http://blog.softdux.com/wp-content/plugins/sociable/images/" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.softdux.com/everything-todo-with-linux/how-to-resize-a-lvm-volume/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
