You are here

Why Your Aperture-Migrated Photos Library Isn’t Really Doubling Disk Space

PhotoJoseph's picture
April 21, 2015 - 9:00pm

If you've migrated an iPhoto or Aperture library to Photos, you may have noticed that you now have two libraries of the same size. If you started with a large Aperture library, let's say 100 GB, then doubling that up can be a Bad Thing™, especially if you've got limited disk space (i.e. a 512 GB SSD drive). But as it turns out, that extra 100 GB library isn't actually taking up 100 GB of space.

Through the magic of “hard links”, OS X only has one copy of the file, but believes that it has two. The original is still in your Aperture library, and a “hard link” version sits in the Photos library. It's kind of like an alias (which is a “soft link”), except that as far as the OS is concerned, both files actually exist.

From Aperture to Photos; 7.23 GB to 7.63 GB… but not really!

You can see in the sample libraries above that the Aperture library weighed in at 7.23 GB, and the Photos version of it is at 7.63 GB. A little increase makes sense as it's generated new previews. The good news is, it's not really taking up 7.63 GB of extra space.

(Side note… notice the name of the libraries. My Aperture library was called “From Aperture to Photos”, because this was a test library I built specifically for this. The transitioned one is called “From Photos to Photos”. I have to assume that in the migration, the word “Aperture” was simply changed to “Photos”. For most people that'd simply mean “Aperture Library” becomes “Photos Library”, but it's still funny. It reminds me of my most-retweeted tweet ever, about OS X swapping “MB” (as in Megabytes) for “Mercedes-Benz” in a dialog.)

All well and good, but my question to Apple was “what happens if you delete the Aperture library??”. Turns out, nothing bad.

I'm no engineer so frankly this is all voodoo to me, but you can safely delete one without hurting the other. And believe me, I tried. I created a series of scenarios of migrating an Aperture library to Photos, then copying one or the other to different drives, moving (not copying then deleting original) to different drives, unplugging external drives, etc., and no matter what, the Photos library survived. 

If you'd like to know more about hard links and even more info on what happens when things in the two libraries change, there's a great post on sixcolors.com, “The (hard) link between Photos and iPhoto” by Jason Snell that covers it all.

Level:
Intermediate
App:
Apple Photos for macOS
Platform:
macOS
Author:
PhotoJoseph
Hard links are nothing very special. They are actually really simple. The first thing to understand is, that a file is not identified by its path and filename, but simply by a unique number - the id of the “inode”. Every file in the filesystem has such an id independent from the filename or the path it is in. But where does the filename come from? A directory is by itself just identified through the id of its inode. You can imagine a directory as a special file that contains a list of filename to inode mappings. And this is how hard links work: you can have multiple entries on one directory or in different directories who map to the same inode (file or directory). Since inodes are only unique within one volume, the hard links only work within a volume. If you copy or move a hard linked file to another volume - it will be a copy. Actually copying a hard linked file is nothing special at all - you could imagine any file as being “hard linked” here is no difference between a hard linked file or a normal file it is stored the same. It is just the same inode id used another time. A symbolic link works different - the filesystem stores the pathname of the file and identifies it as a symbolic link - every access to this link gets resolved to the then current inode at his pathname. This way symbolic links also work over volume boundaries. So if you delete you Aperture library, anything that happens is you deleting some directory entries. Since the Inodes of the RAW files are still in the Photos directory entries they are still available. If you delete the Photos library too, the inodes are still available, but the space can get reused any time later. You could reconstruct a directory from those “lost inodes” with a rescue tool like Disk Warrior.

I believe this is the same way Time machine manages storage. Certainly a better process than doubling the amount of space taken.

Is anyone else seeing different photo counts in Photos app in different devices? At the bottom of the Moments screen on my iMac, it shows the total number of photos I have in Photos app. In my case, thats 11,617.  On my MacBook Pro, iPad, and iPhone, each shows a total of 11,419 photos in Photos app. When I switch to All Photos in Albums view on my iMac it shows a different total (11,630). On my other devices, the All Photos in Album View shows the same as in the total in my collections view of 11,419. All devices are up to date and done syncing.  In other words, my iPhone, iPad and MBP seem to all agree on the totals, but my iMac does not.

To further confuse things, accessing my photos on the web via iCloud shows a total of 11,431. I assume this is some kind of bug that will be worked out in a future update, but curious if anyone else is seeing this?

I have iCloud Photo Library turned on on all devices and syncing generally seems to be working as I add/delete photos. I’m also getting random duplicates, but I read elsewhere that is a known bug.

Thanks for any insights! 

BopperZip

Jochen is right-on-the-money. Files are just blocks of space on disk. An inode points to the first block. Large files consume multiple blocks that are chained together and may be spread out all over your disk. Does anyone remember defragmenting Windows disks? That basically reshuffled all the blocks associated with files so that all the blocks for a single file were as close together as possible.

Files are pointers / mappings of file names to inodes. A directory is a special file that is a lost of these mappings. You can have multiple “files” map to the same inode. These are your hard links. The filesystem keeps track of how many mappings there are. Only when the last mapping is deleted does the actual space on disk get freed up. So if Aperture and Photos have separate mappings (hard links) to the exact same inodes on disk and you choose to delete your Aperture library, the filesystem knows there is still one mapping from the Photos library and so it keeps the inode and blocks of storage active. If you later delete the Photos library, the filesystem will see that this is the only mapping to the disk blocks and thus will free up the entire chain of blocks associated with all the files in the Photos library.

This web page gives a visual that helps illustrate soft links vs hard links.

http://www.geekride.com/hard-link-vs-soft-link/

Exactly! And for any of those who are not interested in the details: It works, it is nothing arcane and there is no particular risk or anything to consider with it.

This may seem a naive question, but it is something that I hadn’t previously considered until I read this Tip. If I migrate a managed Aperture library to Capture One or one of the other options available will that also behave in this way? Or will I need 871 GB, the size of my Aperture Library, of free space on my HD?

Stephen

The Lightroom importer has an Option screen where you can choose to leave your originals in their current location. By default, Lightroom will make a copy of all of your images and thus consume twice the space. If you choose the option to leave images in their current location, Lightroom will reference the same copy as Aperture. All Lightroom catalogs are Referenced (as opposed to Managed) so it is wise to relocate your originals outside your Aperture library before using the Lightroom importer unless you choose to let Lightroom make a second copy of your images.

Capture One doesn't give you a choice. It defaults to referencing the Aperture originals in their current location, regardless of whether your library is Managed or Referenced. If you import a managed library into Capture One, Capture One will refer to the originals where they live inside the Aperture library. As with Lightroom it is recommended to relocate your originals outside the library (move Managed images to a Referenced location) before using the Capture One importer.

The difference between Capture One Catalogs and Lightroom Catalogs is that Capture One supports both Referenced and “Stored” Catalogs (“Managed” in Aperture). Lightroom only supports Referenced Catalogs.

[ UPDATE ] Now that I have upgraded to Lightroom CC (Lightroom 6), the Options screen has more clarification about leaving originals in their current location. Managed images will still be copied. The Option screen explicitly says to select the option to leave REFERENCED images in their current location, and that Managed files will still be copied. This is a very important clarification if you are using the Lightroom importer to import Aperture libraries. Look at the last section of this screenshot.

It’s also worth noting that Aperture –> Photos is the only transition taking advantage of these “hard links”, meaning if anything *is* being referenced in the Aperture library, and you delete that, it’s gone.

@PhotoJoseph
— Have you signed up for the mailing list?

Thanks for the replies; I think I understand them. I am not planning on moving from Aperture just yet, so I will come back to this, and changing from a Managed to a Referenced Library when I do.

Stephen

You may login with either your assigned username or your e-mail address.
Passwords are case-sensitive - Forgot your password?