Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:user-guide:services:netatalk_configuration [2018/02/20 21:14] – ↷ Links adapted because of a move operation docs:guide-user:services:nas:netatalk_configuration [2024/09/14 00:46] (current) – [Basic File Share Configuration (Time Machine Server)] Removed workaround for posix permission errors, as it is fixed in current release netatalk - 3.2.5 ticomonster
Line 1: Line 1:
-====== AFP Netatalk share configuration (aka Apple Time Machine)======+====== AFP Netatalk share configuration (Apple Time Machine) ======
 Netatalk is an OpenSource software package, that can be used to turn a *NIX machine into an extremely high-performance and reliable file server for Macintosh computers. Using Netatalk's AFP 3.3 compliant file-server leads to significantly higher transmission speeds compared with Macs accessing a server via SaMBa/NFS while providing clients with the best possible user experience (full support for Macintosh metadata, flawlessly supporting mixed environments of classic Mac OS and OS X clients) Netatalk is an OpenSource software package, that can be used to turn a *NIX machine into an extremely high-performance and reliable file server for Macintosh computers. Using Netatalk's AFP 3.3 compliant file-server leads to significantly higher transmission speeds compared with Macs accessing a server via SaMBa/NFS while providing clients with the best possible user experience (full support for Macintosh metadata, flawlessly supporting mixed environments of classic Mac OS and OS X clients)
  
Line 5: Line 5:
  
 In order for this guide to work you will need to meet the following prerequisites: In order for this guide to work you will need to meet the following prerequisites:
-  * [[docs:user-guide:storage:usb-drives|Setup storage device with Ext4 filesystem]] +  * [[docs:guide-user:storage:usb-drives|Setup storage device with Ext4 filesystem]] 
-  * [[docs:user-guide:storage:fstab_configuration|Configuration Fstab for automatic storage mount]]+  * [[docs:guide-user:storage:fstab|Configuration Fstab for automatic storage mount]]
  
 ==== Package Installation ==== ==== Package Installation ====
Line 12: Line 12:
  
 ==== Optional Package Installation ==== ==== Optional Package Installation ====
-These packages are optional although recommend. nano will make editing text files super easy and the shadow packages make user and group managment a breeze, otherwise you'll have to manually edit user, group and password files by hand. The downside these packages will use precious space on your root partition. If your working with limited space consider using [[docs:user-guide:additional-software:extroot_configuration|extroot]].+These packages are optional although recommend. nano will make editing text files super easy and the shadow packages make user and group managment a breeze, otherwise you'll have to manually edit user, group and password files by hand. The downside these packages will use precious space on your root partition. If your working with limited space consider using [[docs:guide-user:additional-software:extroot_configuration|extroot]].
  
   opkg update && opkg install nano shadow-groupadd shadow-groupmod shadow-useradd shadow-usermod   opkg update && opkg install nano shadow-groupadd shadow-groupmod shadow-useradd shadow-usermod
 +
 ==== Available Netatalk Features ==== ==== Available Netatalk Features ====
 Many of the Netatalk goodies such as Spotlight search, Zeroconfig, ACL and LDAP support have been disabled. That was probably a wise decision to save space and provide a broader range of hardware support. The good news Time Machine support is available. With a simple command ''afpd -V'' we can check what features have been compiled into Netatalk.  Many of the Netatalk goodies such as Spotlight search, Zeroconfig, ACL and LDAP support have been disabled. That was probably a wise decision to save space and provide a broader range of hardware support. The good news Time Machine support is available. With a simple command ''afpd -V'' we can check what features have been compiled into Netatalk. 
Line 51: Line 52:
 Server messages path: /var/netatalk/msg/ Server messages path: /var/netatalk/msg/
 </code> </code>
 +
 ==== Basic File Share Configuration (Time Machine Server) ==== ==== Basic File Share Configuration (Time Machine Server) ====
- <WRAP center round todo 90%> +The afp.conf file contains all AFP specific configurations and AFP volume definitionsLet's edit ours with ''nano /etc/afp.conf'' and setup our Time Machine Server; we'll be using the nano text editor in this tutorialNetatalk has a lot of great features not covered in this //guide//. Make sure to checkout the documentation for more Time Machine options and other possible AFP uses. [[http://netatalk.sourceforge.net/3.0/htmldocs/afp.conf.5.html]] 
-The current Netatalk package ''(netatalk - 3.1.10-1)'' has minor posix permission issues. + 
-</WRAP> +log file = /var/log/afpd.log 
-Use the following ''chmod'' commands to fix this bug. +For initial configuration, it's good to check the log file. 
-  chmod 644 /etc/afp.conf + 
-  chmod 644 /etc/extmap.conf+afp interfaces = br-lan 
 +In case you have multiple interfaces. Select the one, which you want to use for listening. 
 + 
 +vol size limit = size in MiB (V) 
 +Useful for Time Machine: limits the reported volume size, thus preventing Time Machine from using the whole real disk space for backup. Example: "vol size limit = 1000" would limit the reported disk space to 1 GB. IMPORTANT: This is an approximated calculation taking into account the contents of Time Machine sparsebundle images. Therefor you MUST NOT use this volume to store other content when using this option, because it would NOT be accounted. The calculation works by reading the band size from the Info.plist XML file of the sparsebundle, reading the bands/ directory counting the number of band files, and then multiplying one with the other.
  
  
-The afp.conf file contains all AFP specific configurations and AFP volume definitions. Let's edit ours with ''nano /etc/afp.conf'' and setup our Time Machine Server; we'll be using the nano text editor in this tutorial. Netatalk has a lot of great features not covered in this //guide//. Make sure to checkout the documentation for more Time Machine options and other possible AFP uses. [[http://netatalk.sourceforge.net/3.0/htmldocs/afp.conf.5.html]] 
  
 <code> <code>
 ; ;
 ; Netatalk 3.x configuration file ; Netatalk 3.x configuration file
-;+ 
 + 
 +[Global] 
 +; Global server settings 
 +log file = /var/log/afpd.log 
 +afp interfaces = br-lan
  
 [Backups] [Backups]
-     path = /mnt/sdb1/Backups +path = /mnt/sdb1/Backups 
-     time machine = yes +time machine = yes 
-     vol size limit = 250000 +vol size limit = 250000  
-     valid users = @users+valid users = @users
 </code> </code>
 +
 +Don't forget to restart the daemon with ''/etc/init.d/afpd restart''.
 +
 ==== Avahi-daemon Configuration ==== ==== Avahi-daemon Configuration ====
 The default avahi-daemon configuration ''/etc/avahi/avahi-daemon.conf'' works perfect with stable LEDE 17.01.0+ and no chages are required. The default avahi-daemon configuration ''/etc/avahi/avahi-daemon.conf'' works perfect with stable LEDE 17.01.0+ and no chages are required.
Line 106: Line 119:
 rlimit-nproc=3 rlimit-nproc=3
 </code> </code>
 +
 +By default Avahi daemon requires running dbus. Start the dbus with command ''/etc/init.d/dbus start'' in case it's not running. Or disable it with ''enable-dbus=no''.
 +Start the Avahi daemon with command ''/etc/init.d/avahi-daemon start''.
  
 :!: Learn about other configuration options here [[https://github.com/lathiat/avahi]] :!: Learn about other configuration options here [[https://github.com/lathiat/avahi]]
 +
 ==== Zeroconf Advertising ==== ==== Zeroconf Advertising ====
 The LEDE implementation of Netatalk was not compiled with Zeroconf support; so we must advertise the required afpovertcp, device-info, and adisk text-record properties manually. We previously installed avahi-daemon (via avahi-utils) for exactly this purpose. Let's create a service file ''nano /etc/avahi/services/afp.service'' using the template below. The LEDE implementation of Netatalk was not compiled with Zeroconf support; so we must advertise the required afpovertcp, device-info, and adisk text-record properties manually. We previously installed avahi-daemon (via avahi-utils) for exactly this purpose. Let's create a service file ''nano /etc/avahi/services/afp.service'' using the template below.
Line 139: Line 156:
  
 :!: ''adVN=Backups'' should match the virtual volume name of your ''timemachine = YES'' share from ''/etc/afp.conf''. If you used my example settings above; leave this set to ''Backups''. Most online guides use //"TimeMachine"// however //"Backups"// is more traditional since it's the default when using macOS Server or Time Capsule; although it realy dosen't matter what you call it, as long as they both match. :!: ''adVN=Backups'' should match the virtual volume name of your ''timemachine = YES'' share from ''/etc/afp.conf''. If you used my example settings above; leave this set to ''Backups''. Most online guides use //"TimeMachine"// however //"Backups"// is more traditional since it's the default when using macOS Server or Time Capsule; although it realy dosen't matter what you call it, as long as they both match.
 +
 +Don't forget to restart the daemons after changing the configuration.
  
 **Some helpful links** **Some helpful links**
  
-[[https://guidgenerator.com]] +  * [[https://guidgenerator.com]] 
-[[http://www.freeformatter.com/xml-formatter.html]] +  [[https://www.freeformatter.com/xml-formatter.html]] 
-[[http://netatalk.sourceforge.net/wiki/index.php/Bonjour_record_adisk_adVF_values]]+  [[http://netatalk.sourceforge.net/wiki/index.php/Bonjour_record_adisk_adVF_values]] 
 ==== User and Group Management ==== ==== User and Group Management ====
 In this section we'll create two (2) new users on the LEDE system for file sharing purposes. Create as many or as little as you like, the principles are the same. We'll also accomplish the following: In this section we'll create two (2) new users on the LEDE system for file sharing purposes. Create as many or as little as you like, the principles are the same. We'll also accomplish the following:
Line 178: Line 198:
   root@LEDE:~# grep users /etc/group   root@LEDE:~# grep users /etc/group
   users:x:100:mrengles,anne,brian   users:x:100:mrengles,anne,brian
-==== Preserving Configuration on Firmware Upgrade ==== 
  
-FIXME I'm not sure if this section is required.+==== Preserving Configuration on Firmware Upgrade ====
  
 The default LEDE firmware upgrade procedure might not backup some of our configuration files. That would be a horrible waste of hard work. The default LEDE firmware upgrade procedure might not backup some of our configuration files. That would be a horrible waste of hard work.
  
-Add them to the list of custom backup files at ''/etc/sysupgrade.conf'' with ''echo'' and the command line:+Add them to the list of custom backup files at ''/lib/upgrade/keep.d/'' as follows:
  
 <code> <code>
-echo '/etc/afp.conf ' >> /etc/sysupgrade.conf +echo '/etc/afp.conf ' >> /lib/upgrade/keep.d/afp 
-echo '/etc/avahi/ ' >> /etc/sysupgrade.conf +echo '/etc/avahi/ ' >> /lib/upgrade/keep.d/afp 
-echo '/etc/extmap.conf ' >> /etc/sysupgrade.conf +echo '/etc/extmap.conf ' >> /lib/upgrade/keep.d/afp 
-echo '/home/ ' >> /etc/sysupgrade.conf +echo '/home/ ' >> /lib/upgrade/keep.d/afp 
-echo '/var/netatalk/>> /etc/sysupgrade.conf+echo '/var/netatalk/ ' /lib/upgrade/keep.d/afp 
 +</code> 
 + 
 +You can verify the setting by the following command: 
 +<code> 
 +sysupgrade -l
 </code> </code>
  
Line 204: Line 228:
 </code> </code>
  
-For more information, please check the [[docs:user-guide:installation:sysupgrade.cli|Upgrading LEDE from the Command Line]]+For more information, please check the [[docs:guide-user:installation:sysupgrade.cli|Upgrading LEDE from the Command Line]] 
 ==== Setup Time Machine on macOS ==== ==== Setup Time Machine on macOS ====
 Settting up Time Machine on the Mac is a very simple process: Settting up Time Machine on the Mac is a very simple process:
Line 216: Line 241:
  
 ==== Final Thoughts ==== ==== Final Thoughts ====
-If you have questions, post them in the LEDE Project Forum so that myslef and others can respond. [[https://forum.lede-project.org]]+If you have questions, post them in the OpenWrt Forum so that myself and others can respond. [[https://forum.openwrt.org]]
  
 Please update this user guide if you have a better way of doing things or notice typos and errors. :-) Please update this user guide if you have a better way of doing things or notice typos and errors. :-)
  • Last modified: 2024/09/14 00:46
  • by ticomonster