OSX Timemachine and Samba/Windows share
April 27, 2008
Hello all,
This is a tutorial on how to use OSX 10.5.2 time machine with a Linux Server/Windows Server/Windows Share. I hope that you have already set up your samba server or windows share on the network if not please read the Samba-Howto or windows file sharing. Also make certain that the shares have read write access! Now create a directory for each OSX computer that you will be using time machine on the server of windows share. I like to use the name of the OSX computer as the directory. My computer is called Hcomp ( you can change the name of your computer in OSX by going to System Preferences->Sharing) so I create a directory called Hcomp on my server.
Now we need to make it possible for timemachine to access our folders on our network. Open up Terminal (Finder->Applications->Utilities->Terminal) and enter in the command ‘defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1′.
It now should be possible for time machine to show the samba shares and other non OSX shares, but before we can use these shares we have to mount them. Open Finder and click on G0->Connect to server in the finder menubar at the top. For the Server enter in smb://yourusername@yourservername_or_ip/YourMacOSXComputerName. For example my server is called ‘Bob’ and my OSX computer name is called ‘Hcomp’. The username and password was set up by reading the samba or windows file sharing like. So lets say my my username to access the server is called ‘willy’ and the password is ‘wonka’. I would then enter in for the server address smb://willy@Bob/Hcomp then I would click on the connect button. The prompt will ask you for the password. Enter that in also.
Now open time machine (Finder->Applications->System Preferences->Time Machine) and click on change disk. If you have mounted the directory correctly it should show up when you click on Change Disk. Select the directory that you have just mounted. For me I would select Hcomp. Now turn time machine on and it will wait 2 minutes before running the back up. If it doesn’t backup automatically then make sure that the ‘Show time Machine status in the menu bar’ is checked and click on the round clock on the menu bar at the top of the OSX screen and click on back up now. it now should run for a little bit and give you an error saying that it cannot create image error. This message is fine because it created a file that we needed for this to work.
Next Open the terminal (Finder->Applications->Utilities->Terminal) and type in ‘ifconfig en0 | grep ether’. After hitting return the command should have given you something like ether 00:00:45:12:8a:91. Write this number down without the colons. Now you have to ask yourself how much space to allocate to the time machine back up. This depends on your setup and how much space you have on your server. I choose 100GB my mac only has 100GB partition. Now the next command will create the sparsebundle that time machine needs to make the whole thing work.
‘hdiutil create -size 100g -fs HFS+J -volname “TimeMachine Hcomp” Hcomp_000045128a91.sparsebundle’
Do not type this in to the terminal yet without modifying it to your settings. Basically after the ‘-size 100g’ is the maximum size that time machine can be. ‘-volname “TimeMachine Hcomp” can be changed to ‘-volname “anything that you want”‘ but the last part of the command is important. Remember you wrote down the numbers for your mac ether 00:00:45:12:8a:91.
Well for the last part replace ‘Hcomp with you computer name and _000045128a91 with the number that you wrote down.
The last paragraph might be confusing so here is another example.
Servername: Server
OSXComputerName: OSX
MAC: 00:00:1F:12:82:92
Size of time machine space : 200GB
command ‘hdiutil create -size 200g -fs HFS+J -volname “OSX Backup” OSX_00001F128292.sparsebundle’
Now you should a file like Hcomp_000045128a91.sparsebundle or OSX_00001F128292.sparsebundle on your computer. Now copy this file to the server by issuing ‘cp -R Hcomp_000045128a91.sparsebundle /Volumes/Hcomp’ or ‘cp -R OSX_00001F128292.sparsebundle /Volumes/OSX’ but remember to replace sparsebundle with your sparsebundle or you will get an error. If everything worked correctly click on the time machine button at the top (the round clock icon on the menu bar) and do backup now. It should run and will take at long time the first time you do this.
Happy travels through time.
Entry Filed under: OSX Tutorials, Uncategorized. Tags: OSX, Samba, Timemachine, Windows.
41 Comments Add your own
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed
1. Yet Another Blog» A&hellip | July 29, 2008 at 3:57 pm
[...] de pôr a funcionar no router), e tentar resolver o erro da Time Machine. Foi então que cheguei a este site, e depois de mais algumas hora, lá consegui fazer o [...]
2.
dlipton | September 3, 2008 at 6:11 pm
fantastic it worked for me!
very clear instructions thanks for sharing !
3.
bharris | September 20, 2008 at 11:49 am
Of all the asinine solutions for this problem out there on the web, yours is the only one that worked! Thank you for being so clear and straightforward.
4.
Hans | September 25, 2008 at 6:02 pm
Thanks for the excellent description, thanks to you I finally got it working! Only question I still have: how reliable is this setup, obviously not supported by Apple…
5.
hupio | September 26, 2008 at 3:36 am
Hm.. I don’t know how reliable this setup is, but hopefully apple won’t disable this feature.
I am glad that everyone has gotten it to work.
6.
Casey | September 26, 2008 at 4:04 am
Worked great thx! I can’t stress enough that the machine name part of the sparse bundle is super important
Odd thing is if you watch the share from the windows side when time machine initially sets it up it creates the files. I’m not sure what it is that time machine just isn’t able to get done on it’s own
7.
chuc | September 29, 2008 at 9:21 pm
I found that the -volname flag always caused an error, but that it was safe to drop it
Thanks!
8.
no | October 5, 2008 at 7:14 pm
On iMacs, it’s likely to be en1 that you need to get the MAC address for.
9.
Francis | October 7, 2008 at 5:10 pm
can you do a full restore from the install disk? i’m about to send out my macbook for repairs.
10.
Pär | October 8, 2008 at 7:48 am
Thanks for a great description! On my system (10.5.5) the -volname did not accept names containing a space i.e. “TM macpro” gave error ‘only one image can be created at a time’ while “TMmacpro” did the job.
11.
Sumin | October 16, 2008 at 9:56 am
It works. Thanks a lot!
12.
Darren Hoch | October 20, 2008 at 2:13 am
I finally got this to work. The -volume is not required. I tried to use a pre-existing samba share name and kept on getting “Unable to mount disk”. The absolute key here is that you create a samba share that is the same exact name as your mac computer. Also, regardless of whether you use en0 (wired) or en1 (wireless) the TM uses the ethernet address of en0. I am currently backing up my laptop over wireless after 10+ attempts.
13.
DI | October 31, 2008 at 8:19 pm
Please Place a DIGG button for this article!!!!!
14.
RichB | November 2, 2008 at 7:56 am
I can also confirm you need to specify en0, even if you’re not using it.
15.
Pete | November 4, 2008 at 6:04 pm
I’m on a Macbook Air. It only has the wireless interface on en0. I have tried all of the suggestions in this thread. My shared folder is a samba share on a linux system. The thing that made it work for me was dropping the -volname parameter, otherwise I was just getting errors about mounting. Thanks for this thread and all of the contributions in the comments!!!
16.
ritorujon | November 6, 2008 at 5:29 am
Looks great! Can’t wait to try it:-))) Thanx a lot!!!
17.
ritorujon | November 6, 2008 at 5:44 am
I’m just a little bit curious…What about right attributes? Are they backed up somehow on samba too, since Samba doesn’t have same ACL attributes as HFS+???
18.
Rik | November 29, 2008 at 5:02 pm
Hey man, after a few frustrating hours. I stepped away, googled and here I am. Thanks so much, it worked the 1st time for me.
19.
Jeff Dempsey | December 1, 2008 at 6:40 am
THANK YOU!!!
For some help on some of the ethernet MAC address and computer name, it may be helpful to have the Console open on, and set to LOG Database Queries > All Messages. Then you can see what Time Machine does when it tries (and fails) to create the original sparsebundle file. (It actually fails during the Journaling creation on my iMac)
For the user with a space in the computer name, use quotes around the filename, such as with mine, I did
hdiutil create -size 300g -fs HFS+J -volname “Time Machine Jeffs imac” “Jeffs imac_02204159eac1.sparsebundle”
and when copying, I just put quotes around the name as well…
Again, I would have the console (Applications -> Utilities -> Console open, and watch what Time Machine does. It makes Hupio’s AWESOME DIRECTIONS even better.
HTH,
Jeff
(I’ve had the iMac for a week now, and I LOVE it!, after 20 years of IBM-ness…
20.
Aaron | December 5, 2008 at 6:18 am
Regarding the “only one image can be created at a time” error, I found this was from copying and pasting the command from a wordpress blog that was using curly quotes. Swap those out for regular quotes and it’s fine.
21.
Jeremie | January 12, 2009 at 1:13 pm
On a MacBook Aluminum, specifying the mac adress of the ethernet rather than airport was necessary even though backups will be done over wireless.
22.
David Vannucci | January 13, 2009 at 7:46 am
When I create the image I get the error “hdiutil: create failed – No space left on device” Do I have to make the image size = free space remaining on the disk?
23.
bombcar | January 22, 2009 at 3:37 am
I was able to make a 500g volume on a 300g disk before copying it over (everything seems to be working fine) – are you sure you have .sparsebundle at the end correctly specified? Paste the exact command line used and check it.
24.
joe | January 24, 2009 at 3:51 am
Thanks for the great article.
Easy to follow and had 100% success with this.
Now I just have to upgrade my ubuntu box’s RAID5 so I’ll have enough room to let TM complete it’s backup!
25.
recon | January 24, 2009 at 4:13 am
Worked perfect after removing the -volname and ensuring the SMB share was named exactly the same as my Mac’s computer name.
MacBook Pro backing up to a Maxtor Central Asis 1T NAS
Thanks for this post and all the comments!
26. Doleans.net/blog » &hellip | January 25, 2009 at 6:17 pm
[...] mais qui nécessite normalement d’acheter le couteux boitier Apple. Autre solution ici [ http://hupio.wordpress.com/2008/04/27/osx-timemachine-and-sambawindows-share/ ] avec Samba qui marche chez moi. Si par contre j’ai le malheur de couper le réseau durant [...]
27.
rswillems | February 1, 2009 at 8:16 pm
Super! It worked fine with me, at least initially. Subsequent back-ups get the “the backup disk image could nog be mounted” error. Any solution?
28.
salvaro | February 8, 2009 at 6:19 pm
great! works fine for me. thanks for sharing.
29.
JF | February 10, 2009 at 7:59 pm
Thanks for this info. Been looking for a solution like this when Iscsi didn’t work.
30. How-To Make your Own FREE&hellip | February 10, 2009 at 8:16 pm
[...] I’ve been messing with iSCSI quite a bit lately. I thought I’d enable it on my Ubuntu Linux server, since I have quite a bit of storage space there. My goal was to connect our OSX computer via iSCSI in order to present a 100GB disk to it for use with Time Machine, as I didn’t have a spare external drive to use for this purpose. Try as I might, I just couldn’t get ISCSITARGET working reliably on Ubuntu. Ultimately I gave up. Luckily I stumbled acorss this great article on how to use SMB (windows) shares on your network as Time Machine disks. Read more here [...]
31.
stmo | February 16, 2009 at 7:46 pm
Thank you !!
First instruction i found that is really clear and working from a Mac OSX 10.5.6 to a Windows 7 computer.
32.
Steve | February 17, 2009 at 8:42 pm
Just tried this out and I’m currently making the time machine backup!
Finally putting my windows pc to some good use
Thanks for the great tutorial.
33.
Chris | March 14, 2009 at 12:07 am
How does this work with a full restore? Can you simply copy the time machine (sparse bundle) file(s) from the Windows box to an external drive and do a full restore that way?
34.
Morten | March 20, 2009 at 2:40 pm
Very nice guide; Time Machine is currently running the initial backup to my Ubuntu server.
I have suggestion which greatly simplifies the procedure:
While Time Machine tries to initialize the disk image at the server the first time, run ‘ls -l /Volumes/Hcomp’ (the mount point of the network share) several times until the disk image filename appears in the list.
This removes the complexity of getting the MAC address of the (correct) network card.
The filename create by Time Machine will look lik this: Hcomp_000045128a91.tmp.sparsebundle (notice the “tmp”), so just remove the “tmp.” part, and the filename can be used.
35.
Damian Black | March 20, 2009 at 7:27 pm
TimeMachine on windows has suddenly stopped working for me…
I get an error “The backup disk image could not be mounted”. I recreated a sparsebundle and got the same error. I am able to access the sparsebundle as a remote drive, but TimeMachine can no longer mount it.
Any ideas? Is this an update to OSX that is stopping this? One clue: it takes a long time before it tells me of the error. Same problem trying to enter the time machine for that file.
36.
Mark | April 12, 2009 at 1:21 pm
Genius!!! Just bought a secondhand older WD MyBook World raid drive and have struggled for days trying to get the sparsebundle created to the point of giving up until I found the commands on this site. Worked perfectly and Time Machine backing up with no problems as I’m typing this!!!
Thankyou so much.
37. SimpleBlog » Blog A&hellip | May 10, 2009 at 9:20 pm
[...] TimeMachine die eben eingerichtete Platte zu nutzen, lege ich Jedem das folgende Tutorial ans Herz: Timemachine and Samba, von [...]
38.
JJ | May 11, 2009 at 9:34 am
Following on what Jeff Dempsey added, while making first unsuccessfull attempt at backup, keep console open focused on ‘All messages’ and filter it by ’sparsebundle’. You should get message saying something like:
Creating disk image /Volumes/yourvolume/computer name_macaddress.sparsebundle
Point being is, on different application versions, time machine will try to make sparsebundle of different name, and what you need is file named EXACTLY like time machine tries to name it.
Thanks for the awesome tutorial
39.
Peperoca | May 20, 2009 at 12:36 am
What happens when the image fills up?
It worked perfectly (over wifi) until i reached the maximum space, now i can’t access the backup nor continue to back up.
Thanks
40.
Kriss | May 25, 2009 at 1:27 pm
black cyber-shot t200 digital still cameraanddigital cameras raw formatand17-22 samsung digital cameraandcamera digital dscp10 sony ukandhow to paint aluminum pool deckandhow to hack a mmoandhow to write a commentaryand
41.
Mathieu Guastella | May 25, 2009 at 2:24 pm
Great job !! I’m using a Mac still 1 day and having added RAM, upgraded to leopard and configured time machine… Really good hardware.. and software too.
But NEVER-SINCE so good and concrete community of users.. That doesn’t exist on PC..
Thanks !!
Mat