Monday, 19 August 2019

macos - Backup mounted drive of an image in Time Machine


As a mac user, I'm fairly new but I now find myself using disk images a lot (dmgs and sparseimages/bundles) to organise my files. Mostly encrypted images to hold my private stuff and other images that hold work files and "mission critical" files.


Now that I've got a new drive, I was trying to set up Time Machine. And I noticed that while it does indeed backup the image file itself (since these are stored on my home dir and it's not excluded), it doesn't backup the mount point itself (ie, /Volumes/MyImageDrive).


Is there no way to treat files in "Virtual drives" like any other files on HDD? Can I not use the Time machine cool/easy restore thing with files store on these drives?


Obviously, I can always restore the whole image. But I imagine trying to restore a few instances of a 30GB image just because I'm not quite sure where the change happened is going to be quite a pain.


Thanks



Answer



Time Machine doesn't back up the contents of mounted drives for a few reasons. For example:




  1. Mounted images can be very transient. If /Volumes/MyVolume exists on Monday but disappears on Tuesday, should it consider those files no longer existing and therefore remove from future backups? What if MyVolume comes back on Wednesday? Now it has to make a whole new copy of the contents again because it can't be sure the files are same ones it saw on Wednesday.




  2. What if yesterday it's mounted as /Volumes/MyVolume but today it's mounted as /Volumes/OurVolume. Does Time Machine have to make a whole duplicate copy?




  3. Backing up the contents of an image in addition to the image itself would waste space on your backup volume. You'd essentially be storing two copies of every file.




However, you can view past backups manually without taking the time to restore them. Browse to your Time Machine volume. For example, mine looks like this:


/Volumes/TimeMachine/Backups.backupdb/Hypatia/
2009-11-27-163215/
2009-12-11-075355/
....
2010-06-22-004524/
Hypatia/
Applications/
Developer/
Library/
System/
Users/

Rather than using the fancy Time Machine interface, if you are looking for a specific version of an image (or bundle) file, I suggest looking through those dated folders and mounting the backup copies of your image file directly. You can open the folder that contains the dated folders then use the window's Spotlight search to find every copy of the image you're looking for (i.e., search for "NameOfImage.sparsebundle").


This way, you save the step of copying it back to your system drive and overwriting whatever is there. It's a little more tedious than using Time Machine's goofy interface, but it gets the job done.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...