How to copy media off of an iPhone the hard way (using Linux)
I helped a family member upgrade to a newer iPhone and make some room so that the internal storage does not run out.
They had Nextcloud installed on the current phone, but due to limitations of the Nextcloud iOS app, the backups only take place if the app itself is open, meaning that we had hundreds of photos and videos that were not yet backed up.1
The network was slow and I was in a time crunch, so I opted to copy the media off of the phone by connecting the iPhone to my laptop over a Lightning cable. After entering the PIN on the phone again and approving the connection, I could see the iPhone in my file manager, but opening it would show nothing at all. This was very unusual as other iPhones I used in the past just worked on my laptop.
Rebooting the phone and connecting it again did nothing. Different known good Lightning cables did not improve things, either. Even a separate Windows 10 machine could not see any images, so it wasn’t a Linux thing.
Various Apple-related posts online were devoid of useful advice.2
I was not ready to give up just yet and I finally stumbled upon this Ask Ubuntu answer. This had potential, so I gave it a go, and I’m happy to report that it worked on my Fedora Linux machine!
These are the steps that I took. The commands need to be run in a terminal window.
Tested with Fedora Linux 40.
- install the necessary packages
- on Fedora, run
sudo dnf install -y ifuse libimobiledevice libimobiledevice-utils
- on Fedora, run
- connect your iPhone to your PC
- if your phone is not yet paired, then run
idevicepair pair
- if it’s already paired, verify the connection by running
idevicepair validate
- if your phone is not yet paired, then run
- mount your phone to an empty folder of your choice
- if an empty folder does not exist, run
mkdir ~/my-iphone
(use any folder name that you want) - to mount the phone, run
ifuse ~/my-iphone
- if an empty folder does not exist, run
- you can now browse your media via your file manager or terminal by navigating to
~/my-iphone
- photos and videos taken by the camera will be in the
DCIM
folder - other folders, such as
Photos
andDownloads
may also interest you - to make a full copy of your phone to a folder named
iphone-backup
, runcp -r ~/my-iphone ~/iphone-backup
- alternative way to create a full backup:
rsync -aAXv ~/my-iphone ~/iphone-backup
- photos and videos taken by the camera will be in the
- once you’re done, unmount the iPhone by running
umount ~/my-iphone
- it is now safe to disconnect your iPhone from the PC
If you have copied everything over and want to make more space on your phone using this method, then you need to delete
files under
the DCIM
folder and the cached thumbnails under the PhotoData
folder. iOS seems to generate thumbnails for
the photos you take and even if you delete all the actual photos off of the device, then the photo thumbnails will still
show up in the Photos app and elsewhere. This confused the hell out of me after I deleted the backed up photos off the phone the first time.
Alternatively, you can just delete files from the Photos app on the phone itself to avoid this nuance.
Linux has its flaws, but at least it provides you with the power and tools needed to get you out of tricky situations.
Subscribe to new posts via the RSS feed.
Not sure what RSS is, or how to get started? Check this guide!
You can reach me via e-mail or LinkedIn.
If you liked this post, consider sharing it!