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?

slhck
  • 2,274
  • 1
    Did you turn off automatic Time Machine backups? Does the destination have to be an ExFAT-formatted volume? – IconDaemon Mar 21 '19 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 '19 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 '19 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 '19 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 '19 at 16:40
  • @Tetsujin Note that I'm not trying to do a 1:1 copy of the files or partition. The exported image should just be a regular, unencrypted .dmg file (an Apple Disk Image) containing the original data in a HFS+ partition. So the ExFAT system wouldn't see these hard links. I'll see if I can get hdiutil to create the image, or print some more specific errors. – slhck Mar 21 '19 at 17:08
  • but TM is chock-full of hard-links. The usual fail point is that structures attempt to copy every link as an original & rapidly run out of room. idk enough about it to have an actual answer though, I'm just speculating, sorry. – Tetsujin Mar 21 '19 at 17:12
  • Copying over: you can use Finder to drag the Backups.backupdb folder from a current backup drive to a new backup drive and use this existing Time Machine backup going forward on the new disk. – IconDaemon Mar 21 '19 at 17:56
  • @IconDaemon That doesn't work, since the target is ExFAT, and Finder says, "The volume is the wrong format for a backup.". – slhck Mar 22 '19 at 07:00
  • I don't think you can use an ExFAT drive as a Time Machine backup volume! – IconDaemon Mar 22 '19 at 12:00
  • @IconDaemon I am not trying to. I am trying to archive the backup as a read-only image, as stated in the beginning of my question. – slhck Mar 22 '19 at 12:02
  • So you Finder-dragged the Backups.backupdb folder to the ExFAT drive? I'm confused, then. How are the three external volumes, Backup Apollo, Disky, and Data, formatted? I'm assuming that Backup Apollo is the TM volume which must be formatted in Mac OS Extended (Journaled) or (Case-sensitive, Journaled) or Xsan formats. – IconDaemon Mar 22 '19 at 13:42
  • @IconDaemon Yes, I dragged it only based on your suggestion. Due to the target being ExFAT, this doesn't work (I'm actually not surprised). Disky and Data are ExFAT. Backup Apollo is the encrypted HFS+ volume. I managed to image the backup now using hdiutil, see my answer below. – slhck Mar 22 '19 at 14:31

3 Answers3

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.

slhck
  • 2,274
10

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.
Matt Sims
  • 201
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?

  • 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 '19 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.

    – Pete Cooper Mar 21 '19 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 '19 at 17:21
  • Be aware your OP image shows the Time Machine volume as /dev/disk3, not /dev/disk5, have you rebooted? – Pete Cooper Mar 21 '19 at 17:26
  • I have umounted some other drives in the meantime. Good observation! – slhck Mar 21 '19 at 17:31
  • Hm. hdiutil: create failed - Input/output error. I'll try one more thing, then I'll buy a pen drive. – slhck Mar 22 '19 at 06:59
  • I got it working. Please see my answer in which I use hdiutil. – slhck Mar 22 '19 at 14:31