Page 1 of 1

[HOWTO]Time Machine setup for OS X 10.8.x

Posted: Feb 23rd, '21, 05:58
by Hiji56
"
by seaside»20 Nov 2012 22:51
Hi *,
I'm new to NAS4Free and to this forum so bear with me.
This post may likely be moved to a more appropriate place like AFP, Backup or the How-to section.
In the last few days I struggled to get NAS4Free being accepted as a time machine backup target by OS X 10.8.x. Marking an AFP share as a Time Machine drive didn't work reliable for me. Either the drive didn't show up or other shares vanished after AFP restart. Renaming the time machine share sometimes caused it to pop up again or not.
Trying Code: Select all

Code: Select all

dns-sd -Z _adisk local
on the OS X side I noticed that some of the AFP shares were not always announced by bonjour.
Checking on the NAS using
Code: Select all

Code: Select all

cat /var/etc/mdnsresponder.conf
showed that all shares were listed for announcement but the info didn't make it through obviously.
The following how-to describes all the steps necessary to use NAS4Free as a time machine backup target. As a bonus you can restrict the size of your Time Machine backup so it doesn't entirely fill up your disk.

Prepare user and group
We use a special user for Time Machine backups so the backup is nicely separated from the other data on the disks.
Log in to your NAS using the web gui
create a new group timemachine
Create a user timemachine
Make timemachine the default group for the timemachine user
Leave the home dir alone for now. We will add that later on. There is no need to give that user a login shell so leave nologin.
Prepare Time Machine directory
The following is best done on the console or over ssh. Log in as root. It is assumed your disk is called data in the examples.
Create a directory on your data disk named TMBackup (or whatever you like):
Code: Select all

Code: Select all

mkdir /mnt/data/TMBackup
Make user timemachine the owner of the newly created directory:
Code: Select all

Code: Select all

chown timemachine:timemachine /mnt/data/TMBackup
Set Access rights:
Code: Select all

Code: Select all

chmod 1775 /mnt/data/TMBackup
I only use encrypted time machine backups so it's safe for me to allow everyone to read and browse the directory (and I'm the only user anyway). If you have concerns about that use 1770 instead. I didn't test that but should work.
Create the Time Machine share
AFP shares are announced using Bonjour (Apples name for zeroconf) by NAS4Free when Automatic disk discovery is marked on the shares details page.
Don't let NAS4Free announce your Time Machine shares!
In fact don't tell NAS4Free anything about the Time Machine directory. We will use another means to publish the share.
Go to the users and groups page of the gui and add the directory /mnt/data/TMBackup/ as the home directory for user timemachine we created earlier.
Create the file /mnt/data/TMBackup/AppleVolumes with the following contents:
Code: Select all

Code: Select all

""/mnt/data/TMBackup/"" ""Time Machine"" volcharset:UTF8 options:usedots,upriv,tm volsizelimit:800000
Change group:
Code: Select all

Code: Select all

chown :timemachine /mnt/data/TMBackup/AppleVolumes
On login of user timemachine this file will be read by the AFP daemon and the share Time Machine made available.
Note options:usedots,upriv,tm which tells the AFP daemon that this share is a Time Machine target.
Using volsizelimit:800000 we restrict the size of the backup to 800GB. Chose whatever is suitable for you.
Announcing the Time Machine target using Bonjour
Up to now the new share Time Machine is not visible in Time Machine on the client. This will change now.
Create the file /mnt/data/TMBackup/tm_mdnsresponder.conf with the following contents:
Code: Select all

Code: Select all

Rewind Time
_device-info._tcp. local.
1
model=AirPort
Rewind Time
_adisk._tcp. local.
9
sys=waMA=0
dk0=adVF=0xa1,adVN=Time Machine

Change group:
Code: Select all

Code: Select all

chown :timemachine /mnt/data/TMBackup/tm_mdnsresponder.conf
Create the file /mnt/data/TMBackup/addtmdisk.sh with the following contents:
Code: Select all

Code: Select all

#! /bin/bash
#kill all running mDNSResponderPosix instances
killall -INT mDNSResponderPosix
#Start new ones. Make sure our time machine announce is the first to be launched
/usr/local/bin/mDNSResponderPosix -b -f /mnt/data/TMBackup/tm_mdnsresponder.conf
/usr/local/bin/mDNSResponderPosix -b -f /var/etc/mdnsresponder.conf
Change group:
Code: Select all

Code: Select all

chown :timemachine /mnt/data/TMBackup/addtmdisk.sh
Make it executable:
Code: Select all

Code: Select all

chmod 774 /mnt/data/TMBackup/addtmdisk.sh
Go to the gui and select System->Advanced->Command Scripts
Create a new postinit script with command:
Code: Select all

Code: Select all

/mnt/data/TMBackup/addtmdisk.sh 
Create a new shutdown script with command:
Code: Select all

Code: Select all

killall -INT mDNSResponderPosix ; rm /var/run/mDNSResponder.pid
On page Services->AFP enable the AFP daemon.
Reboot your NAS.
Select your share in TM preferences on the client
After your NAS rebooted you should see two devices in the Shared section of your Finder sidebar:
Your NAS server with a nice XServe icon as before
A new device named Rewind Time
Opening the Time Machine preferences you're able to select the new disk Time Machine on device Rewind Time as a
backup target. After selection a login window pops up for the share Time Machine. Login as user timemachine (the
one you created in the beginning).
OS X stores the login credentials in your system keychain. You don't have to reenter them on each backup.
Roundup
This setup works for me for some days now. Each hour the share is mounted and a backup performed. Shutting down the
NAS in between is no problem.
Being logged in to the NAS with your normal user login is possible while Time Machine works in the background on your
backup.
You may skip the following if you don't care about the technical background.
What do these scripts and commands do?
File tm_mdnsresponder.conf
This is the configuration file for the additional mDNSResponderPosix daemon we start in the addtmdisks.dh script.
The first section tells the OS X clients that a new device is around.
Code: Select all

Code: Select all

Rewind Time
_device-info._tcp. local.
1
model=AirPort
This causes the Rewind Time device to show up in the sidebar with it's own icon. You may chose a name to your liking here. The line model=AirPort tells OS X which icon to show in the sidebar. According to [1] you may use one of the following:
RackMac (same as Xserve)
PowerBook
PowerMac
Macmini
iMac
MacBook
MacBookPro
MacBookAir
MacPro
AppleTV1,1
AirPort
If you leave out the device-info section OS X will show the default icon for connected servers.
The second section announces the share.
Code: Select all

Code: Select all

Rewind Time
_adisk._tcp. local.
9
sys=waMA=0
dk0=adVF=0xa1,adVN=Time Machine
Use the same name as in the first section so in the Time Machine preferences you can see that this share is on device Rewind Time.
More will be added later...
Here are some links you may find interesting wrt Time Machine and non Apple blessed hardware:
[1] ""http://kremalicious.com/ubuntu-as-mac-f ... ne-volume/""
[2] ""http://the.taoofmac.com/space/HOWTO/Setup/Rendezvous""
[3] ""https://developer.apple.com/library/mac ... ments.html""
Edits
24.11.2012: Typo and formatting corrections. Added some technical explanation.
Last edited by seaside on 24 Nov 2012 16:45, edited 1 time in total.
"
"
by pauler»23 Nov 2012 04:51
my one works fine it all works just right how i want it to be
"
"
by marcusman»25 Nov 2012 04:52
Nice post. I think I'll try it out later this week, as I've had a little trouble w/Time machine. I'm also new to NAS4free so I could be doing something wrong.
Have you had any issues in restoring files with TimeMachine using NAS4free?
Looking forward to your next post.
"
"
by seaside»25 Nov 2012 20:36
marcusman wrote:
Have you had any issues in restoring files with TimeMachine using NAS4free?
Looking forward to your next post.
Well, I didn't try a full recovery because I use Time Machine for my documents only.
What I can say is that backups seem to work so far. I can travel back in time and restore files I deleted on my system. The drive holds time stamped folders with data for every backup as you would expect. I just tried to restore a deleted iPhoto item and that did work, too.
In general this hint doesn't tweak anything within Time Machine so as long as Time Machine is able to find and mount the backup drive everything should be just fine. You may check in the preferences if TM created a backup within the last hour.
As a general rule be sure to have another backup somewhere else for example on an external USB drive. You know your NAS may die like every other HD...
Regards
"
"
by acolytex»07 Jan 2013 20:27
seaside-
Thanks very much for the detailed post. I am wondering if you have any Mac OS X 10.7 (Lion) servers or clients accessing the safe AFP based share? I am planning to use 10.7 from multiple client and server locations to create TM based files.
Again, thanks!
"
"
by rinoskovich»11 Jan 2013 00:20
Seems to be working! Thanks!
"
"
by acolytex»11 Jan 2013 21:46
seaside-
Again, thanks for the write up and the method. I have attempted to follow the methods you provide and create two different shares; one for each of two different clients. Do you have any suggestions for a method of scripting in the postinit phase to allow user timemachine and user tmmbp to each call a separate addtmdisk.sh that does not
#kill all running mDNSResponderPosix instances?
Again, thanks.
"
"
by acolytex»15 Jan 2013 23:34
seaside-
Again, thank you. In my setup, I chose to use a different backup user for each of two different client machines. This allowed both machines to run Time Machine backups to the NAS4Free server simultaneously, as each user was set to use a different AppleVolume and home directory.
"
"
by techie»27 Jan 2013 09:47
Thank you, seaside, for an excellent and easy to follow how-to. I'm looking forward to the additional explanatory information you promised.
As an utter NAS4Free newbie I somehow managed to miss that all this needed to be done on an existing mount point created from within the NAS4Free GUI. With my embedded install, the script and config files vanished along with the directories I created as soon as I rebooted. It didn't take long to figure out the problem and the solution.
It seems regrettable that the configuration is being stored on the data disk and not on the boot volume, but I imagine the solution would take some real work, which would be lost the next time Apple ""improves"" its protocols.
"
"
by yakkers»26 Feb 2013 23:45
I am trying to get this to work for me but Time Machine on my MAC gives up every time. It says ""Time Machine couldn't complete the backup to <my NAS server name>. The backup disk is not available."" This is after the 120 second count down. Time machine has previously accept my login on the 'Select disk' window.
I have noticed that on the NAS server there is no file '/var/etc/mndsresponder.conf'
Also I have only one 'mdnsresponder' process running on the NAS server from what I can tell.
I have tried this twice, the second time after a 'reset to factory defaults' on the NAS server and with no other NAS services configured.
I am new to Apple MAC, NAS4free and freeBSD so could do with some advice, thanks.
"
"
by fireheadman»24 Mar 2013 10:06
When I follow your steps.... I see only the Time Machine ""Rewind Time"" disk in the TM Preferences....
When I select it, I get the prompt to supply credentials...
After I hit return, I get the following error
attachment here!
NOTE, my hostname is just ""pyro"", so not sure where the "".local"" is coming from....
"
"
by fireheadman»06 Apr 2013 22:14
more like dead forum... makes ya wonder how many people really use nas4free these days....
"
"
by raulfg3»06 Apr 2013 22:21
The problem is not a ""dead forum"" is that you ask about a very specific question, and only others users that use OS X can answer ( Sorry I use win7).
"
"
by fireheadman»06 Apr 2013 22:45
Much better explanation and extremely SIMPLE to implement.
Did not have to jump through the hoops above.
This link explains it... ""http://thegeek.mobi/viewtopic.php?f=9&amp;t=6""
This link shows it in action... """"
"
"
by raulfg3»06 Apr 2013 23:13
hope that finally you find a sollution, and thanks to share to us.
"
"
by pakpenyo»01 Nov 2013 14:08
Thanks seaside. This work for me with new 10.9 Mavericks but i'm not using as Time Machine backup. I'm only need to displaying my AFP in the Sidebar Finder.
My previous problem is when connect with AFP, click the folder name with eject icon, the folder is disappear.
This tutorial is make the folder clickable at the Sidebar Finder but only after connecting to AFP via Finder -- Go -- Connect to Server. Maybe someone can make this displaying with or without connecting to server manually, just like SMB Share.
Thanks and really sorry about my english.
"
"
by seaside»05 Jan 2014 20:46
fireheadman wrote:Much better explanation and extremely SIMPLE to implement.
Did not have to jump through the hoops above.
This link explains it... ""http://thegeek.mobi/viewtopic.php?f=9&amp;t=6""
This link shows it in action... """"
Great this method did the job for you! It didn't work for me (at least not reliable) hence the other solution I presented.
A disadvantage of the solution presented in your link is that time machine will eat up your entire disk on your NAS when creating backups. If that is no problem for your setup you're ready to roll .
WRT the connection problems to your backup disk. This is related to an authorization method change implemented by Apple in AFP with I believe 10.7. There is a workarounds floating around I had to use myself to get OSX to access my disk. That's not TimeMachine related.
Best regards
"
"
by seaside»05 Jan 2014 20:57
pakpenyo wrote:Thanks seaside. This work for me with new 10.9 Mavericks but i'm not using as Time Machine backup. I'm only need to displaying my AFP in the Sidebar Finder.
My previous problem is when connect with AFP, click the folder name with eject icon, the folder is disappear.
This tutorial is make the folder clickable at the Sidebar Finder but only after connecting to AFP via Finder -- Go -- Connect to Server. Maybe someone can make this displaying with or without connecting to server manually, just like SMB Share.
Thanks and really sorry about my english.
You have to login to the server before you are able to access any folders.
When the server shows up in the sidebar (it should even with the default NAS4Free setup) klick on it. You should see a connect button in the folder window. Use it to login with your user id and password you provided when setting up a share using the NAS4Free Web-GUI.
If you can't see this button switch the folder view to as Columns.
Best regards
"
"
by conor__»18 Mar 2014 17:01
Seaside - thanks so much for this. I worked through it and with a tiny bit of trial and error I can finally access the Time Machine share.
"
"
by Litil»09 Apr 2014 19:13
Hi,
First of all, thanks for this howto Seaside, very useful for newbie people like me
My OSX is Lion (10.7.5) can I use this configuration procedure in my system?
Thanks
"
"
by TomDS»14 Aug 2014 19:56
I tried all the above on my OSX 10.9.4 but no luck ... i get the below message after a minute or so ""Connecting"" :
There was a problem connecting to the server “TimeMachineNAS”.
The server may not exist or it is unavailable at this time. Check the server name or IP address, check your network connection, and then try again.
I do however see the Time Machine volume under the Shared section in finder ...
What could be wrong ?
"
"
by mooblie»15 Aug 2014 15:18
Works for me on OS X 10.9.4. Have you definitely got this set up?:
Attachment dead(Hiji56)
"
"
by valdbob»29 Dec 2014 11:47
Hi,
I can't see in my Web GUI the last two field (Automatic disk discovery &amp; Automatic disk discovery mode). I See only the field Auxiliary Parameters.
I use the release NAS4Free 9.3.0.2 (revision 1213) x64-embedded.
Do you know if there is some other configuration necessary to obtain this field in the Web Gui?
My iMac in this configuration was unable to discovery disk for Timemachine backup.
Any suggestion?
Thank
"
"
by chiller»06 Jul 2015 18:15
Nice How to.
In the Timemachine settings I can select the ""Rewind Time"" but I can't connect.
There always comes a pop up:
Error by connecting to Rewind Time""
The server may not exist or is currently unavailable . Check the server name or IP address and the network connection, then try again .""
In the Finder I can see Rewind time, too. But when i click on the button connect, there comes a pop up ""connection failed""
Sorry my english is not very well but I hope you could understand what my problem is.
"
"
by daoyama»06 Jul 2015 20:16
valdbob wrote:
I can't see in my Web GUI the last two field (Automatic disk discovery &amp; Automatic disk discovery mode). I See only the field Auxiliary Parameters.
I use the release NAS4Free 9.3.0.2 (revision 1213) x64-embedded.
That is replaced with simple checkbox:
20150707A.png
If your version does not have it, please consider to upgrade latest version.
"
"
by Parkcomm»11 Jul 2015 02:21
I've just upgraded to 10.1.0.2 - Prescience (revision 1702), from 9.3 and have found that time machine has stopped working.
Code: Select all

Code: Select all

Backup Disk Not Available
I've disabled/reenabled ""Time Machine support"" and restarted the AFP shares. And in the system advanced tab I have disabled/reenabled ""Enable Zeroconf/Bonjour to advertise services of this device"" to no avail.
Is this a bug in this BETA version? Anyone else se this problem?
"
"
by Parkcomm»11 Jul 2015 02:39
Just tried removing the disk in Preference/Time Machine on the mac and then reenabled (I did not try this because I thought i might blow away my old back ups)
Good news - all good now including keeping the old backups.
"
"
by bupban»07 Jan 2016 12:58
All
this is just to confirm that Time Machine Backup on 10.2.0.2 (Prester, rev 2235) works like a charm using the checkbox in the afp share setup.
On N4F 9.2 and 9.3 I had trouble with that and only got it up and running by using the instructions of the first post of this HOWTO from seaside on Nov 2012. And: All of my previous TM backups are still there. No loss of data. That's really cool.
Best, bupban
"