How to setup an OSX Lion Time Machine share on Ubuntu 11.10

Your Ad Here

Since my last tutorial on how to get Time Machine working on Ubuntu, 11.10 of Ubuntu was released which breaks Time Machine and all OS X sharing capabilities.  Fortunately its pretty straight forward to get you back on the road again should you follow this tutorial.   Some of it you might be able to skip if you have set this up before

 

Step 1 – Remove Netatalk

Login to your Ubuntu box and open up Terminal, type:

sudo apt-get remove netatalk –purge

sudo rm /etc/netatalk -r -f

 

Step 2 – Add repo’s

Login to your Ubuntu box and open up Terminal, type:

sudo add-apt-repository ppa:jstrunk-math/ppa

 

Step 2 – Install Netatalk 2.2

Open up Terminal and enter the following:

sudo apt-get update

sudo apt-get install netatalk

This should then start downloading the latest version of Netatalk from the repo’s added in the first step.

Once the download has completed, you can check the version installed by typing:

dpkg -s netatalk

Hopefully, it should say that we have version 2.2.x installed.

 

Step 3 – Configuring Netatalk

Now Netatalk is installed, we need to modify the apfd.conf to get it working. In Terminal type:

sudo gedit /etc/netatalk/afpd.conf

At the end of the file, enter this:

- -tcp -noddp -uamlist uams_dhx.so,uams_dhx2_passwd.so -nosavepassword

Now Netatalk is installed we need to go ahead and tell it what to share.  Open up Terminal again and type the following:

sudo gedit /etc/netatalk/AppleVolumes.default

Go to the bottom of the file and look for the line that says:

~/     “Home Directory”

What you need to do is delete this line and add in the location of your backup drive, a name and some options.  Heres what I put in mine:

/media/backupdisk/     “Time Machine’     cnidscheme:dbd options:usedots,upriv,tm

 

Step 4 – Restart the Netatalk Service

The next step is to restart the Netatalk service.  Just open up Terminal again and type:

/etc/init.d/netatalk restart

Easy!

 

Step 5 – Connecting to the share

Go back to  your OSX Lion machine and open up Terminal.  Type the following:

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

Then reboot your Mac.

Once rebooted open Finder and click Go -> Connect to server.

What you need to enter here is the ip address of your server using the following layout:

afp://<server ip>

Login with your Linux account details when it asks.  Then open the shared drive through Finder so it gets mounted

 

Step 6 – Create a sparsebundle

There are several ways of doing this, all which seem pretty complex.  So instead, download this makeImage.sh file to your OSX Lion machine from here:

http://www.insanelymac.com/forum/index.php?s=c16393f5a35718586df225fb1252dc31&showtopic=184462&view=findpost&p=1253495<

Make sure you save it as a .sh file and not a .txt.

Open up Terminal in OSX and navigate to the folder the .sh file was downloaded to.  The run the following command:

sh  ./makeImage.sh 1000 

This will create a sparsebundle of 1000GB in size.  Just alter the number for the amount of GB you want

Step 7 – Setting up Time Machine

The last step is to copy the sparsebundle that has just been made to the share you mounted earlier.  Once copied over, leave the shared drive mounted and open up Time Machine as usual.  Select the mounted shared drive and away you go

Your Ad Here
  • http://twitter.com/kindaeray Kinda Eray

    Hi, I’m having trouble. Whenever I try to connect it says:
    There was a problem connecting to the server “xx.xxx.xxx.xx”.
    Check the server name or IP address, and then try again. If you continue to have problems, contact your system administrator.

    I only finished step 5 tho but I dont think I care about the Time Machine but I’ll try doing that.

    • mattieK

      Im having the same issues

      • mattieK

        Anyone figure this out?

    • mattieK

      hey Kinda Eray, I figured it out. Turns out that in the section where your afpd.conf file, it should have

      “/media/backupdisk/ “Time Machine’ allow:YOURUSERNAME cnidscheme:dbd options:usedots,upriv,tm”

      you have to enter the allow section, space, cnidscheme etc. Solved my problems anyways. However now I am getting a different CNID error saying it is switching to read-only. I think thats because I’ve changed the cnidscheme :( I’ll purge netatalk, reset up and post back!

      Good luck!

      • Simon Macalino

        Hi Mattie,

        Did you add # infront of the following command in step 3?

        - -tcp -noddp -uamlist uams_dhx.so,uams_dhx2_passwd.so -nosavepassword

        • mattieK

          Nope, that section is accurate. I did however also notice that when I copy the piece of code for the AppleVolumes section, for some odd reason the “Time Machine” had to be deleted and re-typed. It should show up red once it is typed properly.

          I am successfully running the “first” time machine backup, and it says it will take about a day (lulz). I also noticed that I have to leave my SSH tunnel open, anyone know if that can be fixed?

          • Simon Macalino

            Awesome Mattie. I did not follow step 6. Instead I just pulled up Time Machine and pointed it to my USB on the ubuntu box and it worked. But I stopped it, since my test usb was way to small to be a TM drive. Going to buy a 2TB drive.

            What I want to know next is if i can partition the 2Tb to 1TB x2 and use 1TB for TM backups and the other half to store media that Mac can play from. That would work perfectly for me.

          • mattieK

            If you were to have one 2tb drive, the simplest way of doing this is to have one folder on the drive (say “backup”). And another folder (say “media”). Inside the backup folder, insert a sparse bundle (step 6) as you can actually set the size it will take for your time machine backups. And the “media” folder will act like a normal folder.

          • Simon Macalino

            Thanks for that tip. Enjoy your home made time capsule.

        • Simon Macalino

          For any one reading this. Do not put the # infront of this command.

      • Simon Macalino

        I am stuck at this step as well now. My TM disk is suppose to be a USB drive called UNTITLED

        /media/UNTITLED/ “‘Time Machine’ allow: simon cnidscheme:dbd options:usedots,upriv,tm

        On mac when I try to connect to my linux box I enter my user name for Linux box which is simon and then the password for the linux box and i get the same error as the original poster about the server “xx.xxx.xxx.xx”

        • mattieK

          Hey Simon, My apologies, I wasn’t clear when I said that earlier. It should be:

          allow:NOSPACEPUTYOURUSERNAMEHERE

          then another space, then cnidscheme:dbd etc…

          • mattieK

            and don’t forget to fix your quotes around “Time Machine” :)

        • Simon Macalino

          also to make the afp:// step work i changed this to

          /media/UNTITLED “TimeMachine” cnidscheme:dbd options:usedots,upriv,tm

          Notice the double quotes only…no single quote

      • Simon Macalino

        Ok guys I can see the TimeMachine folder on my USB drive on my Ubuntu Box.

        The issue was how you define your server.

        Try this

        afp://UbuntuBoxUserName@Your_Ubuntu_ip_address

        I used

        Enter afp://simon@xxx.xxx.x.xxx and click connect
        Then when promoted for username enter your Ubuntu Box user name

        Simon
        Password on UbuntuBox

        Now off to Step 6

    • oldguy

      This is the exact issue I came to this post to resolve. When I updated to 11.10 this began. I see a lot of talk about config files below but my config files were fine (like advised below) and what resolved the issue for me was just steps 1 and 2 and 2 above. maybe you need to revisit them. when following the steps I also had the error with -purge and skipped it (i didn’t see the comment below at the time) and all installed fine. I now have a great supported tm volume running 10.7.3. No client tweaking required.

      • oldguy

        PS if all config files are created as described you won’t need to create a sparse bundle, TN will do it.

  • Bill

    Awesomeness!!! TM is now verifying my old sparsebundle backup i used to share via SMB. I don’t think i even need to create a new one! THank YOU!

  • Simon Macalino

    Stuck on first step. When I type this:

    sudo apt-get remove netatalk –purge

    I get this:

    E: Command line option ‘p’ [from -purge] is not known.

  • Simon Macalino

    I proceeded without -purge

    At step 3 do I enter this:
    - -tcp -noddp -uamlist uams_dhx.so,uams_dhx2_passwd.so -nosavepassword

    or

    do I enter this:
    # – -tcp -noddp -uamlist uams_dhx.so,uams_dhx2_passwd.so -nosavepassword

    • mattieK

      Simon it’s good to start with a purge. The reason you got that error is because it needs to be typed like this:

      sudo apt-get remove netatalk –purge

  • mattieK

    See my comments below, you need to have the “allow:YOURUSERNAME” option when editing the afpd.conf, also had to delete and retype the “Time Machine” portion. It should show up red when typed correctly.

    Don’t put a hashtag (#) anywhere it doesn’t say to as that will VOID the line you just typed.

    and one final neat trick found here: http://www.kremalicious.com/2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/

    Steps 4 and 5 (Installing and Configuring Avahi) will allow your drive, when connected to show up as whatever you want. IE, I have my Ubuntu 11.10 showing up as a Mac Pro in my finder :)

    Happy backups!

    • mattieK

      Dammit I mean above :P

Premium Wordpress Themes