5

So I've got this MB Air (Mojave 14.1 -all updates applied-) at work and thought I would try backing it up using Time Machine to an old PC running Windows Server 2012 (All updates also applied) and I go through the setup procedure:

  1. Create a Sparse Bundle image (tried HFS+ & APFS images)
  2. Copy image to previously set up Windows share with correct permissions and login saved to the macOS keychain
  3. Mount image from the Windows share and verify I can write to it.
  4. Run terminal command to set Time Machine to use the mounted share as a destination:

sudo tmutil setdestination /Volumes/MBAir

And I get an error

The backup destination could not be set

After much Googling where a lot of answers pop up from AskDifferent none of them seem to have this particular issue using macOS Mojave.

Pretty sure I have the correct options for the sparse bundle selected. I tried both HFS+ and APFS format on the sparsebundle. And once it is mounted on the desktop on the Mac I can put files into the sparse bundle, so it is writable.

Wondering if anyone has any experience with this?

=== I tried the suggestion, "sudo tmutil setdestination smb://username@server/share -p instead, and allow tmutil to create it's own sparsebundle on the server." which returned an error. See comment below.

  • What if you change step 4. Instead of running the Terminal command, use the Time Machine GUI app and try to select your mounted volume from it. Oh, and Time Machine can’t backup to APFS volumes, so you are definitely going to have to use HFS+ for your sparsebundle. – user128998 Dec 13 '18 at 21:44
  • In step four you CAN'T select the volume in the GUI as it is not available to select as an available disk. And I tried APFS as an experiment as nothing else worked. I am aware that TM requires HFS+ – Steve Chambers Dec 14 '18 at 0:12
4

It turns out that when you create a sparse bundle disk image that resides on an APFS volume that it is ALWAYS formatted as APFS even if you specify the the format as HFS+ like this:

Disk Utility Sparse Image HFS+

I created a few of these (just to be sure) and each one failed as a Time machine Destination.

As @user128998 pointed out in his comment Time Machine relies on a feature of HFS+ to do it's job and will not work on one formatted as APFS.

I had assumed that disk utility was creating an HFS+ formatted sparsebundle because I had selected that option when creating the image, as shown in the screencap above.

In frustration I did a Get Info on the mounted sparseimage bundle and it showed as an APFS volume. Grr... So I deleted it and created another one and was very careful to NOT select APFS.

When I mounted that sparseimage it too showed as an APFS volume.

Opening Disk Utility I selected the mounted sparseimage volume and reformatted it as HFS+. The operation took longer than I expected (3 - 4 minutes) but it was successful. And this time when I ran the command

sudo tmutil setdestination /Volumes/MBAir

It worked!

So maybe I found a bug in Mojave (14.2) with disk images and/or sparsebundles. Or maybe it is expected behavior and I didn't know it, either way this can be marked as solved.

  • I was going to suggest double-checking the format in order to eliminate the possibility of user error, but I never would have guessed that Disk Utility was setting the wrong format. That is definitely a bug that should be reported to Apple. I’m glad you were able to figure it out, though. – user128998 Dec 14 '18 at 19:22
0

It may work if you set the backup via sudo tmutil setdestination -p smb://username@server/share instead, and allow tmutil to create it's own sparsebundle on the server. That way it will also know where to go to mount the sparsebundle in the future for backups when it is not already mounted

  • the password flag has to be right after "setdestination." Once I had that figured out I get the error, "Disk does not support Time Machine backups. (error 45)." If I include the sparsebundle name I get the same error, with or without the .sparsebundle extension and whether the image is mounted or not. Good idea though, thx! – Steve Chambers Dec 14 '18 at 16:12
  • 1
    Ah sorry bout that, I'll edit in case anyone else ever references here, didn't realise the order mattered for that one. Nice troubleshooting above by the way! – FreelancerJ Dec 15 '18 at 0:03
  • Yep. Disk Utility has a ton of ridiculous bugs like this. E.g., if you try create an ExFAT disk image with MBR, what you end up with (diskutil list) is NTFS. Don't expect a fix. – Geoff Nixon Dec 19 '18 at 9:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .