<?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>h3x.no &#187; kvm</title>
	<atom:link href="http://h3x.no/tag/kvm/feed" rel="self" type="application/rss+xml" />
	<link>http://h3x.no</link>
	<description>Tor Henning Ueland`s thoughts about technology and other stuff</description>
	<lastBuildDate>Sat, 28 Jan 2012 14:02:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Expanding a kVM disk image</title>
		<link>http://h3x.no/2011/08/14/expanding-a-kvm-disk-image</link>
		<comments>http://h3x.no/2011/08/14/expanding-a-kvm-disk-image#comments</comments>
		<pubDate>Sun, 14 Aug 2011 19:24:31 +0000</pubDate>
		<dc:creator>Tor Henning Ueland</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[qemu]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://h3x.no/?p=1055</guid>
		<description><![CDATA[Had to expand a KVM virtual machine today. Luckily, that`s pretty straight forward. You simply create a new disk image with the extra size needed, merge it into the original disk and voila. Then you just need to partition in &#8230; <a href="http://h3x.no/2011/08/14/expanding-a-kvm-disk-image">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Had to expand a KVM virtual machine today. Luckily, that`s pretty straight forward. You simply create a new disk image with the extra size needed, merge it into the original disk and voila. Then you just need to partition in the extra space and you are good to go.</p>
<p><strong>How-to:</strong></p>
<p><strong>1: Halt your virtual machine.</strong></p>
<p>You need to stop your virtual machine before going wild with the drive. Virsh stop &lt;vm name&gt;, or virsh destroy &lt;vm name&gt; if it somehow wont stop.</p>
<p><strong>2: Create a disk with the extra space needed:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">qemu-img create <span style="color: #660033;">-f</span> raw 5gig.img 5G</pre></div></div>

<p><strong>3: Merge it into the disk you are working with</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> 5gig.img <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> yourdisk.img</pre></div></div>

<p><strong>4: Boot up and and partition your drive.</strong></p>
<p>Then start up your virtual machine again with virsh start &lt;vm name&gt;. If you use Windows server, all you need to do is to visit disk managent, right click your drive with little free space and choose &#8220;extend partition&#8221;. The job takes seconds and does not require any reboot.</p>
]]></content:encoded>
			<wfw:commentRss>http://h3x.no/2011/08/14/expanding-a-kvm-disk-image/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mount KVM/Xen disk image / loop device</title>
		<link>http://h3x.no/2010/11/11/mount-kvmxen-disk-image-loop-device</link>
		<comments>http://h3x.no/2010/11/11/mount-kvmxen-disk-image-loop-device#comments</comments>
		<pubDate>Thu, 11 Nov 2010 07:45:06 +0000</pubDate>
		<dc:creator>Tor Henning Ueland</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[fsck]]></category>
		<category><![CDATA[kpartx]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://h3x.no/?p=704</guid>
		<description><![CDATA[Working with virtual disks is pretty straight forward. If you have a single partition virtual disk you can mount or fsck the image file directly. It is a bit more work if you have multiple partitions on the disk, but &#8230; <a href="http://h3x.no/2010/11/11/mount-kvmxen-disk-image-loop-device">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Working with virtual disks is pretty straight forward. If you have a single partition virtual disk you can mount or fsck the image file directly. It is a bit more work if you have multiple partitions on the disk, but not to worry <img src='http://h3x.no/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First, map op the partitions on the device:</p>
<blockquote><p>[root@hostname images]# <strong>kpartx -v -a imagename.img</strong><br />
add map <strong>loop0p1 </strong>: 0 8369802 linear /dev/loop0 63<br />
add map <strong>loop0p2 </strong>: 0 224910 linear /dev/loop0 8369865</p></blockquote>
<p>This creates mappings for the device that can be accessed easily with for example fsck:</p>
<div id="_mcePaste">[root@hostname /]# fsck.ext3 /dev/mapper/loop0p1</div>
<div id="_mcePaste">e2fsck 1.39 (29-May-2006)</div>
<div id="_mcePaste">/: clean, 87953/1046528 files, 588235/1046225 blocks</div>
<p>You can even easily mount the partitions:</p>
<blockquote><p>[root@hostname /]# <strong>mount -o ro /dev/mapper/loop0p1 /mnt</strong></p></blockquote>
<p>To clean up after your self (after unmounting any mounted partitions):</p>
<blockquote><p>[root@hostname /]# <strong>kpartx -d /dev/loop0</strong></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://h3x.no/2010/11/11/mount-kvmxen-disk-image-loop-device/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SysRq-reboot macro for Blackbox KVM software</title>
		<link>http://h3x.no/2009/03/15/sysrq-reboot-macro-for-blackbox-kvm-software</link>
		<comments>http://h3x.no/2009/03/15/sysrq-reboot-macro-for-blackbox-kvm-software#comments</comments>
		<pubDate>Sun, 15 Mar 2009 18:50:15 +0000</pubDate>
		<dc:creator>Tor Henning Ueland</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[sysrq]]></category>

		<guid isPermaLink="false">http://www.h3x.no/?p=16</guid>
		<description><![CDATA[A nice way of rebooting a frozen Linux-based server when you do not have a power switch available is to use the SysRq-abilities. (Ubuntu Example.) Blackbox does not have a default macro installed for just that, but you can create a new &#8230; <a href="http://h3x.no/2009/03/15/sysrq-reboot-macro-for-blackbox-kvm-software">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A nice way of rebooting a frozen Linux-based server when you do not have a power switch available is to use the SysRq-abilities. (<a href="http://ubuntuforums.org/showthread.php?t=617349">Ubuntu Example</a>.) Blackbox does not have a default macro installed for just that, but you can create a new macro and insert the following:</p>
<p>&#8220;&lt;Alt-PRESS&gt;&lt;Print Screen&gt;&lt;Alt-RELEASE&gt;RSEIUB&#8221;</p>
<p>This will create a working macro for writing any data in cache to disk, kill all processes (Sigkill), remount mounted disks and perform a reboot.</p>
]]></content:encoded>
			<wfw:commentRss>http://h3x.no/2009/03/15/sysrq-reboot-macro-for-blackbox-kvm-software/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

