<?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>therning.org/ magnus &#187; lvm</title>
	<atom:link href="http://therning.org/magnus/archives/tag/lvm/feed" rel="self" type="application/rss+xml" />
	<link>http://therning.org/magnus</link>
	<description>Incoherent mumblings</description>
	<lastBuildDate>Thu, 12 Jan 2012 13:40:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>LVM rocks!</title>
		<link>http://therning.org/magnus/archives/307</link>
		<comments>http://therning.org/magnus/archives/307#comments</comments>
		<pubDate>Wed, 11 Jul 2007 15:02:13 +0000</pubDate>
		<dc:creator>Magnus</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lvm]]></category>

		<guid isPermaLink="false">http://therning.org/magnus/archives/307</guid>
		<description><![CDATA[I knew my persistence with using LVM would pay off one day. Despite the little mishap I had last year For a shiny new install of 64-bit Debian I chose to let the installer partition up my entire harddisk and instructed it to use LVM. This morning I noticed that the root partition was down [...]]]></description>
			<content:encoded><![CDATA[<p>I knew my persistence with using LVM would pay off one day. Despite the little mishap I had <a href="http://therning.org/magnus/archives/122">last year</a> <img src='http://therning.org/magnus/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>

<p>For a shiny new install of 64-bit Debian I chose to let the installer partition up my entire harddisk and instructed it to use LVM. This morning I noticed that the root partition was down to only 25% free space and during an upgrade it ran out of space. Not really a good thing. So, shut down the machine and out with the extra harddisk I&#8217;ve been putting off sticking in the machine. Here&#8217;s what I did after booting:</p>

<ol>
<li><p>Create a single large partition and make it of type <code>Linux LVM</code> (<code>8e</code>) using <code>cfdisk</code>.</p></li>
<li><p>Prepare the new partition for use with LVM:</p>

<pre><code># pvcreate /dev/sdb1
</code></pre></li>
<li><p>Add the new &#8216;physical volume&#8217; into the &#8216;virtual group&#8217;:</p>

<pre><code># vgextend mainvg /dev/sdb1
</code></pre></li>
<li><p>Extend the &#8216;logical volume&#8217; where root lives:</p>

<pre><code># lvextend --extents +50%LV /dev/mainvg/root
</code></pre></li>
<li><p>Then it turns out that Ext3 has no problem with extending a mounted filesystem so the last step was easy, but a little nerve wrecking since it was my root partition:</p>

<pre><code># resize2fs /dev/mainvg/root
</code></pre></li>
</ol>

<p>All done!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ftherning.org%2Fmagnus%2Farchives%2F307&amp;title=LVM%20rocks%21" id="wpa2a_2">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://therning.org/magnus/archives/307/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Being st00pid with LVM</title>
		<link>http://therning.org/magnus/archives/122</link>
		<comments>http://therning.org/magnus/archives/122#comments</comments>
		<pubDate>Thu, 20 Apr 2006 08:12:28 +0000</pubDate>
		<dc:creator>Magnus</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[st00pid]]></category>

		<guid isPermaLink="false">http://therning.org/magnus/archives/122</guid>
		<description><![CDATA[Well, this is the first entry in my st00pid category. I make quite a few mistakes when using Linux, mistakes that take time and effort to fix. From now on I&#8217;ll swallow my pride and write down, in a public place like this, about what st00pid things I do. Most importantly I&#8217;ll also write down [...]]]></description>
			<content:encoded><![CDATA[<p>Well, this is the first entry in my st00pid category. I make quite a few mistakes when using Linux, mistakes that take time and effort to fix. From now on I&#8217;ll swallow my pride and write down, in a public place like this, about what st00pid things I do. Most importantly I&#8217;ll also write down what I did to get my Linux system back to the state it was before my brain temporarily popped out for a coffee.</p>

<p>I like keeping my Debian systems minimal. When running Sid there ends up being quite a few upgrades to download and when dependencies change your system ends up having &#8220;orphaned&#8221; packages, i.e. packages that were pulled in to satisfy a dependency but by now the dependent package has since moved on (or been deleted). This is of course a worrying thought, packages are installed that don&#8217;t actually need to be present on the system. My stomach&#8217;s turning. Some people use aptitude to handle this, personally I&#8217;ve never really like <code>aptitude</code> and I use <code>debfoster</code>.</p>

<p>Yesterday, after a sizable upgrade of my system at work I ran <code>debfoster</code> to prune orphaned packages. This was in fact the first time I ran it after setting up the system which resulted in quite a few questions regarding whether to keep specific packages or not. <strong>This is about the time when my brain popped out for a coffee.</strong> When asked if I wanted to keep <code>lvm2</code> or not there was no brain to consult and I answered <em>no</em>. Had the brain been around it would have reminded me that I opted to use logical volumes on that particular machine (for two reasons, 1) I had never done it before and it&#8217;s damn cool, and 2) it makes the system a bit more flexible and future proof).</p>

<p>After a reboot I was sitting there with a system that was fairly useless since the root partition couldn&#8217;t be mounted. A quick calculation of just how long it&#8217;d take me to re-install later, I popped in the only live CD I had available at work&#8211;Ubuntu 5.04, Hoary Hedgehog. Using that I found a page on the Knoppix Wiki on <a href="http://www.knoppix.net/wiki/LVM2">how to use LVM2 with Knoppix</a>. Now armed with something that looked like a workable plan I did the following in a terminal</p>

<pre><code>$ sudo su -
# modprobe dm-mod
# vgscan
# vgchange -a y
# cd /mnt; mkdir debsys
</code></pre>

<p>Then I went ahead and mounted the root partition on <code>/mnt/debsys</code>. I also mounted the other partitions I have on my installed system, <code>/var</code>, etc. Then to get into it and fix it I</p>

<pre><code># chroot /debsys
# apt-get install lvm2 lvm-common
</code></pre>

<p>Except <code>lvm2</code> refused to install, it complained about the kernel being too old. Not surprising since Hoary is getting really old by now. to get around that I downloaded the source for <code>lvm2</code>, modified <code>debian/preinst</code> so that the kernel version check was skipped, re-built the package, and installed it. Worked like a charm.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ftherning.org%2Fmagnus%2Farchives%2F122&amp;title=Being%20st00pid%20with%20LVM" id="wpa2a_4">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://therning.org/magnus/archives/122/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

