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

Re: Raspberry Pi as Time Machine for OSX Lion?

Wed Apr 11, 2012 5:10 pm

Hi sorry if this has been covered somewhere but I am unable to find anything using the search...

I am wondering whether it will be possible to use the Raspberry Pi as a "Time Machine" for my MacBook Pro running Lion?

I was hoping if its connected to the LAN and has a USB disk plugged in to it, will I be able to use that disk to backup my MacBook using Time Machine?

1337chaos
Posts: 12
Joined: Sat Mar 24, 2012 1:01 am

Re: Raspberry Pi as Time Machine for OSX Lion?

Wed Apr 11, 2012 6:11 pm

What's the point? Wouldnt it just be easier to plug the USB stick directly into your Mac?

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

Re: Raspberry Pi as Time Machine for OSX Lion?

Wed Apr 11, 2012 6:25 pm

The point is that this can be plugged into my wireless router and be accessible at all times wirelessly allowing the Mac to backup via "Time Machine" all the time rather then when I plug the USB drive into the Mac

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5097
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Raspberry Pi as Time Machine for OSX Lion?

Wed Apr 11, 2012 6:34 pm

I think the Pi is perfectly suited to this.

http://www.kremalicious.com/20.....ne-volume/

describes what needs to be done. There's a bit of compiling/configuring but I'm sure someone could produce an sdcard image that just boots up and works.

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

Re: Raspberry Pi as Time Machine for OSX Lion?

Wed Apr 11, 2012 7:11 pm

Thanks Dom, thats just the kind of thing I was looking for. Do you know if this would work with OSX Lion?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5097
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Raspberry Pi as Time Machine for OSX Lion?

Wed Apr 11, 2012 8:48 pm

I've not tried, but search the comments on the linked site, and there's some suggestions for getting it working with Lion.


BBsan2k
Posts: 28
Joined: Sat May 19, 2012 2:18 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Thu May 31, 2012 12:15 pm

Did you make any progress on that? I recently thought about using my pi as a timecapsule too, but after i set up netatalk I could connect because of an "incorrect Version"

jipiboily
Posts: 1
Joined: Sat Jun 23, 2012 4:57 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Sat Jun 23, 2012 5:00 pm

Was any progress made here? I think that would be just perfect once I get my Pi!

biophetik
Posts: 2
Joined: Mon Jun 25, 2012 6:07 am

Re: Raspberry Pi as Time Machine for OSX Lion?

Mon Jun 25, 2012 6:08 am

I'm definitely going to try and set this up. I also found this, which is related to previous posts.

http://archlinuxarm.org/support/guides/ ... me-machine

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

Re: Raspberry Pi as Time Machine for OSX Lion?

Thu Jun 28, 2012 8:24 pm

Sorry not updated in a while.

Im still waiting to recieve my pi! got my delivery confirmation so should be with me in the next few days!

Meanwhile has anyone got this working as a time capsule for OSX Lion?

Thanks

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

Re: Raspberry Pi as Time Machine for OSX Lion?

Sat Jun 30, 2012 4:59 pm

OK so im kind of half way there but im stuck and would appreciate some help!

Ive got my pi setup with debian squeeze, ive installed netatalk 2.2 using this

http://www.genthree.com/running-netatal ... an-squeeze

How can I now get an external hard drive to show up in my Mac in finder and in time machine?

I cant seem to mount and share a disk on my pi so that my mac can see it!?

biophetik
Posts: 2
Joined: Mon Jun 25, 2012 6:07 am

Re: Raspberry Pi as Time Machine for OSX Lion?

Sun Jul 01, 2012 5:49 pm

So far I've been able to configure it so I can view the drive, but can only mount it as read-only on raspi and can not mount it on os x. But here is what I've done so far. I've followed several links:

http://archlinuxarm.org/support/guides/ ... me-machine
http://www.mikepalmer.net/build-a-netat ... 0-squeeze/
http://www.tristanwaddington.com/2011/0 ... os-x-lion/

1. I installed netatak 2.2 via the link from urfankhaliq.
2. Create a directory for your mount point. I used
sudo mkdir /backup/TimeMachine

3. Edit "/etc/hosts.allow" and add this line:
afpd: ALL

4. Edit "/etc/netatalk/AppleVolumes.default" The bottom entry should look like:

# The line below sets some DEFAULT, starting with Netatalk 2.1.
:DEFAULT: options:upriv,usedots

# Time machine share
/backup/TimeMachine "TimeMachine" cnidscheme:dbd options:usedots,upriv,tm

# By default all users have access to their home directories.
# ~/ "Home Directory"
# End of File

- cnidscheme:dbd is newer and will give less corruption
- options:usedots,upriv,tm allows time machine support, AFP3 unix privileges, and hidden file support

5. Make sure "/etc/avahi/services/afpd.service" looks like this:
<?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>

- The last part allows your drive to be shown as an xserve icon. You can later change it and customize the icon.

6. Do this to mark the volume as a supported time machine share (it will add an empty file of that name in the folder):

sudo touch /backup/TimeMachine/.com.apple.timemachine.supported

7. Restart avahi and netatalk

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

8. On your os x device do this in terminal to allow unsigned time machine volumes:

sudo defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

9. You should be able to view the drive in your Shared networking tab on os x. On raspi I had to mount my usb drive to the /backup/TimeMachine

sudo mount -t hfsplus -o uid=username,gid=username /dev/sda2 /backup/TimeMachine/

username is your raspi username
/dev/sda2 is the usb drive
/backup/TimeMachine is your mount point

My problem is that it gives me this warning:

mount: warning: /backup/TimeMachine seems to be mounted read-only.

And I am unable to actually connect to the drive. I believe there is something wrong with the permissions or usernames.

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

Re: Raspberry Pi as Time Machine for OSX Lion?

Sun Jul 01, 2012 6:18 pm

Im considering just downgrading my Macbook to Snow Leapord instead :(

Josh.43
Posts: 12
Joined: Tue Jun 26, 2012 3:26 pm

Re: Raspberry Pi as Time Machine for OSX Lion?

Wed Jul 04, 2012 4:23 am

The question is: where is it mounted read only?

I didn't notice a specific OS choice in your posts, but basically:

If you ssh into the raspi, then:
-verify that you know the folder that the share is using
-check the permissions and ownership of the folder (ls -la)
-check the permissions and ownership of the contents
-attempt to create a new file with a name that could only have come from you
-connect to the network share through the finder (command-k, then afp://<ip or hostname of raspi>)
-verify that the file is there
-attempt to modify the file

By the end of this methodical list, a lead should have popped up and be ready to track down :)

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

Re: Raspberry Pi as Time Machine for OSX Lion?

Wed Jul 04, 2012 9:16 am

Ok thanks josh. I'll try that this weekend and let u know!

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

Re: Raspberry Pi as Time Machine for OSX Lion?

Thu Jul 05, 2012 8:44 am

I've been trying for a while to turn the pi into a backup NAS for both Win & Macs which I now have working.

I split a 1.5TB USB external HD into three partitions two ext4 & one ntfs. Installed Samba first & got that working quite quickly whereby a Windows 7 PC is backing up over the network.

Once the samba was working I took an image of the SD & moved on to installing netatalk & avahi & this was more of a pain :(

I first tried the link urfankhaliq posted (thanks) running-netatalk-2-2beta4-1-on-debian-squeeze & installed netatalk 2.2.1 (I think it was 2.2.1!) & after hours of messing with all appropriate config files 'nada'.

I decided to uninstall netatalk & found a deb file netatalk_2.2.2-1_armel.deb which I installed & after adjusting some config files was backing up my MBP 10.7.4 (phew!)

Next was a 10.6.8 mac which backed up fine as well so decided to try a 10.6.7 mac as well & that backed up fine (I say fine, TM kept hanging on 1.5GB, though eventually got that sorted).

So all in all I'm quite pleased (for now) with my $35 backup station...

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

Re: Raspberry Pi as Time Machine for OSX Lion?

Thu Jul 05, 2012 9:03 am

jaraeez wrote:I've been trying for a while to turn the pi into a backup NAS for both Win & Macs which I now have working.

I split a 1.5TB USB external HD into three partitions two ext4 & one ntfs. Installed Samba first & got that working quite quickly whereby a Windows 7 PC is backing up over the network.

Once the samba was working I took an image of the SD & moved on to installing netatalk & avahi & this was more of a pain :(

I first tried the link urfankhaliq posted (thanks) running-netatalk-2-2beta4-1-on-debian-squeeze & installed netatalk 2.2.1 (I think it was 2.2.1!) & after hours of messing with all appropriate config files 'nada'.

I decided to uninstall netatalk & found a deb file netatalk_2.2.2-1_armel.deb which I installed & after adjusting some config files was backing up my MBP 10.7.4 (phew!)

Next was a 10.6.8 mac which backed up fine as well so decided to try a 10.6.7 mac as well & that backed up fine (I say fine, TM kept hanging on 1.5GB, though eventually got that sorted).

So all in all I'm quite pleased (for now) with my $35 backup station...
Hi Jareez,

Can you please provide some further instructions as to what you did to actually get it to work? I really want the exact same setup (backup my macbook on Lion and Windows 7 PC) and cant get it to work yet!

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

Re: Raspberry Pi as Time Machine for OSX Lion?

Thu Jul 05, 2012 11:08 am

urfankhaliq wrote:Hi Jareez,

Can you please provide some further instructions as to what you did to actually get it to work? I really want the exact same setup (backup my macbook on Lion and Windows 7 PC) and cant get it to work yet!
Away at the moment though once I'm back home I'll try & help as much as I can.

For now can I suggest you first get samba working & your windows PC backing up, then let us know once you've done so?

I used this site http://www.simonthepiman.com/how_to_set ... server.php for the samba side though I did have to add a few steps which isn't mentioned there.

Good luck

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

Re: Raspberry Pi as Time Machine for OSX Lion?

Thu Jul 05, 2012 3:55 pm

Thanks ill look into that.

One question I had about your EXT4 partitions, I thought EXT4 was not compatible with Mac?

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

Re: Raspberry Pi as Time Machine for OSX Lion?

Fri Jul 06, 2012 12:10 am

OK so i followed the steps to install netatalk and avahi daemon and formatted my 2tb disk with a ntfs partition and an ext4 partition.

I also installed samba but for some reason i cant connect to the pi and map the drive on my windows pc but on my MBP I can now see the pi and also connect to the pi using the creds on the pi itself

I can also see the pi in Time Machine but its using the 8gb SD card rather then the external disk!?

Can anyone help me with this and give me some suggestions on what I should do to troubleshoot and resolve my issue?

Im a total newbie when it comes to linux and have very very basic knowledge. I dont really know what the commands mean and am just following instructoins online and somewhere along the line something has gone wrong :(

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

Re: Raspberry Pi as Time Machine for OSX Lion?

Fri Jul 06, 2012 5:27 am

urfankhaliq wrote:OK so i followed the steps to install netatalk and avahi daemon and formatted my 2tb disk with a ntfs partition and an ext4 partition.

I also installed samba but for some reason i cant connect to the pi and map the drive on my windows pc but on my MBP I can now see the pi and also connect to the pi using the creds on the pi itself

I can also see the pi in Time Machine but its using the 8gb SD card rather then the external disk!?

Can anyone help me with this and give me some suggestions on what I should do to troubleshoot and resolve my issue?

Im a total newbie when it comes to linux and have very very basic knowledge. I dont really know what the commands mean and am just following instructoins online and somewhere along the line something has gone wrong :(
First off I created an user on the pi for samba

Code: Select all

sudo smbpasswd -a <username>
& used that user for windows?

Make sure you can ping the pi from your windows box?
Firewall not blocking?
Do a

Code: Select all

ls /mnt/
or

Code: Select all

ls /media/
depending where you mounted the ntfs partition on your pi?

Here's my smb.conf for your reference (snippet)

Code: Select all

[global]
    ; General server settings
    netbios name = NAS
    server string =
    workgroup = WORKGROUP
    announce version = 5.0
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

    passdb backend = tdbsam
    security = user
    null passwords = true
    username map = /etc/samba/smbusers
    name resolve order = hosts wins bcast

    wins support = yes
[WinBKups]
    comment = Backups
    path = /mnt/WinBKups/
    browseable = yes
    read only = no
    guest ok = no
    create mask = 0644
    directory mask = 0755
    force user = user1
    force group = user1

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

Re: Raspberry Pi as Time Machine for OSX Lion?

Fri Jul 06, 2012 9:50 am

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

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 12:25 am

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

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:15 am

OK so I took your advice and concentrated on the samba share first and even that wont work!!

Not sure what im doing wrong but here are my configs

smb.conf

Code: Select all

[global]

   workgroup = WORKGROUP

security = user


;[homes]
   browseable = yes
   read only = no
   create mask = 0700
   directory mask = 0700

[pc]
	comment = Shared Drive for PC
	path = /mnt/pc
  	valid users = @users
  	force group = users
  	create mask = 0660
  	directory mask = 0771
  	read only = no
/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
/dev/sda2	/mnt/pc		ntfs		defaults	0	0
#/dev/sda3	/mnt/mac	ext4	defaults	0	0
I followed the steps from here

http://elinux.org/R-Pi_NAS

On my Windows 7 PC I can see raspberrypi and when i connect with my username pi and password raspberry it wont connect

I wonder if its something to do with the actual drive that im using and how its formatted?

When I do a fdisk -l all I see is this..

Code: Select all

Disk /dev/sda: 2000.4 GB, 2000409769984 bytes
255 heads, 63 sectors/track, 243202 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1      243203  1953525165+  ee  GPT

Disk /dev/sdb: 4026 MB, 4026531840 bytes
31 heads, 30 sectors/track, 8456 cylinders
Units = cylinders of 930 * 512 = 476160 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x87d403d9

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               4        8457     3930484    7  HPFS/NTFS
so the /dev/sdb1 is a small usb stick but the /dev/sda1 is the main external usb disk im using which is formatted with an ext4 partition and an ntfs partition which I cant see there?

When I do a blkid I can

Code: Select all

/dev/sda2: LABEL="PC" UUID="5FD5CF146EA31B6D" TYPE="ntfs" 
/dev/sda3: LABEL="MAC" UUID="eaeef996-f3a6-4b84-8ef9-ba03c97bcf5b" TYPE="ext4"
Im hoping with this information someone can see the problem why the samba share wont work?

Thanks in advance

Return to “Other projects”

Who is online

Users browsing this forum: No registered users and 19 guests