<?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>Apolitically Incorrect &#187; Samba</title>
	<atom:link href="http://www.oak-tree.us/blog/index.php/tag/samba/feed" rel="self" type="application/rss+xml" />
	<link>http://www.oak-tree.us/blog</link>
	<description>The Rants and Raves of an Unsettled Mind</description>
	<lastBuildDate>Mon, 31 Oct 2011 21:56:43 +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>Backup, Sync and Share &#8211; Part 4: Apple Time Machine and Samba</title>
		<link>http://www.oak-tree.us/blog/index.php/2009/06/09/backup-part4</link>
		<comments>http://www.oak-tree.us/blog/index.php/2009/06/09/backup-part4#comments</comments>
		<pubDate>Wed, 10 Jun 2009 01:58:22 +0000</pubDate>
		<dc:creator>Rob Oakes</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Cool Stuff]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Samba]]></category>
		<category><![CDATA[Time Machine]]></category>

		<guid isPermaLink="false">http://www.oak-tree.us/blog/?p=953</guid>
		<description><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Backup%2C+Sync+and+Share+%26ndash%3B+Part+4%3A+Apple+Time+Machine+and+Samba&amp;rft.aulast=Oakes&amp;rft.aufirst=Rob&amp;rft.subject=Computer&amp;rft.subject=Cool+Stuff&amp;rft.source=Apolitically+Incorrect&amp;rft.date=2009-06-09&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.oak-tree.us/blog/index.php/2009/06/09/backup-part4&amp;rft.language=English"></span>
At it’s World Wide Developer’s conference in June of 2006, Apple released a product that changed the way that a great many people think about backup: Time Machine.&#160; While I cringe at the thought, I need to descend into the fawning adoration public relations speak that masquerades as critical coverage of Apple Products.&#160; (Actually, forget [...]<p>Copywrite 2009: Rob Oakes.  <a href="http://www.oak-tree.us/blog">Apolitically Incorrect</a><br/><br/><a href="http://www.oak-tree.us/blog/index.php/2009/06/09/backup-part4">Backup, Sync and Share &ndash; Part 4: Apple Time Machine and Samba</a></p>
]]></description>
			<content:encoded><![CDATA[	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=Backup%2C+Sync+and+Share+%26ndash%3B+Part+4%3A+Apple+Time+Machine+and+Samba&amp;rft.aulast=Oakes&amp;rft.aufirst=Rob&amp;rft.subject=Computer&amp;rft.subject=Cool+Stuff&amp;rft.source=Apolitically+Incorrect&amp;rft.date=2009-06-09&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=http://www.oak-tree.us/blog/index.php/2009/06/09/backup-part4&amp;rft.language=English"></span>
<p><!--noadsense-->
<p><img style="border-right-width: 0px; margin: 0px 15px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Mac OS X - Leopard - Disc" border="0" alt="Mac OS X - Leopard - Disc" align="left" src="http://www.oak-tree.us/blog/wp-content/uploads/2009/06/macosxleoparddisc.png" width="238" height="240" /> At it’s World Wide Developer’s conference in June of 2006, Apple released a product that changed the way that a great many people think about backup: Time Machine.&#160; While I cringe at the thought, I need to descend into the <span style="text-decoration: line-through">fawning adoration</span> public relations speak that masquerades as critical coverage of Apple Products.&#160; (Actually, forget that, here’s how Apple describes their backup system.)</p>
<blockquote><p>Time machine is a breakthrough automatic backup that’s built right into Mac OS X.&#160; It keeps an up-to-date copy of everything on your Mac – digital photos, music, movies, TV shows, and documents.&#160; Now, if you ever have the need, you can easily go back in time to recover anything … Time Machine takes care of it … Automatically, in the the background.&#160; You’ll never have to worry about backing up again.</p>
</blockquote>
<p>General sarcasm and bitterness aside, Time Machine really is a spectacular piece of kit.&#160; Sure, you can very successfully imitate a Time Machine experience using the tools within Windows Vista or Linux (or via third party tools such as <a href="http://www.amazon.com/gp/product/B0012YKRSI?ie=UTF8&amp;tag=apolitiincorr-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B0012YKRSI">Norton Ghost</a>).&#160; Even so, Time Machine is just just about the perfect combination of simple, powerful, and integrated.&#160; And like most Apple products, when used within the Apple eco-system is&#160; a lovely experience.</p>
<p>However, if you migrate too far out of the walled garden, Time Machine isn’t quite so nice to work with.&#160; Actually, it can be a bit demanding and temperamental.&#160; For example, it requires its own formatted hard drive or the ready availability of a specialized Apple router (called a <a href="http://www.apple.com/timecapsule/">TimeCapsule</a>).&#160; Alternatively, it can be a bit flaky; when I was backing up to a local hard drive, it would often quit with an indecipherable error.&#160;&#160; Luckily, however, these limitations are pretty easy to overcome.&#160; In this article, I will look briefly at how to setup Time Machine so that it works with a simple <a href="http://www.oak-tree.us/blog/index.php/2009/01/22/backup-part1">home server running Samba</a> and <a href="http://www.oak-tree.us/blog/index.php/science-and-technology/svn">Subversion</a>.</p>
<p> <span id="more-953"></span>
</p>
<h2>A Few Goals</h2>
<p>Before jumping into how to change settings, it might be good to talk about why I’ve chosen the configuration options I have: it’s all about simplicity and convenience.&#160; As Apple (redundantly) points out, the more simple a task is, the more likely it is to happen.&#160; In terms of backup, this means that it should be automated.&#160; So, while having a disk connected to a computer is sufficient, backup over the network to a network attached storage (NAS) is much better.&#160; &quot;Why,&quot; you ask?&#160; In the case of NAS, there is no worry about turning the dedicated backup disc on, letting Time Machine do its thing, and then shutting the disk off.</p>
<p>There is, however, one major drawback to backing up over the network.&#160; That first backup-up takes a <span style="text-decoration: underline">REALLY</span> long time.&#160; In my case, it took my MacBook Pro the better part of <em>three straight days</em> to finish.&#160; And should you ever need to restore your complete hard drive (due to failure or the purchase of a new computer), you can expect it to take the same amount of time.&#160; Once that first backup completes, however, this limitation no longer exists.&#160; Subsequent runs only include files that have been modified and go quite quickly.</p>
<p>But what about convenience?&#160; The <a href="http://www.oak-tree.us/blog/index.php/2009/03/01/backup-archive">point of a backup</a> is knowing that your work/information is safe.&#160; For single files, restoring over the network is easy.&#160; But what happens should disaster strike and you lose a hard drive?&#160; No one wants to wait three full days before resuming work.&#160; Luckily, you can get the benefits of over the network back-up and the convenience of quick recovery by <a href="http://www.oak-tree.us/blog/index.php/2009/01/25/backup-part2">configuring your home back-up server to use USB hard-drives</a>.</p>
<p align="center"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Apple Time Machine" border="0" alt="Apple Time Machine" src="http://www.oak-tree.us/blog/wp-content/uploads/2009/06/appletimemachine.jpg" width="600" height="375" /></p>
<p>Should your hard-drive fail, you can detach the USB drive and then use TimeMachine to restore your data locally.&#160; I discovered this lovely side benefit recently when the hard-drive in my MacBook Pro decided to die and I refused to wait three days for it to restore over the network.&#160; I disconnected the network drive from the server and plugged it into the Mac.&#160; I then booted from the recovery CD and it magically found my Time Machine backup.&#160; Instead of three days, I was ready to go in slightly less than three hours.&#160; So, now that we have the goals (simplicity and convenience), let’s talk about how to reach them.</p>
<h2>Network Backup to Samba</h2>
<p>Out of the box, a default Leopard installation won’t work with a Samba share.&#160; You will need to follow a relatively simple three step procedure to have Samba supported Time Machine goodness:&#160; 1) Create a sparse bundle image on the local file system, 2) copy the sparsebundle to the root of the network share, 3) enable support for “unsupported” network volumes.</p>
<h3>1) Create a Spase Bundle Image on the Local File System</h3>
<p>Time machine saves backups in an extremely specific format, called a <a href="http://en.wikipedia.org/wiki/Sparse_image">sparse bundle or image</a>.&#160; A sparse bundle is a special file that can also behave like a physical hard drive.&#160; When you click on it, it will launch a new volume in the finder that then contains other files and folders.&#160; A unique characteristic of the sparse bundles included in Leopard is that they will automatically resize based on their contents.</p>
<p>When using Time Machine on Apple hardware, the process of creating a sparse bundle is automated.&#160; Unfortunately, this isn’t true on a generic Samba share.&#160; In order to make Time Machine work, we need to manually create a sparse bundle and copy it to the Samba share where we will be backing the computer up.</p>
<p>As we create our image, the file name of the image is extremely important.&#160; It has a general form of:</p>
<blockquote><p>Computername_MACaddress.sparsebundle</p>
</blockquote>
<p>Where Computername is the name of your computer and MACaddress is the MAC address for your ethernet card.&#160; Luckily, both of these pieces of information are relatively easy to find.&#160; The computer’s name is found by opening “System Preferences” and clicking on the “Sharing” link under “Internet and Network.”</p>
<p align="center"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Find you computer&#39;s name by clicking on the &quot;Sharing&quot; pane of the System Preferences." border="0" alt="Find you computer&#39;s name by clicking on the &quot;Sharing&quot; pane of the System Preferences." src="http://www.oak-tree.us/blog/wp-content/uploads/2009/06/timemachineinternetandnetwork.png" width="322" height="90" /></p>
<p align="center"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Your computer&#39;s name can&#39;t have any spaces or other forbidden characters." border="0" alt="Your computer&#39;s name can&#39;t have any spaces or other forbidden characters." src="http://www.oak-tree.us/blog/wp-content/uploads/2009/06/timemachinecomputername.png" width="638" height="89" /></p>
<p align="left">For the Time Machine backup to work correctly, it is <em>important that your computer’s name not have any spaces in it</em>.&#160; Should you need to, this might be a good time to change it by clicking on the “Edit” button.</p>
<p align="left">You can locate the MAC address by typing the following command into the Terminal:</p>
<blockquote><p>ifconfig en0 | grep ether | sed s/://g | sed s/ether//</p>
</blockquote>
<p>It will return a list of letters and numbers, for example: 001ec4b8f9b3.</p>
<p>Make note as this information is important in the next step.&#160; After you have edited your computer’s name (without symbols or spaces) and have your MAC address, you are ready to create the sparse bundle on your local computer.&#160; We will later copy it to the correct place on the NAS hard drive.&#160; To do, open the terminal and type the following:</p>
<blockquote><p>sudo hdiutil create –size <span style="color: #ff0000">250g </span>–type SPARSEBUNDLE –nospotlight –volname “<span style="color: #ff0000">Backup of My Mac</span>” –fs “HFS+J” –verbose ./<span style="color: #ff0000">Computername_MACaddress.sparsebundle</span></p>
</blockquote>
<p>Be sure to replace everything in red with information that is pertinent to your computer (In my case, Computername_MACaddress is RobOakes-Mac_001ec4b8f9b3.sparsebundle).&#160; In this example, I have limited the size of the sparse bundle to 250g (through the –size flag).&#160; If you omit the &quot;-size&quot; flag, the sparse bundle will expand until it fills the entire available space of the drive.</p>
<p><em>Update (2009 07-02): The file system (fs) command line option above was changed from &quot;Case Sensitive Journaled HFS+&quot; to &quot;HFS+J&quot;.</em></p>
<h3>2) Copy the Sparse Bundle to the Appropriate Location</h3>
<p>After you finish creating the sparse bundle, it needs to be copied to the root of the Samba share which you will be using for your backups.&#160; This can be done from the finder or from the command line.&#160; In my case, I keep my Time Machine backups on a Samba share called PC-Backup.</p>
<p><em>Update (2009 07-02): The first comment below explains how to copy the sparsebundle image using the command line.</em></p>
<h3>3) Configure Time Machine to Support Samba Network Volumes</h3>
<p>To enable Samba shares in Time Machine, type the following into the terminal:</p>
<blockquote><p align="left">defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Time Machine-Unsupported Network Volumes" border="0" alt="Time Machine-Unsupported Network Volumes" src="http://www.oak-tree.us/blog/wp-content/uploads/2009/06/timemachineunsupportednetworkvolumes.png" width="600" height="38" /></p>
</blockquote>
<p><img style="border-right-width: 0px; margin: 10px 15px 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Select &quot;Change Disk&quot; from the Time Machine configuration pane under &quot;System Preferences.&quot;" border="0" alt="Select &quot;Change Disk&quot; from the Time Machine configuration pane under &quot;System Preferences.&quot;" align="left" src="http://www.oak-tree.us/blog/wp-content/uploads/2009/06/timemachinechangedisc.png" width="131" height="164" /> After you have changed this setting, you may need to restart the computer for it to take effect.&#160; (Alternatively, you can also log-out and then log back in.)&#160; At this point, everything is set-up for Time Machine to use your Samba share for back-ups.</p>
<p>Since Samba does not use Apple’s zero configuration network protocol (known as Bonjour), you will need to help Mac OS X find your backup-up volume the first time you use it.&#160; This can be done a variety of ways, you can either manually mount the volume by using the command line, or by navigating to the disk with the finder.&#160; (To check if the disk has been mounted, open up a finder window and see if a small eject icon appears next to the computer which hosts the share.&#160; Alternatively you can navigate to the /Volumes/ folder, where you will also see a list of currently mounted remote shares.)</p>
<p>Next, open the Time Machine configuration from the System Preferences and press the “Change Disk” button.&#160; This will give you a list of all the disks and samba shares that are currently available to OS X.&#160; Select which disk that you you would like to use and press the “Use for Backup” button.&#160; Since I placed my sparse bundle in the root of PC-Backup, that is the volume that I should select.</p>
<p align="center"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Time Machine - Available Volumes" border="0" alt="Time Machine - Available Volumes" src="http://www.oak-tree.us/blog/wp-content/uploads/2009/06/timemachineavailablevolumes.png" width="470" height="263" /></p>
<p align="left">Time Machine will begin a full back-up that can be accessed either over the network, or by manually plugging the hard drive into your Mac.</p>
<h3>Similar Posts:</h3>
<ul class="similar-posts">
<li><a href="http://www.oak-tree.us/blog/index.php/2009/10/18/time-machine-reclaim-space" rel="bookmark" title="October 18, 2009">Reclaiming Free Space from a Time Machine Backup</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2009/07/07/backup-part5-2" rel="bookmark" title="July 7, 2009">Backup, Sync and Share &ndash; Part 5.2: Windows Vista Backup (Disaster Prevention)</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2009/01/25/backup-part2" rel="bookmark" title="January 25, 2009">Backup, Share and Sync &ndash; Part 2: Hard Drive Preparation and Server Configuration</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2009/07/20/back-in-time2" rel="bookmark" title="July 20, 2009">Back In Time (Part 2): Over the Network and Across the World</a></li>
<li><a href="http://www.oak-tree.us/blog/index.php/2009/03/01/backup-archive" rel="bookmark" title="March 1, 2009">Backup and Archive</a></li>
</ul>
<p><!-- Similar Posts took 177.825 ms --></p>
<p>Copywrite 2009: Rob Oakes.  <a href="http://www.oak-tree.us/blog">Apolitically Incorrect</a><br/><br/><a href="http://www.oak-tree.us/blog/index.php/2009/06/09/backup-part4">Backup, Sync and Share &ndash; Part 4: Apple Time Machine and Samba</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oak-tree.us/blog/index.php/2009/06/09/backup-part4/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

