elkay14 Posted December 1, 2011 Posted December 1, 2011 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 'Time Capsule' and click 'Use for Backup' 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
Tight_wad Posted December 2, 2011 Posted December 2, 2011 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!
gshipley Posted December 2, 2011 Posted December 2, 2011 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.
boy914 Posted December 2, 2011 Posted December 2, 2011 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!
elkay14 Posted December 2, 2011 Author Posted December 2, 2011 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.
elkay14 Posted December 2, 2011 Author Posted December 2, 2011 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)
gshipley Posted December 2, 2011 Posted December 2, 2011 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
elkay14 Posted December 2, 2011 Author Posted December 2, 2011 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.
gshipley Posted December 2, 2011 Posted December 2, 2011 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.
elkay14 Posted December 10, 2011 Author Posted December 10, 2011 Bugs in script fixed and HOWTO added.
WallaceTech Posted December 10, 2011 Posted December 10, 2011 Perfect. I am buying a Macbook in the next couple of weeks. Thanks for creating this. Craig
adammerkley Posted December 10, 2011 Posted December 10, 2011 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!
elkay14 Posted December 10, 2011 Author Posted December 10, 2011 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
Tight_wad Posted December 11, 2011 Posted December 11, 2011 Thanks for all that you have done. How to looks easy. Going to give it a try tonight. One question, is there a process that will be running that will need to be killed off prior to powerdown?
elkay14 Posted December 11, 2011 Author Posted December 11, 2011 No, powerdown works normally -- just stop the array as usual and powerdown.
elkay14 Posted December 15, 2011 Author Posted December 15, 2011 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.
Tight_wad Posted December 20, 2011 Posted December 20, 2011 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?
elkay14 Posted December 20, 2011 Author Posted December 20, 2011 No, it doesn't matter where you download the script to or run it from. Just run it I'll correct the instructions.
Bags Posted December 21, 2011 Posted December 21, 2011 Will this work for multiple shares, I have an iMac and my wife a Macbook Pro. A share for hers and one for mine or can I set up one share and point both to the same folders/share?
elkay14 Posted December 22, 2011 Author Posted December 22, 2011 Works for multiple. I am backing up my work Mac and my wife's Macbook Air; no problem. Time Machine creates new directories for each Mac.
bbqninja Posted December 26, 2011 Posted December 26, 2011 backing up 600gb as we speak! One "interesting" thing is that it told me it wasn't a supported version when I tried to log in as a user (root... bad I know) but worked fine as guest.
WallaceTech Posted December 26, 2011 Posted December 26, 2011 Hello. I know the title says 4.7 but will this work with 5 Beta 13? Many thanks
elkay14 Posted December 26, 2011 Author Posted December 26, 2011 Hello. I know the title says 4.7 but will this work with 5 Beta 13? Many thanks No.
evans036 Posted January 1, 2012 Posted January 1, 2012 this worked 'out of the box'. backing up my wifes mac as i type. thanks a lot. steve
luksak Posted January 2, 2012 Posted January 2, 2012 Thank you for the script! It works when I connect as a guest. But when I log in as root it throws the same error as before. Is there something I could be missing out? Also today all of a sudden TM says it couldn't connect to the drive.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.