{"id":278,"date":"2009-02-23T22:04:59","date_gmt":"2009-02-24T03:04:59","guid":{"rendered":"https:\/\/lowtek.ca\/roo\/?p=278"},"modified":"2013-04-14T20:37:14","modified_gmt":"2013-04-15T00:37:14","slug":"ubuntu-with-apples-time-machine","status":"publish","type":"post","link":"https:\/\/lowtek.ca\/roo\/2009\/ubuntu-with-apples-time-machine\/","title":{"rendered":"Ubuntu with Apple&#8217;s Time Machine"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-279\" title=\"timemachine\" alt=\"timemachine\" src=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2009\/02\/timemachine.png\" width=\"500\" height=\"324\" \/>Once I had managed to get Leopard up and going on the mac mini with all of the user settings copied over, it was time to start exploring new features.\u00a0 <a href=\"http:\/\/en.wikipedia.org\/wiki\/Time_Machine_(Apple_software)\">Time Machine<\/a> was first on the list &#8211; but I wanted to have it back up over the network to my Ubuntu Linux server.\u00a0 I probably took the long route to a solution, but what I have seems to be working.\u00a0 The two main parts of getting time machine to work are: a) make it so the Mac can see the network storage b) trick time machine into using it as a destination.<\/p>\n<p><strong>Part A<\/strong> &#8211; I believe that you can use a non-AFP network storage solution (and my Mac can see my Samba volumes for shared files) but I went the route of enabling <a href=\"http:\/\/en.wikipedia.org\/wiki\/Apple_Filing_Protocol\">AFP<\/a>.\u00a0 This is based on <a href=\"http:\/\/holyarmy.org\/benjamin\/2008\/01\/time-machine-backup-to-linux-via-netatalk\/\">instructions found here<\/a>, but I&#8217;ll repeat it here with my comments:<\/p>\n<ol>\n<li>We&#8217;ve got to recompile netatalk to have encryption.\u00a0 You&#8217;ll need the universe repository enabled, and the development tools.\u00a0 Details can be found in the <a href=\"http:\/\/ubuntuforums.org\/showpost.php?p=918060&amp;postcount=16\">ubuntu forums<\/a>.<br \/>\n<code>sudo apt-get install dpkg-dev<br \/>\nsudo apt-get install devscripts<br \/>\nsudo apt-get install libssl-dev<br \/>\napt-get source netatalk<br \/>\nsudo apt-get build-dep netatalk<br \/>\nsudo apt-get install cracklib2-dev<br \/>\ncd netatalk-2.0.3<br \/>\nDEB_BUILD_OPTIONS=ssl debuild<br \/>\nsudo dpkg -i ..\/netatalk_2.0.3-3ubuntu1_i386.deb<\/code><br \/>\nYou&#8217;ll probably want to issue a &#8216;hold&#8217; on the netatalk package by using dpkg &#8211;set-selections to prevent being upgraded<br \/>\nFor the lazy &#8211; here is a <a href=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2009\/02\/netatalk_203-3ubuntu1_i386.deb\">link to the .deb<\/a> I created.<\/li>\n<li>Modify the configuration file \/etc\/netatalk\/AppleVolumes.default to point at the location you are going to store files.\u00a0 Ensure ownership and permissions are correct for the user you want to have access this location.<\/li>\n<li>Now we <a href=\"http:\/\/www.disgruntled-dutch.com\/2007\/general\/how-to-get-your-linux-based-afp-server-to-show-up-correctly-in-leopards-new-finder\">install avahi<\/a><br \/>\n<code>sudo aptitude install avahi-daemon<\/code><br \/>\nEdit \/etc\/netatalk\/afpd.conf to contain:<br \/>\n<code>- -noddp -uamlist uams_randnum.so,uams_dhx.so<\/code><br \/>\nyou might add -noslp to that line above to remove a warning, the key is that the configuration must be on a single line.<br \/>\nEdit the hosts line in\u00a0 \/etc\/nsswitch to match<br \/>\n<code>hosts: files dns mdns4<\/code><br \/>\nDownload using wget http:\/\/www.disgruntled-dutch.com\/media\/afpd.service<br \/>\nand install that in \/etc\/avahi\/services<br \/>\nRestart the services:<br \/>\n<code>sudo \/etc\/init.d\/netatalk restart<br \/>\nsudo \/etc\/init.d\/avahi-daemon restart<\/code><\/li>\n<\/ol>\n<p>At this point your Mac should be able to discover the service and see the volume as a shared drive.<\/p>\n<p><strong>Part B <\/strong>&#8211; Tricking the Mac into using this volume as a backup.\u00a0 You may not need to do any of the work in Part A at all as is evidenced by <a href=\"http:\/\/rajeev.name\/blog\/2007\/11\/03\/time-machine-with-smb-and-nfs-shares\/\">other people<\/a> claiming success on the net.<\/p>\n<ol>\n<li>Create a file named &#8220;.com.apple.timemachine.supported&#8221; at the root of the filesystem we pointed at in (2).\u00a0 I&#8217;m not entirely sure this is required, but it didn&#8217;t hurt.<\/li>\n<li>On the Mac we need to fiddle one default.\u00a0 Enter the following command in a terminal:<br \/>\n<code>defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1<\/code><br \/>\nAt this point, Time Machine would connect, but then fail with the error message: &#8220;Time Machine Error &#8211; Backup disk image could not be created&#8221;<\/li>\n<li>The ReadyNAS folk had <a href=\"http:\/\/www.readynas.com\/?p=253\">a solution<\/a> that worked for me.\u00a0 Create the backup volume locally on the Mac and move it to the network volume:<br \/>\nDetermine your hostname, hopefully it is a simple one.<br \/>\nIssue the command &#8220;ifconfig en0 | grep ether&#8221; which will find the MAC address of your Mac.<br \/>\nUsing &lt;hostname&gt;_&lt;mac address&gt;.sparsebundle as the filename we create a new volume:<br \/>\n<code>hdiutil create -size 140g -fs HFS+J \\<br \/>\n-volname \"Backup of magpie\" \\<br \/>\nmagpie_0016cbaf91d7.sparsebundle<\/code><br \/>\nCopy the newly created &#8220;sparse bundle&#8221; to the network volume.<\/li>\n<li>Now start up Time Machine &#8211; you should be good to go.\u00a0 I opted to leave SpotLight enabled, this did significantly slow down the backup performance &#8211; but I do want the ability to search for &#8220;lost&#8221; files from the backup.<\/li>\n<\/ol>\n<p>Time Machine is pretty weird.\u00a0 I had assumed (wrongly) that it simply gave you a file view in time.\u00a0 It turns out that many of the Mac applications are time machine aware, and will show you a views of the past.\u00a0 For example, you can view your email through time and recover the mailbox from the past.<\/p>\n<p>[Edit: April 2013 &#8211; it&#8217;s been some time since I stopped using this solution. I experienced this failing twice for me in basically the same manner. When the timemachine volume would get full my backup would stop being accessible. Instead of spend more time figuring out what exactly was wrong, I&#8217;ve moved onto an rsync (rsnapshot) based solution].<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once I had managed to get Leopard up and going on the mac mini with all of the user settings copied over, it was time to start exploring new features.\u00a0 Time Machine was first on the list &#8211; but I wanted to have it back up over the network to my Ubuntu Linux server.\u00a0 I &hellip; <a href=\"https:\/\/lowtek.ca\/roo\/2009\/ubuntu-with-apples-time-machine\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Ubuntu with Apple&#8217;s Time Machine&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-278","post","type-post","status-publish","format-standard","hentry","category-computing"],"_links":{"self":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts\/278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/comments?post=278"}],"version-history":[{"count":7,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts\/278\/revisions"}],"predecessor-version":[{"id":1349,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts\/278\/revisions\/1349"}],"wp:attachment":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/media?parent=278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/categories?post=278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/tags?post=278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}