I haven’t posted in a while, because I honestly didn’t run into any problem worth posting about. But backing up my wife’s iPhone turned out to be an odyssey I’d rather forget. All I want was copying all pictures that are physically on her phone to my server and some backup hard drives. My first attempt was on her MacBook and I quickly gave up, because I simply don’t speak Mac. Accepting defeat and moving on I grabbed my old Windows laptop and all seemed fine. I connected the iPhone, it showed up in the explorer, marked all the files to copy, CTRL-C, CTRL-V, and… it stopped with the quite famous “Device is Unreachable” error. Tried the usual remedy of changing the photo setting “Transfer to Mac or PC” from “Automatic” to “Keep Originals”:
And… now Windows didn’t mount the iPhone anymore. I tried all remedies for that problem to no avail. So back to my good old Linux, which I should’ve done from the start. But I currently don’t have a Linux laptop, and I was too lazy to go upstairs.
But I digress, I plugged my phone into my server and to my surprise it didn’t show up. Took a while to figure out that I simply forgot to connect the USB connectors on the front of the case when I built it. Note to self, FIX THAT! So, using longer cable, I plugged it into the back and yeah, I have an iPhone connected. But of course I was not done yet, first, you have to trust the computer on the iPhone. So just click “Trust on the dialog “Trust This Computer?” after you plug in your phone.
A quick check with lsusb offered me this line for the brand new iPhone 14 Pro Max:
Bus 001 Device 007: ID 05ac:12a8 Apple, Inc. iPhone5/5C/5S/6
Now I saw that I missed some tools to pair and mount the iPhone file system. A quick install fixed that for me (you also might want to install usbmuxd if it is not already installed):
apt install libimobiledevice6 libimobiledevice-utils ifuse
I think it goes without saying that you need to be root to do this or use sudo. This will install the libraries and tools to manage the pairing the FUSE file system for the iPhone. Let’s start pairing. If the phone is connected, then this command should pair it as your user:
idevicepair pair
Should, because three things can happen. First. you see a success message with an ID. You’re in luck and can move forward. Second, you see the error message “Could not pair with the device because a passcode is set”. This is an odd one, because I got this message. Then I just reran the command and it paired just fine. Not sure if that will always work, but it worked for me. And lastly, you can get the message “No device found, is it plugged in?”. If you get this one check with lsusb if it is really connected. This is how I found out, that my front USB connectors are were not connected.
The next step is to finally mount a file system. You can use an existing directory like /mnt or create one in /media/iphone. Either way, as a user you can then start mounting the iPhone (to /mnt in this example):
ifuse /mnt
All the phones files are at your disposal, or to be precise, all Apple allows you access to. The pictures and videos are in the DCIM folder nicely arranged.
To unmount your phone you can simply use:
fusermount -u /mnt
Doing this was not only faster, but also more stable than trying to use Windows or the Mac. Either way, happy iPhoning on your Linux box.
And a final reminder. To make matters interesting, problems with pairing and mounting might arise or come back after an iOS update. So be vigilant and look out for a new version of libimobiledvice, libplist and libusbmuxd.