<?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>Wheadon&#039;s Words; Mark&#039;s Mutterings &#187; slow backups</title>
	<atom:link href="http://www.markwheadon.com/blog/tag/slow-backups/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markwheadon.com/blog</link>
	<description>Welcome to Mark Wheadon&#039;s blog; I hope you find it useful. Feel free to comment on anything you read here.</description>
	<lastBuildDate>Thu, 10 Nov 2011 15:25:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Efficient backups: storing VMs in a sparse bundle</title>
		<link>http://www.markwheadon.com/blog/2009/06/backing-up-virtual-machine-using-sparse-bundle/</link>
		<comments>http://www.markwheadon.com/blog/2009/06/backing-up-virtual-machine-using-sparse-bundle/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 10:44:44 +0000</pubDate>
		<dc:creator>Mark Wheadon</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[XP]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[fusion]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[increamental]]></category>
		<category><![CDATA[large backups]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mac os for windows users]]></category>
		<category><![CDATA[macintosh]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[parallels desktop]]></category>
		<category><![CDATA[slow backups]]></category>
		<category><![CDATA[sparse bundle]]></category>
		<category><![CDATA[time machine]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://www.markwheadon.com/blog/?p=834</guid>
		<description><![CDATA[Using a virtual machine -- perhaps VMware Fusion or Parallels Desktop -- can result in way-too-large backups. Here's one way to make those backups more manageable.
No related posts.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using a product such as <a href="http://www.vmware.com/products/fusion/" target="_blank">VMware Fusion</a> or <a href="http://www.parallels.com/uk/" target="_blank">Parallels Desktop</a> to run another operating system on your Mac (perhaps <em>Windows</em> or <em>Linux</em>), then you may have noticed that your backups are now taking a long time. I documented one approach to solving this problem <a href="http://www.markwheadon.com/blog/2009/03/time-machine-and-vmware-fusion/" target="_blank">in an earlier article</a>. Now here&#8217;s a different approach, originally suggested by Chris Ryder (thanks Chris).</p>
<p>First, here&#8217;s a recap of the problem. It&#8217;s written in terms of <em>VMware Fusion</em> but should be equally valid for other VM engines such as <em>Parallels Desktop</em>. If you&#8217;ve already read the previous article then you might want to <a href="#meat">skip to the meat of this article</a>.</p>
<h2>Large backups</h2>
<p style="margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 1.6em; padding: 0px;">When you’ve been using <em>Fusion</em>’s virtual machine (in my case, to run <em>Windows</em>), you will find that <em>Time Machine</em>’s backup takes longer than expected — sometimes <em>much</em> longer.</p>
<p style="margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 1.6em; padding: 0px;">This is because <em>Fusion</em> stores its virtual machines’ disks as a bunch of large files. When you run your virtual machine using <em>Fusion</em> (or <em>Parallels Desktop</em>), the contents of the VM’s virtual disk changes, and even if you haven’t made many explicit changes to files, all sorts of small changes happen to the virtual disk’s contents.</p>
<h2 style="padding-top: 6px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 17px; margin: 0px;">Incremental can still be too much</h2>
<p style="margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 1.6em; padding: 0px;"><em>Time Machine</em> performs incremental backups. That is, it copies only files that have changed since the last backup. Unfortunately those large files that <em>Fusion</em> uses to store the virtual disk’s contents? They’ve probably all changed, at least a little.</p>
<p style="margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 1.6em; padding: 0px;"><a href="http://www.markwheadon.com/blog/wp-content/uploads/2009/03/backup.png"><img class="aligncenter size-large wp-image-537" title="backup" src="http://www.markwheadon.com/blog/wp-content/uploads/2009/03/backup-540x242.png" alt="backup" width="540" height="242" /></a>So, instead of your incremental being a few megabytes and taking a few tens of seconds, it’s ten gigabytes, takes ages, and rapidly fills your backup disk. (Which causes its own problems: <a href="http://www.markwheadon.com/blog/2009/03/changing-time-machine-backup-schedule/" target="_blank">described here</a>.)</p>
<h3>One solution: back up the VM in another way</h3>
<p>One solution is to keep all your precious files in the Mac file-store, tell <em>Time Machine</em> to avoid backing up your virtual machine(s), and then back them up some other way. This results in the smallest backups and is useful if you don&#8217;t need sophisticated incremental backups of your virtual machines.</p>
<p>If this sounds like you, then I&#8217;ve shown how this can be achieved <a href="http://www.markwheadon.com/blog/2009/03/time-machine-and-vmware-fusion/" target="_blank">in an earlier article</a>.</p>
<h3 id="meat">An alternative solution: use a sparse bundle</h3>
<p>If you need proper incremental backups of your VMs, then one approach is to use a <a href="http://en.wikipedia.org/wiki/Sparse_image" target="_blank">sparse bundle</a>. This is a disk image which is stored  as a collection of small files (typically 8MB), so when <em>Time Machine</em> backs up the disk image, it only needs to copy the files that have changed.</p>
<p>This approach still isn&#8217;t perfect &#8212; when (for example) <em>Windows</em> does anything, it tends to scatter its writes over the disk, so incremental backups are still large, but they&#8217;re not <em>as</em> large as when <em>Time Machine</em> backs up the VM directly. Typically, your incrementals may be a few hundred megabytes with no VMs, a few gigabytes with a VM stored on a sparse bundle (for <em>Windows. Linux</em> may be better behaved), and a few tens of gigabytes with the same VM stored in the standard way.</p>
<h2>Here&#8217;s how</h2>
<p>First lets create a new disk image based on a sparse bundle and move our VM onto it. We&#8217;ll need to know how large to make the VM, so go to <em>Documents</em> and look in <em>Virtual Machines</em>. In there is one folder per virtual machine and you can find the VM&#8217;s size by clicking on the corresponding folder and hitting <em>cmd+I</em>:</p>
<p><a style="text-decoration: none;" href="http://www.markwheadon.com/blog/wp-content/uploads/2009/06/VM-size.png"><img class="aligncenter size-large wp-image-844" title="VM size" src="http://www.markwheadon.com/blog/wp-content/uploads/2009/06/VM-size-540x488.png" alt="VM size" width="540" height="488" /></a></p>
<h3>Create the disk image</h3>
<p>Now create the sparse bundle. The point-and-click way of doing this is to use <em>Disk Utility</em>, so start that up (I use <em>spotlight</em> to do so):</p>
<p><a style="text-decoration: none;" href="http://www.markwheadon.com/blog/wp-content/uploads/2009/06/Spotlight.png"><img class="aligncenter size-large wp-image-843" title="Spotlight" src="http://www.markwheadon.com/blog/wp-content/uploads/2009/06/Spotlight-540x226.png" alt="Spotlight" width="540" height="226" /></a></p>
<p>and click on <em>New Image</em>:</p>
<p><a href="http://www.markwheadon.com/blog/wp-content/uploads/2009/06/Picture-disk-utility.png"><img class="aligncenter size-large wp-image-839" title="Picture disk utility" src="http://www.markwheadon.com/blog/wp-content/uploads/2009/06/Picture-disk-utility-540x455.png" alt="Picture disk utility" width="540" height="455" /></a></p>
<p>Then fill in the details. I made my sparse bundle file-system for the <em>Windows XP</em> VM twice as large as the space it currently occupies, to allow for future expansion &#8212; so 50GB in my case (don&#8217;t worry: it only uses as much real disk as is needed to store the actual content). Here&#8217;s all the fields you need to change:</p>
<p><img class="aligncenter size-full wp-image-859" title="Bundle settings" src="http://www.markwheadon.com/blog/wp-content/uploads/2009/06/Bundle-settings.png" alt="Bundle settings" width="480" height="346" /></p>
<ul>
<li>The <em>Save As</em> is the filename for the sparse bundle whereas the <em>Volume Name</em> is the name the disk will have when mounted &#8212; I made them the same;</li>
<li>I saved my sparse bundle in <em>Documents-&gt;Virtual Machines;</em></li>
<li><em>Image Format</em> needs to be <em>sparse bundle disk image</em>, as that&#8217;s the whole point of the exercise.</li>
</ul>
<p>Now click on <em>Create</em>, and</p>
<p><img class="aligncenter size-full wp-image-848" title="Creating image" src="http://www.markwheadon.com/blog/wp-content/uploads/2009/06/Creating-image.png" alt="Creating image" width="463" height="228" /></p>
<p>a few seconds later you have a sparse bundle file-system image.</p>
<p><img class="size-full wp-image-846 alignleft" title="Mounted bundle" src="http://www.markwheadon.com/blog/wp-content/uploads/2009/06/Mounted-bundle.png" alt="Mounted bundle" width="68" height="82" />Now double-click that file (mine&#8217;s called <em>VM disk.sparsebundle</em>).</p>
<p><em>Mac OS</em> will mount it&#8230;</p>
<p>and the new file system will appear on the desktop.</p>
<p><strong>Move the VM into the new disk image</strong></p>
<p>Next, drag the folder(s) corresponding to the VM(s) you&#8217;d like backed up by <em>Time Machine</em> onto the new disk. Hold down <em>cmd</em> as you drag and drop, so that you move the folders (rather than copying them):</p>
<h3><a href="http://www.markwheadon.com/blog/wp-content/uploads/2009/06/Move-onto-disk.png"><img class="aligncenter size-large wp-image-851" title="Move onto disk" src="http://www.markwheadon.com/blog/wp-content/uploads/2009/06/Move-onto-disk-540x333.png" alt="Move onto disk" width="540" height="333" /></a>Ensure the new disk image is mounted at login</h3>
<p>The <em>.sparsebundle</em> file needs to be mounted every time you log in, so that the file-store is available. To do that, go into <em>System Preferences-&gt;Accounts</em>, click on your username and then on <em>Login items</em>. Now drag your sparsebundle file into the list of login items:</p>
<p><a href="http://www.markwheadon.com/blog/wp-content/uploads/2009/06/Picture-alt.png"><img class="aligncenter size-large wp-image-841" title="Mount at login" src="http://www.markwheadon.com/blog/wp-content/uploads/2009/06/Picture-alt-540x358.png" alt="Mount at login" width="540" height="358" /></a>and that&#8217;s it.</p>
<h3>Using your newly-homed VM(s)</h3>
<p>To use your new VM(s), just double-click on the corresponding folder &#8212; perhaps put an alias to it on your desktop or in the dock. When you next use it you&#8217;ll get a message:</p>
<p><img class="aligncenter size-full wp-image-845" title="I moved it" src="http://www.markwheadon.com/blog/wp-content/uploads/2009/06/I-moved-it.png" alt="I moved it" width="548" height="281" /></p>
<p>Just click on <em>I moved it</em> and you&#8217;re sorted.</p>
<h2>Warning</h2>
<p>As with any method of backup which relies on backing up the virtual machine&#8217;s disk image using the host operating system, your backup may not be of any use if it&#8217;s made whilst the VM is running, so I suggest you make sure that <strong>Fusion/Parallels is </strong><em><strong>not running</strong></em><strong> when </strong><em><strong>Time Machine</strong></em><strong> is backing up your data</strong>. If you don&#8217;t always manage to do so then some of your backups may not be valid.</p>
<h3>Why?</h3>
<p>Because if you backup the files that <em>Fusion</em> (or <em>Parallels</em>) is using for a disk image, then you&#8217;re backing up what&#8217;s <em>on disk</em>, but not what&#8217;s in memory, in disk buffers, etc. So when you come to restore from backup, you may find that the disk image is corrupted. In the worst case scenario you won&#8217;t be able to start up the VM&#8217;s operating system successfully at all, or restore any files contained within the VM&#8217;s file-store.</p>
<p>By backing up when the VM isn&#8217;t running, you ensure that all data is on disk in a safe, consistent state.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.markwheadon.com/blog/2009/06/backing-up-virtual-machine-using-sparse-bundle/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

