rajiv.sg

Rajiv M Ranganath's homepage

Configuring OS X Mountain Lion Time Machine to Work With CIFS (SMB) Share

In this post and its accompanying screencast I’ll share with you how to configure Mountain Lion (10.8.2) Time Machine to work with a CIFS (SMB) share.

Why supporting CIFS important?

CIFS is the most common file sharing protocol. Most NAS devices for backup and archiving provide reliable CIFS support. However, support for AFP, which has been Apple’s preferred way for communicating between Time Machine and Time Capsule has been marginal at best.

Therefore I’m hoping that this information will be useful to some of you. Also, if you think this post and screencast can be improved, please let me know.

Creating Sparsebundle

The first step would be to create a sparsebundle disk image. We’ll do this using the hdiutil command.

1
$ hdiutil create -size 750g -type SPARSEBUNDLE -fs "HFS+J" Macbook-Pro-Backup.sparsebundle 

Once the sparsebundle is created, you’ll need to re-partition the image and move it onto a CIFS share. This is explained in the following screencast (I recommend watching it at 480p resolution).


Configuring Time Machine

By this point, you should have created and moved your sparsebundle onto a CIFS share and mounted it from the network.

In this section, I’ll explain the steps involved in configuring Time Machine followed by a screencast demonstrating how everything works.

Start with diskutil list command, which will list all the mounted disks. Find the device identifier for CIFS Timemachine Backup volume. You should then enableOwnership for that device.

1
2
3
4
5
6
7
8
9
$ diskutil list                                                                                   

[...]

/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *805.3 GB   disk1
   1:                        EFI                         209.7 MB   disk1s1
   2:                  Apple_HFS CIFS Timemachine Backup 805.0 GB   disk1s2

In the above case, disk1s2 is the device identifier for CIFS Timemachine Backup volume. To enableOwnership for this disk we use sudo diskutil enableOwnership /dev/disk1s2 command.

1
2
3
$ sudo diskutil enableOwnership /dev/disk1s2                                                      
Password:
File system user/group ownership enabled

Verify that this worked, by using the command diskutil info disk1s2 and make sure that you see the line Owners: Enabled.

1
2
3
4
5
6
7
8
9
$ diskutil info disk1s2                                                                           

[...]

   File System Personality:  Journaled HFS+
   Type (Bundle):            hfs
   Name (User Visible):      Mac OS Extended (Journaled)
   Journal:                  Journal size 65536 KB at offset 0x1770000
   Owners:                   Enabled

The volume is now configured for use with Time Machine. Next step would be to tell Time Machine to use this volume for backup. We use sudo tmutil setdestination to do this.

1
2
$ sudo tmutil setdestination /Volumes/CIFS\ Timemachine\ Backup
Password:

To verify that Time Machine has accepted the backup destination, run the command tmutil destinationinfo

1
2
3
4
5
6
$ tmutil destinationinfo                                                                          
====================================================
Name          : Time Machine Backup
Kind          : Local
Mount Point   : /Volumes/Time Machine Backup
ID            : 9DA4C1ED-81BC-4CE3-A473-7F3B59C22986

Following screencast walks you through the remaining steps.


Comments