SETTINGS
Appearance
Language
About

Settings

Select a category to the left.

Appearance

Theme

Light or dark? Choose how the site looks to you by clicking an image below.

Light Dark AMOLED

Language

Preferred Language

All content on blog.claranguyen.me is originally in UK English. However, if content exists in your preferred language, it will display as that instead. Feel free to choose that below. This will require a page refresh to take effect.

About

"blog.claranguyen.me" details

Domain Name: claranguyen.me
Site Version: 1.0.0
Last Updated: 2020/12/29
My dramatic adventure backing up a stubborn iPhone
Friday, November 26, 2021

Introduction

I used to be an iPhone user back in the days of the iPhone 4S. Back in those days, I would jailbreak my phone, which gave me full file system access. Backing up my device was very simple, without even needing iTunes. Since then, I've moved to Android. I've just used microSD cards to store everything, as well as have a script to run rsync to copy my data to my personal server. It's nice. But that's just my own backup solution.

I thought I never had to deal with iPhones again. Not like they were a problem. I just enjoy Android much more. The rest of my family uses iPhone. Yes, in our family group chat, I'm the sole reason they have green text message bubbles instead of blue. It's funny. Well, now that the iPhone 13 is out, they are upgrading to that and want to have their data backed up.

Side note, this is a bit more of a rant or silly story than an actual post. It's almost straight from my diary. It'll be shorter than a usual post, and more dramatic. Gotta make it fun somehow.

So, what's the problem?

Turns out, one of the iPhones had an issue which locked it out of being accessed by Mac OS's Photos and Image Capture apps. It would hang endlessly on "preparing", or show a lock icon. It would also glitch and say "please unlock iPhone" even though the phone was already unlocked. Even after a few minutes of waiting, the message of "Photos in the Camera Roll are being prepared" will just disappear and no photos will be there. There was a whole mess of issues. Of course, I wouldn't be typing this blog post if the solution was searchable on Google. Trust me, I searched.

Personal MacBook Pro Other Family Member's MacBook Pro

Thankfully, there are some options to us:

Obviously, we'll try the first option. Let's not do something stupid unless we have to.

I had no idea what I was getting into

Before the choice of backing up through iTunes, I wanted to get the actual camera roll dumped as proper JPG files. I mean as in IMG_0001.JPG, IMG_0002.JPG, etc. An iTunes backup stores files as a bunch of sub-directories based on a SHA-1 hash of their names and paths internally. There are tools out there to let you view an iTunes backup without this mangled mess, but I want show the steps I took before resorting to an iTunes backup. And even then, it was hell.

How an iTunes backup looks like on a MacBook Pro.

I juggled between 3 devices: an iMac, my personal MacBook Pro, and another family member's MacBook Pro.

  1. iMac - Photos and Image Capture apps fail. There is a lock icon that appears in Image Capture. It can't be undone. The iMac permanently has it stuck on "Please Wait. Preparing Camera Roll for Import". Photos simply shows no images to import.
  2. Personal MacBook Pro - Photos and Image Capture apps fail. There is a lock icon that appears and it also can't be undone.
  3. Another Family Member's MacBook Pro - Photos and Image Capture apps fail. There is a lock icon that appears and it can't be undone. Familiar story? At this point, I was considering an iTunes backup. This MacBook Pro is a 256 GB model. The iPhone is a 256 GB model. A backup of the iPhone on this laptop is impossible.
  4. Personal MacBook Pro - This has a 1 TB SSD. But iTunes can't be installed on this computer for some reason.
  5. iMac - This has a 1 TB SSD and has iTunes installed. This is the machine to back up data to.

Annoying, isn't it? It's about to get worse.

Backing up on the iMac

More roadblocks

I gave up on extracting proper JPGs. Time to do the iTunes backup on that iMac. Oh wait...

So close...

It is low on storage. Seeing as this is not my computer, I decided to not tamper with any files on there. Instead, I had a few spare 8 TB Western Digital Easystores from Black Friday 2017 lying around. So I plugged one in and boom. More storage... right?

Nope. iTunes does not allow you choose which drive to back up data to. It was trying to force a backup onto the root drive. Shit. I could have just moved some files onto that drive. But the other issue was that I genuinely couldn't tell what was taking up all of the space anyways. This wasn't my computer. I'd rather not tamper with it. I mean, I could have just temporarily moved over files, backed up the iPhone, then switch. But I had a better idea. I'm a Computer Scientist.

Thankfully, Mac OS is built on top of UNIX. It's time to cheat.

A simple hack, the symbolic link

Gotta make things sound dramatic. This is nothing special. You can trick the operating system into thinking a folder is in one spot when it's in another with a Symbolic Link. All this does is make a file that references to another file or directory. In other words, I can make the iTunes backup folder appear like it's on Mac OS's root drive, and it would believe it. But that folder would actually exist on the 8 TB backup drive mentioned earlier. This will trick iTunes into backing up the iPhone's data on the external drive.

On Mac OS, the iTunes Backup folder location is at: ~/Library/Application Support/Mobile Sync/Backup.

The 8 TB backup drive is mounted at: /Volumes/WD 8TB Ext.

Give the Mac OS terminal full system access in settings. Then open up the Terminal. Type in this command:

UNIX Command
ln -s '/Volumes/WD 8TB Ext/Backup' '~/Library/Application Support/MobileSync/'

Then, back up the iPhone via iTunes. Will it work?

Oh yes...

...It fucking worked. The backup is 216 GB. To my surprise, iTunes will not check if the drive has enough storage before trying to back up data. I thought that might be one more roadblock to overcome if they had a check in place. I was about fed up at this point anyways so I'm glad this adventure ended here.

...Except it wasn't over yet

Of course, there's always more bullshit. The following week after my family upgraded iPhones, they had some time before they had to trade in their older iPhones. That gave them time to back up their data. This post revolved around one family member. They were lucky. The upgrade was dramatic too. Two family members had bad SIM cards which meant that their new phones weren't assigned a phone number. They can't call anyone, and they can't text anyone. Though signal bars showed. So I wasn't sure what the deal was.

Yep, it isn't working lol.

Oh, and also another's old iPhone 7 got stuck in a boot loop and refused to resurrect. It was low on storage, so upgrading it to a new iOS version in an effort to fix it may be impossible. We are exploring options for it, so I may post a part 2 to this. We literally had 3 phones break in a single day. I've wasted enough time on it. Regarding the backing up issue, it's ironic how Apple's philosophy of "It just works" completely backfired. I just want to play Vanguard while there's a Double XP weekend. So I'll be doing that. Stay safe and back up your data. 👋

Oh, one more thing

Just for fun. The prompt was faked just so I can censor names and hashes. There are some jokes in the hashes if you can "reverse" them.

Text File (fake-prompt.txt)
******s-iMac:Backup ******$ pwd
/Volumes/WD 8TB Ext/Backup
******s-iMac:Backup ******$ ls -latr
total 32
drwxr-xr-x   9131 ******  staff   310454 May 18  2015 554a00faefa0fdd108ec0a07aa1ab431b262b6ea
drwxr-xr-x   3037 ******  staff   103258 Aug 13  2015 d0be2dc421be4fcd0172e5afceea3970e2f3d940
drwxr-xr-x    262 ******  staff     8908 Jul 12  2017 502ef1593d1a0caa166534b83e7e9cfcf5aebe0a
drwxr-xr-x  31006 ******  staff  1054204 Dec  5  2017 5929e58a5aa1fde36b80ecc26548c50423ddf943
drwxr-xr-x    263 ******  staff     8942 Nov 14 00:04 bcef7a046258082993759bade995b3ae8bee26c7
drwxrwxr-x     20 ******  staff      748 Nov 14 00:33 ..
-rw-r--r--@     1 ******  staff    14340 Nov 14 01:57 .DS_Store
drwxr-xr-x     11 ******  staff      374 Nov 25 23:10 .
******s-iMac:Backup ******$ du -sh bcef7a046258082993759bade995b3ae8bee26c7/
216G    bcef7a046258082993759bade995b3ae8bee26c7

Then, to make it have the appearance it did in the picture:

UNIX Command
clear; cat "fake-prompt.txt"; printf "******s-iMac:Backup ******$ "; read



Clara Nguyá»…n
Hi! I am a Vietnamese/Italian mix with a Master's Degree in Computer Science from UTK. I have been programming since I was 6 and love to write apps and tools to make people's lives easier. I also love to do photography and media production. Nice to meet you!


Blog Links
Post Archive
Affiliates/Cool People
Nigoli's Blog
Raas's Blog