User avatar
jaraeez
Posts: 20
Joined: Mon Jun 04, 2012 7:36 am

Re: Raspberry Pi as Time Machine for OSX Lion?

Sat Jul 07, 2012 11:35 pm

Have you created an user for samba on the pi?

Code: Select all

sudo smbpasswd -a <username>
then use this user for the credentials when connecting from windows.

urfankhaliq
Posts: 63
Joined: Wed Apr 11, 2012 4:06 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Sat Jul 07, 2012 11:50 pm

I used the existing pi user with this command

sudo smbpasswd -a pi


I have now noticed that I can browse to \\192.168.0.10 and i see the "PC" folder but I cannot get into the folder. I was previsouly trying to browse straight to \\192.168.0.10\pc and thats why it was always failing...

User avatar
jaraeez
Posts: 20
Joined: Mon Jun 04, 2012 7:36 am

Re: Raspberry Pi as Time Machine for OSX Lion?

Sun Jul 08, 2012 12:29 am

urfankhaliq wrote:I used the existing pi user with this command

sudo smbpasswd -a pi


I have now noticed that I can browse to \\192.168.0.10 and i see the "PC" folder but I cannot get into the folder. I was previsouly trying to browse straight to \\192.168.0.10\pc and thats why it was always failing...
Its probably a permissions issue. Take a look at my smb.conf & first copy yours

Code: Select all

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.org
then have a play (your smb file is quite different to mine).

urfankhaliq
Posts: 63
Joined: Wed Apr 11, 2012 4:06 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Sun Jul 08, 2012 12:33 am

can you point me where I should look in the smb.conf?

urfankhaliq
Posts: 63
Joined: Wed Apr 11, 2012 4:06 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Sun Jul 08, 2012 12:46 am

when I do a ls -l on the folder im sharing via samba i get the following (there is a test file in the folder)

root@raspberrypi:/mnt/pc# ls -l
total 0
-rwxrwxrwx 2 root root 0 Jul 7 11:38 This is a test file for the samba share.txt

User avatar
jaraeez
Posts: 20
Joined: Mon Jun 04, 2012 7:36 am

Re: Raspberry Pi as Time Machine for OSX Lion?

Sun Jul 08, 2012 1:19 am

urfankhaliq wrote:when I do a ls -l on the folder im sharing via samba i get the following (there is a test file in the folder)

root@raspberrypi:/mnt/pc# ls -l
total 0
-rwxrwxrwx 2 root root 0 Jul 7 11:38 This is a test file for the samba share.txt
That looks fine.

where you have

Code: Select all

[pc]
   comment = Shared Drive for PC
   path = /mnt/pc
     valid users = @users
     force group = users
     create mask = 0660
     directory mask = 0771
     read only = no
change it as a test to

Code: Select all

[pc]
   comment = Shared Drive for PC
   path = /mnt/pc
     browseable = yes
    read only = no
    guest ok = no
     force user = pi
     force group = pi
     create mask = 0664
     directory mask = 0755
     read only = no
The see how you go?

urfankhaliq
Posts: 63
Joined: Wed Apr 11, 2012 4:06 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Sun Jul 08, 2012 1:22 am

Thanks. Will do tomorrow n let u know. Had enough for now lol

urfankhaliq
Posts: 63
Joined: Wed Apr 11, 2012 4:06 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Sun Jul 08, 2012 2:21 pm

woo hoo it works!!!

Thanks for that.

now need to sort out the mac share!

urfankhaliq
Posts: 63
Joined: Wed Apr 11, 2012 4:06 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Sun Jul 08, 2012 7:30 pm

Hi ive just noticed that I can actually connect to the samba share from my macbook but time machine can not back up to it because it does not support the require afp protocols...

so i guess in this situation its best to have a seperate partition on the same disk for the macbook?

Also would the macbook be able to see this partition if I was to simply plug the hdd into the mac using usb just like I can see the ntfs partition on my pc if i plug the hdd into the pc?

Thanks for all the help!

urfankhaliq
Posts: 63
Joined: Wed Apr 11, 2012 4:06 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Sun Jul 08, 2012 9:51 pm

jaraeez wrote:
urfankhaliq wrote:Thanks ill take a look at that later today when im home.

With the Mac, where do i set or configure what drive the rasp pi shares out to the mac because obviously the connectivity is working as i can connect to the pi from the mac but the problem is that its connecting to the SD card instead of my external drive! lol
imho I recommend you start with the 'samba' config first it's much easier especially for a self confessed novice.

Having said that below are the files & relevant configs with regards to the 'time machine' for your reference.
I also remember having to install parted 'sudo apt-get install parted' as fdisk would not see my USB due to the size of partitions.

/etc/netatalk/AppleVolumes.default

Code: Select all

#~/                     "Home Directory"

/mnt/TimeMachine Backup allow:user1 cnidscheme:dbd options:usedots,upriv,tm
/mnt/MBP-TM Abu-BKup allow:user1 cnidscheme:dbd options:usedots,upriv,tm
/etc/netatalk/afpd.conf
Nothing entered here (although nearly all the sites regarding 'time machine - ubuntu' state differently)

/etc/avahi/services/afpd.service

Code: Select all

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=Xserve</txt-record>
</service>
</service-group>
/etc/default/netatalk

Code: Select all

#### Set which legacy daemons to run.
#### If you need AppleTalk, run atalkd.
#### papd, timelord and a2boot are dependent upon atalkd.
#ATALKD_RUN=no
#PAPD_RUN=no
#TIMELORD_RUN=no
#A2BOOT_RUN=no
CNID_METAD_RUN=yes
AFPD_RUN=yes
I also had to chmod both folders as 'time machine' on the mac would not backup (this is not very safe - you've been warned)

Code: Select all

sudo chmod 755 /mnt/MBP-TM/
sudo chmod 755 /mnt/TimeMachine/
& for the sake of completeness here is my fstab config

/etc/fstab

Code: Select all

proc            /proc           proc    defaults        0       0
/dev/mmcblk0p1  /boot           vfat    defaults        0       0
#/dev/mmcblk0p3  none            swap    sw              0       0

#Windows Backup
/dev/sda4 /mnt/WinBKups ntfs-3g defaults 0 0

#Time Machine Backups
/dev/sda3 /mnt/TimeMachine ext4 rw,errors=remount-ro,user_xattr,commit=0 0 0
/dev/sda2 /mnt/MBP-TM ext4 rw,errors=remount-ro,user_xattr,commit=0 0 0
As well as my /etc/auto.master config (which will auto mount the USB)

Code: Select all

+auto.master
/media/ /etc/auto.ext-usb --timeout=10,defaults,user,exec,uid=1000
Hope this helps..
OK so thanks for all your help so far. I thought I would give you an update...

Samba share works fine and i can see it from my pc and my mac

I then went on to install netatalk following my earlier posted link which completed successfully..

I have my pi configured as follows

/etc/netatalk/AppleVolumes.default

Code: Select all

/mnt/mac TimeMachine allow:user1 cnidscheme:cdb options:usedots,upriv,tm
Nothing in /etc/netatalk/afpd.conf but as you rightly mention, other sites for ubuntu have said one line needs to go in their..

/etc/avahi/services/afpd.service is identical to yours...

/etc/default/netatalk

Code: Select all

#### Set which daemons to run.
#### If you use AFP file server, run both cnid_metad and afpd.
CNID_METAD_RUN=yes
AFPD_RUN=yes
And finally my fstab

Code: Select all

proc            /proc           proc    defaults        0       0
/dev/mmcblk0p1  /boot           vfat    defaults        0       0
#/dev/mmcblk0p3  none            swap    sw              0       0
/dev/sda2       /mnt/pc         ntfs-3g defaults 0 0
/dev/sda3       /mnt/mac        ext4    defaults 0 0
Now after all of that, the windows PC is still OK connecting to the Samba share but the Mac can no longer connect to the samba share. I do get the raspberrypi showing up in finder on the side but when I click it to connect I get an error

"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."

Anything you can see I am doing wrong here?

Thanks :)

urfankhaliq
Posts: 63
Joined: Wed Apr 11, 2012 4:06 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Sun Jul 08, 2012 11:15 pm

Ive not edited the AppleVolumes.default to this

# Regular AFP share
/mnt/pc "PC" cnidscheme:dbd options:usedots,upriv

# Time machine share
/mnt/mac "TimeMachine" cnidscheme:dbd options:,tm allow:pi


and I can see PC and TimeMachine within the time machine app but when I try to connect to TimeMachine and enter pi and raspberry it says

"The version of the server you are trying to connect to is not supported. Please contact your system administrator to resolve the problem."

User avatar
jaraeez
Posts: 20
Joined: Mon Jun 04, 2012 7:36 am

Re: Raspberry Pi as Time Machine for OSX Lion?

Mon Jul 09, 2012 1:22 am

urfankhaliq wrote:Hi ive just noticed that I can actually connect to the samba share from my macbook but time machine can not back up to it because it does not support the require afp protocols...

so i guess in this situation its best to have a seperate partition on the same disk for the macbook?

Also would the macbook be able to see this partition if I was to simply plug the hdd into the mac using usb just like I can see the ntfs partition on my pc if i plug the hdd into the pc?

Thanks for all the help!
Did you install the deb file I listed or was it from the repo's?

Could you run

Code: Select all

dpkg -s netatalk | grep -i version
I have

Code: Select all

Version: 2.2.2-1
had issue with any other version I tried.

User avatar
jaraeez
Posts: 20
Joined: Mon Jun 04, 2012 7:36 am

Re: Raspberry Pi as Time Machine for OSX Lion?

Mon Jul 09, 2012 6:38 am

jaraeez wrote:
urfankhaliq wrote:Hi ive just noticed that I can actually connect to the samba share from my macbook but time machine can not back up to it because it does not support the require afp protocols...

so i guess in this situation its best to have a seperate partition on the same disk for the macbook?

Also would the macbook be able to see this partition if I was to simply plug the hdd into the mac using usb just like I can see the ntfs partition on my pc if i plug the hdd into the pc?

Thanks for all the help!
Did you install the deb file I listed or was it from the repo's?

Could you run

Code: Select all

dpkg -s netatalk | grep -i version
I have

Code: Select all

Version: 2.2.2-1
had issue with any other version I tried.
I've also noticed in your /etc/netatalk/AppleVolumes.default you have

Code: Select all

/mnt/mac TimeMachine allow:user1 cnidscheme:cdb options:usedots,upriv,tm
you need to change the user1 for pi

urfankhaliq
Posts: 63
Joined: Wed Apr 11, 2012 4:06 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Mon Jul 09, 2012 8:49 am

Hi I have the same version of netatalk as you and with the user pi i still have the same problem :(


Ihave also added

# Regular AFP share
/mnt/pc "PC" cnidscheme:dbd options:usedots,upriv

which allows me to connect to the samba share but only as guest If i add "allow:pi" to the end then i cant connect at all even as guest

User avatar
jaraeez
Posts: 20
Joined: Mon Jun 04, 2012 7:36 am

Re: Raspberry Pi as Time Machine for OSX Lion?

Tue Jul 10, 2012 4:11 am

Not quite sure.

Take a look at the my post where I included config files etc. & then see what's different with yours.

Here's a run down of what I did to get timemachine working (roughly)

Code: Select all

2: copy over netatalk_2.2.2-1_armel.deb to Raspberry Pi

3: sudo apt-get install build-essential, sudo apt-get install checkinstal1
4: sudo apt-get install libdb4.8-dev libcrack2-dev libssl-dev libgcrypt11-dev
5: sudo apt-get install libdb5.1
6: sudo dpkg -i netatalk_2.2.2-1_armel.deb
7: sudo apt-get install avahi-daemon
7a: sudo mkdir /mnt/TimeMachine
    sudo mkdir /mnt/MBP-TM
7b: sudo chown user1:user1 /mnt/TimeMachine/
    sudo chown user1:user1 /mnt/MBP-TM/
7c: sudo chmod 755 /mnt/MBP-TM/
    sudo chmod 755 /mnt/TimeMachine/ 
8: sudo nano /etc/netatalk/AppleVolumes.default

#~/                     "Home Directory"

/mnt/TimeMachine Backup allow:user1 time cnidscheme:dbd options:usedots,upriv,tm
/mnt/MBP-TM Abu-BKup allow:user1 cnidscheme:dbd options:usedots,upriv,tm

9: sudo nano /etc/default/netatalk
  add CNID_METAD_RUN=yes AFPD_RUN=yes

10: sudo nano /etc/avahi/services/afpd.service

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=Xserve</txt-record>
</service>
</service-group>

11: sudo service netatalk restart && sudo service avahi-daemon restart
I'm afraid that's as far as I can go!

urfankhaliq
Posts: 63
Joined: Wed Apr 11, 2012 4:06 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Thu Jul 19, 2012 12:26 am

hi I need some help again folks

I have upgraded the pi to wheezy and started again with samba

I installed samba and configured the smb.conf

i can see the share in windows but cannot connect to it, when i enter my username and password it wont accept it

i think it has something to do with the fact that i cannot do a sudo smbpasswd -a pi because it says
bash: smbpasswd: command not found

any ideas?


urfankhaliq
Posts: 63
Joined: Wed Apr 11, 2012 4:06 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Thu Jul 19, 2012 1:06 am

OK its just one issue after another now!!

Now I can connect and write to the samba share from my windows and my MAC but for some reason instead of 2TB of space I only have 187.5MB of space showing!???

User avatar
zenatuz
Posts: 9
Joined: Sun Jan 29, 2012 12:43 pm
Contact: Website

Re: Raspberry Pi as Time Machine for OSX Lion?

Tue Jul 24, 2012 8:11 pm

Wow, good idea. It will be my first project using Pi.
--
Renato R.Batista
Network/System Administrator and tecnology lover.

mariodeng
Posts: 2
Joined: Wed Jul 25, 2012 7:29 am

Re: Raspberry Pi as Time Machine for OSX Lion?

Wed Jul 25, 2012 7:34 am

Hey everyone,

since yesterday evening I am running the RPI with netatalk and using it as time machine backup.
But it seems to be incredible slow. It took the whole night to back up 40GB of data.

Does anyone of you have experience with the speed of backing up und restoring?
I mean, where could be the bootleneck? USB, Wifi, Router...?

Cheers Mario

urfankhaliq
Posts: 63
Joined: Wed Apr 11, 2012 4:06 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Wed Jul 25, 2012 3:11 pm

Hi yes mine is also not very fast but I guess for what the Pi is, its acceptable!

To give you an idea, I have just completed my Windows Backup to a Samba share and the backup size was 70GB and it took 10 and a half hours!

Similary when I did my first TimeMachine backup it was about 40GB and it was estimated to take about 4-5 hours but I just left it overnight to complete.

Once the initial big backups are done, the incrementals for TimeMachine are relatively quick and you dont notice it working.

mariodeng
Posts: 2
Joined: Wed Jul 25, 2012 7:29 am

Re: Raspberry Pi as Time Machine for OSX Lion?

Thu Jul 26, 2012 5:24 am

Hey there!

urfankhaliq, thanks for the hint and sharing your experience.
Yesterday I updated the firmware, my arch linux and all modules, but I had no time for testing. Will let you when I got fully backup ;)

And yes, the first time machine backup is a slomo.

urfankhaliq
Posts: 63
Joined: Wed Apr 11, 2012 4:06 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Wed Aug 01, 2012 2:54 pm

Does anyone know if upgrading to mountain lion would break the time machine setup on the pi?

Upgrading from snow leapord to lion broke time machine for lots of people

User avatar
jaraeez
Posts: 20
Joined: Mon Jun 04, 2012 7:36 am

Re: Raspberry Pi as Time Machine for OSX Lion?

Sun Aug 26, 2012 1:19 pm

All still working here where one of my machines is running 10.8.1 & backing up to the pi just fine - ymmv

jasper199069
Posts: 12
Joined: Fri Sep 21, 2012 6:19 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Fri Sep 21, 2012 6:38 pm

Hi All,

It works for me :)
I will also post my config files here.
On my raspberry i am using a custom version on debian (forgot where i found it) and using Mac OSX 10.8.2 Mountain Lion

The only problem i am facing is that when i want to backup that my raspberry is hanging. no more ping, ssh or anything. it has 512MB swap memory and 237MB interal memory, the hard disk i am backing up to is a 2TB external usb drive successfully mounted.

here are the config files:
/etc/netatalk/afpd.conf

Code: Select all

# this is the bottom line and the only uncommented line
- -tcp -noddp -uamlist uams_dhx.so,uams_dhx2.so -savepassword -setuplog "default log_info /var/log/afpd.log"
I have created the user jasper and added the password (simple one for testing)

/etc/netatalk/AppleVolumes.default

Code: Select all

# also the bottom and uncommented line
/mnt/hdd/apple/timemachine "Time Machine" allow:jasper cnidscheme:dbd options:usedots,upriv,tm
/etc/avahi/services/afpd.service

Code: Select all

<service-group>
        <name replace-wildcards=.yes.>%h</name>
        <service>
                <type>_afpovertcp._tcp</type>
                <port>548</port>
        </service>
        <service>
                <type>_device-info._tcp</type>
                <port>0</port>
                <txt-record>model=Xserve</txt-record>
        </service>
</service-group>
Then i go to my macbook and i search for the time machine servers and it pops up without any other commands ran on my macbook.
I connect without problems and then i start the backup (here is where the problems start)
I see my memory being drained away till approximately 3MB and then my raspberry just hangs. ssh hangs, no ping nothing. my only option is to poweroff :'( so i thought lets give it swap. i know from debian that when too little memory is present it will kill processes to clear memory.

but unfortunately i guess it isn't using my swap.

In every case i hope my config files will help you :)

I hope some people can help me with my problem too ;)

Return to “Other projects”

Who is online

Users browsing this forum: No registered users and 16 guests