14

I want to convert an existing Time Machine backup (on an external HDD, encrypted) to a read-only archival image.

I open Disk Utility and choose File » New Image » Image from Backup, which lets me choose the destination. The destination is an ExFAT file system.

The options are the default (read-only, unencrypted), and when I start the process, after a few seconds, I get this:

I haven't cancelled the operation myself — Disk Utility did it. What I've tried so far:

  • Choosing another output option (compressed or CD/DVD master, for example), but that didn't help.
  • Unmounting the volume before starting the process
  • Time Machine is off; no automatic backups are being created.
  • Copying the Backups.backupdb folder is impossible because it contains hard links that ExFAT cannot read, and Finder says "The volume is the wrong format for a backup."

The same problem has been discussed here without a resolution. What I do notice is that the partition is shown as a Time Machine disk. Could this cause any problems?

13
  • 1
    Did you turn off automatic Time Machine backups? Does the destination have to be an ExFAT-formatted volume?
    – IconDaemon
    Mar 21, 2019 at 11:50
  • Time Machine backups are off, yes (this is a new machine; it doesn't have backups enabled yet). I can't re-format the destination, and I don't have any other to test, unfortunately. Do you think that this could be the culprit?
    – slhck
    Mar 21, 2019 at 11:55
  • 1
    Possibly. I did some research which proved to be inconclusive. What's your reasoning behind needing to make a disk image of the Time Machine backup? I usually copy over an existing TM backup to a new external drive every two years or so, and retire the old drive. External USB HDs have gone down in price and up in reliability the past 5 years or so.
    – IconDaemon
    Mar 21, 2019 at 13:30
  • I want to archive the backup in the unlikely case that I need something from it. With this newly set up machine, I want to start the TM backup from scratch. By "copying over", you mean doing a 1:1 clone of the backup? I can't do that with the drives I have available, since I cannot re-format them. "Backup Apollo" is one partition – "Data" is the other. Both are on the same physical drive. ExFAT partitions (the one called "Disky" on the second drive) can't be resized, so I'm out of luck there. Hence the idea to create an image.
    – slhck
    Mar 21, 2019 at 13:48
  • I don't know for certain, but I'm wondering about how an image on an ExFAT drive is going to handle hard-links - that's the usual fail-point when copying TM drives.
    – Tetsujin
    Mar 21, 2019 at 16:40

3 Answers 3

13

For some reason, this only works via command line using the hdiutil tool.

First, open Disk Utility, right click the source drive (the Time Machine volume), and choose Unmount. Do not eject it!

Then, open a Terminal window, and enter:

diskutil list

You should be able to locate your volume. For example, in my case, it was listed as follows:

/dev/disk5 (external, virtual):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS Backup Apollo          +500.0 GB   disk5
                                 Logical Volume on disk4s2
                                 8577521E-D394-45A0-BB7E-26F9E19C1FE7
                                 Unlocked Encrypted

Copy the identifier, /dev/disk5. This is what we want to convert into an image.

We now need a path where we can store the image. For example, you can choose a mounted volume. In the following example, /Volumes/Data/Backup.dmg is the target file. Change it according to your needs.

Then, run the following command, which will create an encrypted image of the source volume /dev/disk5 (the old Time Machine backup) under the new file /Volumes/Data/Backup.dmg:

sudo hdiutil create /Volumes/Data/Backup.dmg -encryption -stdinpass -srcdevice /dev/disk5

This will first ask for your sudo password (the password of your current user account).

After entering the sudo password, you will be asked for an encryption password.

This takes a while, but it works:

Elapsed Time:  7h 15m 52.227s
File size: 293424025874 bytes, Checksum: CRC32 $753B4175
Sectors processed: 976562496, 968645649 compressed
Speed: 18.1Mbytes/sec
Savings: 41.3%
created: /Volumes/Data/Backup.dmg

For more options, run man hdiutil.

5
  • Don't forget use root for that
    – user338403
    Jul 10, 2019 at 23:47
  • Still not allowed to. Perhaps it is because my Time Machine backup is encrypted? Apr 9, 2022 at 15:05
  • @ThorbjørnRavnAndersen No, in my case those were all encrypted, too.
    – slhck
    Apr 9, 2022 at 18:16
  • hdiutil: create failed - Operation not permitted Nov 24, 2023 at 23:00
  • @DmitryShvedov: I got that same permissions error, and fixed it by adapting the instructions from Matt Sims’ answer — go to System Preferences > Security & Privacy > Privacy, find Full Disk Access in the list on the left, and then add Terminal to the list of apps with full disk access. Having done that, the commandline instructions from this answer worked.
    – PLL
    Jan 26 at 11:11
11

This could be an OSX security issue. Try this:

  1. Open System Preferences
  2. Choose Security & Privacy and then click on the Privacy tab
  3. Select Full Disk Access from the list on the left
  4. If necessary, click the padlock icon to allow changes
  5. Click the + icon and add Disk Utility to the list of apps by browsing to it (/System/Applications/Utilities/Disk Utility.app)
  6. Re-open Disk Utility and try making the image again.
3
  • 1
    This allowed Disk Utility to access my Time Machine USB disk. Apr 9, 2022 at 15:08
  • This should be the accepted answer!
    – Sai
    Aug 30, 2022 at 9:09
  • Also had to "eject" the disk that I was making the image from. Otherwise it complained that "resource busy". Nov 24, 2023 at 23:08
0

Try this: create a fresh (or use an existing) USB stick from the Mojave installer, boot from it, and use Disk Utility to make the image. You'll need to provide the Time Machine decryption password to mount the drive -- but since you're not in macOS proper, you should have an easier time of things.

You'll need to get a Mojave installer before you make the USB, assuming you don't already have one on the system hard drive. Easiest way is to download from the App Store, which also ensures you have the latest point release.

Making a bootable USB stick from the installer is pretty straightforward -- the macOS bootable USB instructions are good if you're handy with Terminal, or use Install Disk Creator if you're more of a GUI person.

Also -- and this might be a red herring but I'm curious -- the volume you're trying to back up in Disk Utility is a logical volume. Click View on the top left, then Show All Devices, then try backing up the drive itself rather than the volume. Does that provide anything of use?

7
  • Thanks for the hint. I don't have a stick here from which I could boot, but I'll see if I can get my hands on one. You're inferring some kind of issue with the live system accessing the drive, preventing Disk Utility from correctly (un)mounting it? I also can't make an image of the entire source drive, since it contains two partitions (a huge ExFAT one, and the smaller Time Machine volume).
    – slhck
    Mar 21, 2019 at 17:14
  • I'm not certain what might be causing the issue in the live macOS, but booting from a clean USB will have far fewer background processes running and possibly fewer things to interfere with your backup -- so consider it anecdotal from my experiences rather than absolutely knowing what's up. An 8GB USB stick should be fine for a bootable drive. I tend to assign a USB stick to each Mac I have and leave it nearby, it's useful for troubleshooting. They're cheap enough these days to have a few laying around. Mar 21, 2019 at 17:18
  • I have one more thing to try. Unmounted the backup volume, now running hdiutil create /Volumes/Data/Backup.dmg -srcdevice /dev/disk5.
    – slhck
    Mar 21, 2019 at 17:21
  • Be aware your OP image shows the Time Machine volume as /dev/disk3, not /dev/disk5, have you rebooted? Mar 21, 2019 at 17:26
  • I have umounted some other drives in the meantime. Good observation!
    – slhck
    Mar 21, 2019 at 17:31

You must log in to answer this question.

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