Configuring Debian / Ubuntu as Mac Storage

    I have been a user of Apple products for a long time. An old MacBook completely copes with the tasks that are assigned to it. Mostly of course entertaining. But recently, there was not enough space on a 40 gigabyte hard drive. And finally, my hands were combing out to set up my home server as storage. I worked on ftp for some time, but it was not convenient. It was decided to finally configure Appletalk, not for nothing that it is there and at the same time to tame TimeMachine to it :-)

    Configuring all this can be divided into several stages:
    1. Installing Appletalk
    2. Configuring AppleTalk
    3. Installing Avahi
    4. Configuring Avahi
    5. Configuring TimeMachine

    Well, let's get started.

    1. Install AppleTalk



    Netatalk package - opensource implementation of the Appletalk service (AFP server). Mac OS X requires encryption support, but the standard build of this package does not support encryption. Therefore, you must rebuild this package.

    Here you can download the already correctly assembled package, and go to step 2.

    But it is better to assemble it yourself by executing these commands:
    Download the raw materials: Install what you need for the assembly: Collect: And, if everything is in order, install: Everything is not as scary as it seemed . So that when updating the system the correct package is not replaced by a newer but not the correct one, we put the block on the netatalk package: That's it, now let's move on to the configuration.
    cd /tmp
    sudo apt-get build-dep netatalk
    sudo apt-get source netatalk
    cd netatalk-2*


    sudo apt-get install cracklib2-dev fakeroot libssl-dev

    sudo DEB_BUILD_OPTIONS=ssl
    sudo export DEB_BUILD_OPTIONS
    sudo dpkg-buildpackage -rfakeroot


    sudo dpkg -i ../netatalk_2*.deb

    echo "netatalk hold" | sudo dpkg --set-selections


    2. Setting up AppleTalk



    First, you need to disable those services that are not needed to solve the current problem. We bring the section in the / etc / default / netatalk file to this form: Now the time has come for the main configuration file /etc/netatalk/afpd.conf and add this line below: Now let's move on to setting resources that will be shared via afp. This is configured in the file /etc/netatalk/AppleVolumes.default Line: Shares the folder / home / torrent / downloads under the name Torrent-Downloads for the username and for the guest user. Moreover, the Guest can only read from this folder. String: Shares a resource for TimeMachine. After editing the configs, it is worth restarting netatalk:
    ATALKD_RUN=no
    PAPD_RUN=no
    CNID_METAD_RUN=yes
    AFPD_RUN=yes
    TIMELORD_RUN=no
    A2BOOT_RUN=no



    - -transall -uamlist uams_randnum.so,uams_dhx2.so,uams_guest.so -nosavepassword -advertise_ssh



    /home/torrent/downloads "Torrent-Downloads" allow:username,nobody rolist:nobody cnidscheme:cdb options:usedots



    /home/username/TimeMachine "TimeMachine" allow:username1,username2 cnidscheme:cdb options:usedots,upriv



    sudo /etc/init.d/netatalk restart

    Avahi Installation


    After the above steps, you can, with the help of Finder, go to the shared resources. But each time it is not convenient to use this menu, you need to make the afp server visible in the Finder resources menu.
    For this, we needed Avahi. Avahi is a daemon that provides online services similar to Bonjour.

    Installing avahi is simple: In the /etc/nsswitch.conf file in the line starting with hosts, add mdns at the end, like this:
    sudo apt-get install avahi-daemon
    sudo apt-get install libnss-mdns



    hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns

    4. Configure Avahi


    Create a file /etc/avahi/services/afpd.service with the contents: And restart avahi: Now the repository should appear in the left sidebar Finder.



    %h

    _afpovertcp._tcp
    548


    _device-info._tcp
    0
    model=Xserve




    sudo /etc/init.d/avahi-daemon restart



    5. Configuring TimeMachine


    In the poppy console, you need to run the command:
    defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

    That's all.

    Also popular now: