This is a guide on how to set up a Ubuntu Server to act as a TimeMachine Backup Server, using a Auto Mounted HFS+ Jounaled Parition and a DD-WRT Router to WAKE ON LAN the Ubuntu Machine in case it shuts down.

We will follow these simple steps:

1. Format the drive as HFS+ Journaled 

2. Set Up DD-WRT to assign Ubuntu Server with Static IP and WOL

3. Set up Ubuntu to auto mount the HFS+ Journaled Partition one every book 

4. Set up Netatalk server on Ubuntu to run as Time Machine

5. Set up Mac to Backup to Ubuntu Time Machine

1. Format the drive as HFS+ Journaled 

  1. Connect and power the drive
  2. Open Applications
  3. Open Utilities
  4. Open Disk Utility
  5. On the left you should see the hard drive listed. It should show the drive size with a second indented line beneath it that shows the volume of the drive.
  6. Click Erase at the top of the screen.
  7. Select Mac OS Extended (Journaled) for the volume format option.
  8. Change the name of the drive if desired – for our example we will set it to “TimeMachine
  9. Click Erase at the bottom of the screen. You will receive a warning and will need to click Erase again.

 

2. Set Up DD-WRT to assign Ubuntu Server with Static IP and WOL

First we use the router to assign the Ubuntu server a static IP

  1. Log into the DD-WRT Web GUI
  2. Go to the Services tab
  3. DHCP Daemon should be enabled
  4. If there is no blank slot under “Static Leases”, click Add
  5. Enter the MAC address of the client interface – to get this run the “ifconfig” command on ubuntu – look for something like 
    02:23:8s:4d:31:82  
  6. Enter the hostname of the machine – to get this run the “hostname” command on ubuntu – for our example we got “timemachine”
  7. Enter the desired IP address for this machine – for our example we will use – “192.168.11.100”
  8. Scroll to the bottom of the page and save your changes.
  9. Reboot your Ubuntu machine to make sure you receive the 192.168.11.100 IP Address

 

DHCP_Static_Lease_GUI_-_build_15704

 

Now to set up WOL

  1. Enable WOL in the Bios on the Ubuntu Machine – you can google how to do this
  2. Log into the DD-WRT Web GUI
  3. Click on the Administrator Tab
  4. Click on the WOL Tab
  5. Tick the Enable WOL box next to the Ubuntu Machine
  6. Apply Settings
  7. Shut down the Ubuntu Machine
  8. Click on the WAKE UP button on the DD-WRT WOL page to wake up the ubuntu machine
  9. The Ubuntu Machine should now wake up

Screen-Shot-2014-04-17-at-1.09.04-PM

 

3. Set up Ubuntu to auto mount the HFS+ Journaled Partition one every book 

1. Install HFS Progs

sudo apt-get install hfsprogs

2. Create a mount point dir 

sudo mkdir /media/timemachine

3. chmod the dir 

sudo chmod 777 /media/timemachine

4. Insert the USB HDD

5. Find the USB Drive UUID

sudo blkid

You should see something like this

/dev/sdc2: UUID="414e84df-127a-3402-8737-8ec308130509" LABEL="TimeMachine" TYPE="hfsplus"

6. Edit fstab

sudo nano /etc/fstab

7. Add the following to the bottom of that file – replacing the UUID with yours

UUID=414e84df-127a-3402-8737-8ec308130509 /media/timemachine hfsplus  force,rw,user,auto 0       0

8. Reboot the Ubuntu machine and the drive should now be mounted with RW permissions

 

4. Set up Netatalk server on Ubuntu to run as Time Machine

1. Install everything needed

sudo apt-get install netatalk avahi-daemon

2.  Backup the configuration file

sudo mv /etc/netatalk/AppleVolumes.default /etc/netatalk/AppleVolumes.default.old

3. Edit the netatalk config file

sudo nano /etc/netatalk/AppleVolumes.default

4. Add these line – replacing youruser with your ubuntu username

:DEFAULT: options:upriv,usedots
/media/timemachine "TimeMachine" options:tm allow:youruser

5. Restart Netatalk

sudo service netatalk restart

You should now be able to see the drive appear on your Mac

 

5. Set up Mac to Backup to Ubuntu Time Machine

1. On your Mac find the Share in Finder under shares – Connect with your ubuntu usersname and password

2. Create a directory to make sure you have write access

3. Open Time Machine 

4. Select the TimeMachine Disk on the Ubuntu server and start you Backup

time-machine-available-disks

Let me know if you have any questions

Peace

 

 

Credits:

http://www.hgst.com/support/faqs/how-format-my-drive-mac-only-hfs

http://www.dd-wrt.com/wiki/index.php/Static_DHCP

http://d43.me/blog/1660/concisest-guide-to-setting-up-time-machine-server-on-ubuntu-server-12-04/

http://askubuntu.com/questions/332315/how-to-read-and-write-hfs-journaled-external-hdd-in-ubuntu-without-access-to-os

How to: Ubuntu Netatalk Time Machine – Auto Mount Mac USB HDD HFS+ Journaled Partition – DD-WRT WOL
Tagged on:                                                                                                                                     

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “How to: Ubuntu Netatalk Time Machine – Auto Mount Mac USB HDD HFS+ Journaled Partition – DD-WRT WOL