unRAID 4.7 Time Machine support for Mountain Lion/Lion/Snow Leopard/Leopard


Recommended Posts

unRAID 4.7 Time Machine support for Lion/Snow Leopard/Leopard

 

I grew tired of waiting for the production release of 5.0 and so I created a set of packages to enable Time Machine backups to unRAID 4.7.  The packages include Avahi and Netatalk to allow out-of-the-box backups to what appears to be an Apple Time Capsule.

 

This is a turnkey solution -- all you have to do is run the attached script.  It downloads the needed packages, asks a few questions, and configures everything for you and the config will survive a reboot.

 

NOTE:  This does not allow afp mounting of your user shares.  It is purely for enabling Time Machine backups.

 

NOTE:  This is not well tested with user shares.  It works perfectly fine with a disk share.

 

Enjoy.

 

Dec 10 2011: Updated attachment to v0.2.0.  Fixes a few bugs and should now work 100% out of the box.

 

Dec 13 2011: Updated to v0.2.1.  Backs up all generated conf files for netatalk for restore on reboot.  If you have already installed, see my post on page 2 for fix instructions.

 

Apr 06 2012: Updated to v0.2.2.  Updated timecapsule package to upgrade to netatalk 2.2.2.

 

Jul 29 2012: Updated to v0.2.3.  Updated timecapsule package:  netatalk 2.2.3, avahi 0.6.31, db-5.3.21, dbus-1.6.4.  The update to netatalk fixes a time machine bug.  Verified working with Mountain Lion.

 

Aug 21 2012: Updated to v0.2.4.  Fixed bug where libcap package was being download from wrong directory of slackware mirror.

 

Oct 25 2012: Updated to v0.2.6.  Fixed bug where paths to packages in go script were incorrect.  Add option to put afp database on cache drive if it exists.

 

------------------------------------

Upgrade HOWTO

 

Either download the attachment and transfer it to your unRAID system, or telnet to it and issue the following command:

 

root@Tower:~# cd /boot
root@Tower:/boot# wget -N http://blueskyhorizon.com/unraid/tmupgrade.sh

 

Now run the script and then reboot:

root@Tower:/boot# ./tmupgrade.sh
(wget output)
Upgrade successful.  Please reboot to activate.

 

------------------------------------

First Install HOWTO

 

Either download the attachment and transfer it to your unRAID system, or telnet to it and issue the following command:

 

root@Tower:~# cd /boot
root@Tower:/boot# wget -N http://blueskyhorizon.com/unraid/tminstall.sh

 

Now, run the script and answer the questions:

 

root@Tower:/boot# ./tminstall.sh
This script will download and install a set of packages on your unRAID 4.7 system
that will enable 'Time Capsule' functionality for Time Machine backups.
Do you wish to continue? [y/n] y

 

You will now see the script downloading the various needed Slackware and custom packages.

 

The script will now ask where on your array you would like to store your Time Machine backups.  This can either be on a user share or a single disk. 

 

Where would you like Time Machine to back up to on your unRAID array?  ie. /mnt/disk1/TM
Enter directory: /mnt/disk1/TM
Directory does not exist.  Create?  [y/n] y

 

Now enter which users you wish to grant permission to back up to.  If you do not have user level security turned on, then enter 'none' and guest level access will be automatically turned on.

 

Which unRAID users would you like to grant Time Machine permissions to?  ie: user1,user2,user3
Enter comma delimited list of users ('none' will enable guest access): john,alice
Do you wish to allow Guest access? [y/n] y

 

If you wish to limit the amount of disk space that will be exposed to Time Machine, answer y to the next question:

 

Do you want to limit the amount of space given to Time Machine Backups? [y/n] y
Enter max space in GB (up to XXX) to reveal to Time Machine: 500

 

The final question asks whether you want to start the service daemons or not.  If you want to immediately start using Time Machine, answer 'y'.  Otherwise, you'll have to reboot to activate them.

 

Start daemons now? [y/n] y
Installation complete!

You should now be able to see "Time Capsule" as a valid backup target in Time Machine

 

Start daemons now? [y/n] n
You will be able to see "Time Capsule" as a valid backup target after rebooting

 

Now you need to set up Time Machine on your Mac.  Open Time Machine from the Preference Panel and click the 'Select Disk' button:

 

select_disk.png

 

Select 'Time Capsule' and click 'Use for Backup'

 

time_capsule_disk.png

 

Time Machine will now schedule the first backup in two minutes.

 

The script is safe to run again, but you will need to remove the added lines to the go script /boot/config/go before it will let you.

tmupgrade.zip

tminstall-0.2.6.zip

Link to comment
  • Replies 117
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

My wife just purchased an airbook mac, so perfect timing, but have good no clue to time machine , but told to set it up. Was going to get a mac solution but would rather use what I have.   Only problem for me is, I don't know the proper procedure to use your script. Please post a little how to.  Dealing with a new mac has cause a little brain damage for me!

Link to comment

unRAID 4.7 Time Machine support for Lion/Snow Leopard/Leopard

 

I grew tired of waiting for the production release of 5.0 and so I created a set of packages to enable Time Machine backups to unRAID 4.7.  The packages include Avahi and Netatalk to allow out-of-the-box backups to what appears to be an Apple Time Capsule.

 

This is a turnkey solution -- all you have to do is run the attached script.  It downloads the needed packages, asks a few questions, and configures everything for you and the config will survive a reboot.

 

NOTE:  This does not allow afp mounting of your user shares.  It is purely for enabling Time Machine backups.

 

Enjoy.

 

Awesome!  Thanks for this. 

 

However, when I run the script I get a bad interpreter error message.... made sure that it is +x and then do a

./tminstall.sh

 

I am running bash so I am not sure what is going on here.

 

Link to comment

This looks great, thanks for putting it together!

 

One question: in the event of a complete hard drive failure on the Mac, is it easy enough to get the Mac to reconnect to the backups when booting from the OS install DVD? This, as I understand it, is why TimeMachine -> SMB backups aren't a good idea: backups work just fine, restores are another story...

 

I read through your script, but still being a newbie, I couldn't tell how much of the script modifies the Mac. It looks like it mostly configures unRAID, but obviously if it makes changes to the Mac (mappings, settings, etc), those won't be available when booting from DVD.

 

Thanks!

Link to comment

This looks great, thanks for putting it together!

 

One question: in the event of a complete hard drive failure on the Mac, is it easy enough to get the Mac to reconnect to the backups when booting from the OS install DVD? This, as I understand it, is why TimeMachine -> SMB backups aren't a good idea: backups work just fine, restores are another story...

 

I read through your script, but still being a newbie, I couldn't tell how much of the script modifies the Mac. It looks like it mostly configures unRAID, but obviously if it makes changes to the Mac (mappings, settings, etc), those won't be available when booting from DVD.

 

Thanks!

 

It doesn't have to modify the Mac -- It works just like an actual Time Capsule.  It will indeed show up when you boot the install DVD.  It doesn't use SMB at all, it uses netatalk to provide native AFP support.

Link to comment

Awesome!  Thanks for this. 

 

However, when I run the script I get a bad interpreter error message.... made sure that it is +x and then do a

./tminstall.sh

 

I am running bash so I am not sure what is going on here.

 

 

I re-attached the script as a zip file.  As a txt file, the download process was converting it to DOS format and that won't execute on a unix platform (the #!/bin/bash will have a ^M on the end)

 

Download the new attachment (that goes for everyone who previously downloaded the .txt file)

Link to comment

Awesome!  Thanks for this.  

 

However, when I run the script I get a bad interpreter error message.... made sure that it is +x and then do a

./tminstall.sh

 

I am running bash so I am not sure what is going on here.

 

 

I re-attached the script as a zip file.  As a txt file, the download process was converting it to DOS format and that won't execute on a unix platform (the #!/bin/bash will have a ^M on the end)

 

Download the new attachment (that goes for everyone who previously downloaded the .txt file)

 

Thanks!  The script installed fine and I now see the Time Machine in my list of available devices.  However, when I try to back up I get the following error:

 

The network backup disk does not support the required AFP features.

 

I think this may have something to do with user permissions?  When I specified which users could backup via the script, is that users that already exist on the unRaid box?  In my case, that would be only root.  I also selected to allow guest access but I get the same error message.

 

I see the following in the logs:

Dec  2 19:45:22 Hog avahi-daemon[4051]: Failed to find user 'avahi'.

Dec  2 19:45:42 Hog afpd[4055]: AFP/TCP started, advertising 192.168.15.100:548 (2.2.1)

Dec  2 19:45:42 Hog shfs: shfs_setxattr: setxattr: /mnt/disk10/TM/TM (95) Operation not supported

Dec  2 19:45:42 Hog afpd[4055]: volume "Time Capsule" does not support Extended Attributes, using ea:ad instead

 

 

Link to comment

Thanks!  The script installed fine and I now see the Time Machine in my list of available devices.  However, when I try to back up I get the following error:

 

The network backup disk does not support the required AFP features.

 

I think this may have something to do with user permissions?  When I specified which users could backup via the script, is that users that already exist on the unRaid box?  In my case, that would be only root.  I also selected to allow guest access but I get the same error message.

 

I see the following in the logs:

Dec  2 19:45:22 Hog avahi-daemon[4051]: Failed to find user 'avahi'.

Dec  2 19:45:42 Hog afpd[4055]: AFP/TCP started, advertising 192.168.15.100:548 (2.2.1)

Dec  2 19:45:42 Hog shfs: shfs_setxattr: setxattr: /mnt/disk10/TM/TM (95) Operation not supported

Dec  2 19:45:42 Hog afpd[4055]: volume "Time Capsule" does not support Extended Attributes, using ea:ad instead

 

First, for some reason the avahi user didn't get added before avahi-daemon started... that's something I'll look at.

 

Second, it appears that there is some permissions issue on the TM dir.  Can you send me a personal msg with the perms for that dir and every parent dir behind it?  Also, look in /etc/passwd to see if the avahi user is in there.

Link to comment

Thanks!  The script installed fine and I now see the Time Machine in my list of available devices.  However, when I try to back up I get the following error:

 

The network backup disk does not support the required AFP features.

 

I think this may have something to do with user permissions?  When I specified which users could backup via the script, is that users that already exist on the unRaid box?  In my case, that would be only root.  I also selected to allow guest access but I get the same error message.

 

I see the following in the logs:

Dec  2 19:45:22 Hog avahi-daemon[4051]: Failed to find user 'avahi'.

Dec  2 19:45:42 Hog afpd[4055]: AFP/TCP started, advertising 192.168.15.100:548 (2.2.1)

Dec  2 19:45:42 Hog shfs: shfs_setxattr: setxattr: /mnt/disk10/TM/TM (95) Operation not supported

Dec  2 19:45:42 Hog afpd[4055]: volume "Time Capsule" does not support Extended Attributes, using ea:ad instead

 

First, for some reason the avahi user didn't get added before avahi-daemon started... that's something I'll look at.

 

Second, it appears that there is some permissions issue on the TM dir.  Can you send me a personal msg with the perms for that dir and every parent dir behind it?  Also, look in /etc/passwd to see if the avahi user is in there.

 

PM sent.  Let me know if you didn't get it for some reason.

Link to comment

New script works BEAUTIFULLY!  I had tried the previous gen script a few days ago, and was getting some nonsense about avahi d-bus in the syslog, and no Time Capsule destination appearing in Time Machine Prefs.

 

Thanks!

 

Good to hear.  There were some bugs that were not apparent on my main machine as I had hacked it so much it was not a clean test bed.  I built a small test unRAID box from an old Sony VAIO Pentium4 and found the bugs.  That was a project in of itself as the machine is old enough to not boot from USB.  I am PXE netbooting it into plop which then boots the USB :)

Link to comment

v0.2.0 --> v0.2.1 FIX INSTRUCTIONS

 

I have updated the tminstall.sh script to back up a couple more configs to the flash to restore on reboot.  These are needed for Time Machine to track the backup location.  If these are not backed up, Time Machine will not be able to do a subsequent backup to your unRAID box without reselecting the disk to back up to.

 

If you have installed this already, then please make the following changes to your go script:

 

Change the line:

 

for cfg in AppleVolumes.default afpd.conf

 

to

 

for cfg in AppleVolumes.default afpd.conf afp_signature.conf afp_voluuid.conf

 

Also, issue the following command to back up those files to your flash:

 

root@Tower:~# cd /usr/local/etc/netatalk; cp afp_signature.conf afp_voluuid.conf /boot/config/netatalk/

 

That will do the trick.

Link to comment

Your second step didn't work for me.

 

Now, run the script and answer the questions:

 

 

root@Tower:~# ./tminstall.sh
This script will download and install a set of packages on your unRAID 4.7 system
that will enable 'Time Capsule' functionality for Time Machine backups.
Do you wish to continue? [y/n] y

 

I had to run the install at

root@tower:/boot#

 

Is it going to be a problem if I did this?

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.