Overwrite an USB flash drive to update only the changed files

Joined
Mar 8, 2017
Messages
3
Reaction score
0
Points
1
Your Mac's Specs
iMac (21.5-inch, Mid 2011) macOS Sierra 10.12.3, iPad2, iPhone 7+
I have backed up my "Photos Library" on a USB flash drive. As i add photos , or organize Albums, People, etc. in the Photos App, I want o backup the changes on my flash drive. I insert the flash drive and drag snd drop, or"copy the Photos library file and attempt to paste it to the flash drive expecting a "Keep Both" or "Replace" drop down, but instead I get a warning that there is not enough room on the disk (I have 4.5 GB of photos on an 8GB flash drive). Or I get a warning that the file Photos library already exists on this disk.

I the only method i have found to work around is to use "Disk Utility" to erase the USB drive and re-download the whole 4.5GB Library onto the disk.

Is there a way to "overwrite" the USB drive without erasing it first?

iMac (Mid 2011) - macOS Sierra 10.12.3
 
M

MacInWin

Guest
Welcome to the forum.

In a word, no. When the OS writes a file, it writes to the free space on the drive until the write is complete and then updates the directory. That sequence assures that if you try to "update" a file and it fails for some reason, you still have the original in place. Otherwise, if the first step was to erase the old file and then write, if it failed you end up with nothing.

About the only suggestion I can make is to get at 16GB USB drive for the backup. That will give the OS room to copy the update completely before it deletes the old version. Prices aren't terribly high for 16GB (and higher) thumb drives today.
 
Joined
Jan 20, 2012
Messages
5,190
Reaction score
549
Points
113
Location
North Carolina
Your Mac's Specs
Air M2 ('22) OS 15.3; M3 iMac ('23) OS 15.3; iPad Pro; iPhone 14
I have backed up my "Photos Library" on a USB flash drive. As i add photos , or organize Albums, People, etc. in the Photos App, I want o backup the changes on my flash drive. I insert the flash drive and drag snd drop, or"copy the Photos library file and attempt to paste it to the flash drive expecting a "Keep Both" or "Replace" drop down, but instead I get a warning that there is not enough room on the disk (I have 4.5 GB of photos on an 8GB flash drive). Or I get a warning that the file Photos library already exists on this disk.

I the only method i have found to work around is to use "Disk Utility" to erase the USB drive and re-download the whole 4.5GB Library onto the disk.

Is there a way to "overwrite" the USB drive without erasing it first?.....

Hello Lilbang - your 'overwrite' question has already been answered by Jake - just have a few comments and questions. First, USB flash drives vs. SSDs & spinning drives are likely the least reliable way to backup important files; if you still want that option, my suggestion would be to have at least 2 USB drives (which are 'dirt cheap' these days) w/ duplicate or alternating backups, i.e. if one fails then you still have a backup. Second, are you also backing up your computer to an external HD(s) using TM (Time Machine) and /or cloning software (such as 'Carbon Copy Cloner') - you can recover your Photo Library w/ TM and even copy the folder elsewhere, as explained HERE - let us know. Dave :)
 
Joined
Apr 16, 2016
Messages
1,096
Reaction score
51
Points
48
Location
CT
Your Mac's Specs
MacBook Air Mid-2012 / iMac Retina 5K Late-2014
You could write a script to do this using rsync. You would "manage" your photo library in a directory structure on your local hard drive and then leverage rsync to mirror that structure onto the removable drive. If you're not comfortable on the command line, it would be a difficult exercise. If you do, however, have some familiarity with the command line and have even done a little scripting in a previous life, it should be fairly easy.

You'd essentially do a "local" sync of one directory to another with the source being the directory where you manage the original files and the destination being the USB drive after it's mounted to the filesystem. You can leverage a command line option to delete files from the destination if they are removed from the source (this covers you for actually removing files as well as moving a file from one directory to another).

If you want to read about the rsync tool, check here: http://www.tecmint.com/rsync-local-remote-file-synchronization-commands/


With regard to flash drives being comparatively unreliable, there's definitely some grains of salt to take that statement with (IMHO).

Making a backup is a good thing. Period.

Using ANY medium for that backup is a good thing. Period.

Time Machine or Carbon Copy as the "manager" of the backup has no additional value if the medium being backed up to is still the same unreliable storage that would be used without it.

In an ideal world, backups would be made to multiple locations at the same time, stored on different kinds of mediums, and at least one would be physically off site (in the cloud). Everything costs sometime. Money, time, effort, etc. Make your own decisions on just how priceless something is when you decide how, when, and where to back it up.
 
Joined
Oct 16, 2010
Messages
18,158
Reaction score
1,905
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2020 27" i9 5K nano iMac, 1TB(partitioned) SSD, GB, macOS 15.3.1 Sequoia
I have backed up my "Photos Library" on a USB flash drive. As i add photos , or organize Albums, People, etc. in the Photos App, I want o backup the changes on my flash drive.


Why not just use Carbon Copy Cloner and just select your "Photos Library" as the only thing to be backed up and using the preferences and options in CCC.






- Patrick
======
 
M

MacInWin

Guest
CCC will balk and report that it doesn't have enough room to do the clone. It, too, follows the OS protocol of write first, then update the directory.
Why not just use Carbon Copy Cloner and just select your "Photos Library" as the only thing to be backed up and using the preferences and options in CCC.






- Patrick
======
 

Slydude

Well-known member
Staff member
Moderator
Joined
Nov 15, 2009
Messages
17,928
Reaction score
1,352
Points
113
Location
North Louisiana, USA
Your Mac's Specs
M1 MacMini 16 GB - Sequoia, iPhone 14 Pro Max, 2015 iMac 16 GB Monterey
I suspect that many of the most widely used backup / cloning programs are going to follow the same procedure. It reduces the chance that an error results in loss of files.

In a word, no. When the OS writes a file, it writes to the free space on the drive until the write is complete and then updates the directory. That sequence assures that if you try to "update" a file and it fails for some reason, you still have the original in place. Otherwise, if the first step was to erase the old file and then write, if it failed you end up with nothing.

Thanks for that bit of info Jake. I'm not sure whether I didn't know that, never realized it, or had forgotten it. In either case that's good to know.
 
Joined
May 21, 2012
Messages
11,301
Reaction score
1,589
Points
113
Location
Southern New England
Your Mac's Specs
2024 M4 14" MBP, iPhone 16 Pro Max, Watch S7 & Watch S9, AirPods Pro 1
What is the format type of the USB disk drive?
 
Joined
Jan 20, 2012
Messages
5,190
Reaction score
549
Points
113
Location
North Carolina
Your Mac's Specs
Air M2 ('22) OS 15.3; M3 iMac ('23) OS 15.3; iPad Pro; iPhone 14
I suspect that many of the most widely used backup / cloning programs are going to follow the same procedure. It reduces the chance that an error results in loss of files.

In a word, no. When the OS writes a file, it writes to the free space on the drive until the write is complete and then updates the directory. That sequence assures that if you try to "update" a file and it fails for some reason, you still have the original in place. Otherwise, if the first step was to erase the old file and then write, if it failed you end up with nothing.

Thanks for that bit of info Jake. I'm not sure whether I didn't know that, never realized it, or had forgotten it. In either case that's good to know.

For those who may be interested in how a 'flash drive' works relative to writing & erasing files, I was reading this ARTICLE on TRIM a few weeks ago, which may be of interest - Dave :)
 
Joined
Oct 16, 2010
Messages
18,158
Reaction score
1,905
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2020 27" i9 5K nano iMac, 1TB(partitioned) SSD, GB, macOS 15.3.1 Sequoia
CCC will balk and report that it doesn't have enough room to do the clone. It, too, follows the OS protocol of write first, then update the directory.


Hmmm…??? I thought that CCC created some area on the boot drive to store what is to be backed up before writing or overwriting any data on the backup source.

If that's not correct, I guess I misunderstood how it works. :p



EDIT:
Some info on CCC's use of its SafetyNet folder and how it works:
Automated maintenance of the CCC SafetyNet folder
https://bombich.com/kb/ccc4/automated-maintenance-ccc-safetynet-folder


And as mentioned above, add a "lack of room" due to "lack of TRIM use". A real gotcha of SSD/flash drive usage. :|







- Patrick
======
 
Last edited:
M

MacInWin

Guest
Patrick, what you said and what you linked to don't change what I described. When CCC moves the original folder to the archive, because that's on the same drive, all it really does is change the directory entry from /folder/filename to /folder2/filename and leave the same disk address in place. Technically, that's a MOVE, not a COPY. Then, it copies the new version of the file to the backup drive, updates the directory entries to point to that new file and delete the reference to the old file, freeing up that space. So, if CCC sees that there isn't enough space for that new write, it throws up an error message (I've seen it).
 
Joined
Nov 19, 2006
Messages
1,815
Reaction score
97
Points
48
Location
York, UK
Your Mac's Specs
iMac: 5K 27” (2020), 3.3 GHz, 32Gb RAM. iPad 2025, iPhone 13 Mini, Apple Watch SE
I may be wrong but I think everyone is reading too much into the original question and getting far too technical. My understanding is that the OP is wanting to copy over updated images rather than the whole photos library. But of course if they drag and drop the photos library, that's exactly what Finder will try to do - it cannot identify individual changed images within the library. Lilbang is that correct?
 
OP
L
Joined
Mar 8, 2017
Messages
3
Reaction score
0
Points
1
Your Mac's Specs
iMac (21.5-inch, Mid 2011) macOS Sierra 10.12.3, iPad2, iPhone 7+
Yes Sawday, that is correct, I appreciate all the help though, thank you all. I have a better understanding why a SSD/Flash Drive won't act like a spinning Hard drive as far as organizing and updating information.
I do automatic back ups on time machine on all my (iMac) my families computers (MBP's). But actually I was looking for a less time consuming way to share my "Photo" Library with my families computers. I don't know if I can or should share TM backup with other computers on my network. iCloud might be a better way. Can I or should I set up my families computers to use my iCloud account?
 
Joined
Apr 16, 2016
Messages
1,096
Reaction score
51
Points
48
Location
CT
Your Mac's Specs
MacBook Air Mid-2012 / iMac Retina 5K Late-2014
If what you're looking for is a way to share photos with family, why not setup a Google Photos album and push everything there? So long as you allow Google to drop resolution on the files when needed, you get unlimited storage. Anything that family sees and wants an original resolution copy of they could ask you to email to them.
 
M

MacInWin

Guest
I may be wrong but I think everyone is reading too much into the original question and getting far too technical. My understanding is that the OP is wanting to copy over updated images rather than the whole photos library. But of course if they drag and drop the photos library, that's exactly what Finder will try to do - it cannot identify individual changed images within the library. Lilbang is that correct?
Well done getting that interpretation out of the original post! I've read and re-read that post and NEVER would have gotten to that understanding given what was written!
 
OP
L
Joined
Mar 8, 2017
Messages
3
Reaction score
0
Points
1
Your Mac's Specs
iMac (21.5-inch, Mid 2011) macOS Sierra 10.12.3, iPad2, iPhone 7+
I used Google photos, but it only transferred the photos, not the "Albums" or "People". I am looking for a way to share the "Photos.Library", not just the pictures.
 
Joined
Apr 16, 2016
Messages
1,096
Reaction score
51
Points
48
Location
CT
Your Mac's Specs
MacBook Air Mid-2012 / iMac Retina 5K Late-2014
Well done getting that interpretation out of the original post! I've read and re-read that post and NEVER would have gotten to that understanding given what was written!

That's the general gist that I got from it and why I posted the comments about using rsync. That utility is specifically designed to keep two distinct file locations in sync with each other.
 
M

MacInWin

Guest
But Sawday sussed out that what was wanted was to update just the individual images, not the entire library. Nothing I saw in the OP suggested that anywhere. rsync can't update images INSIDE the photos database, just update the file as a whole, leaving the original problem of not enough room on the drive for the write operation to complete.
 
Joined
Apr 16, 2016
Messages
1,096
Reaction score
51
Points
48
Location
CT
Your Mac's Specs
MacBook Air Mid-2012 / iMac Retina 5K Late-2014
But Sawday sussed out that what was wanted was to update just the individual images, not the entire library. Nothing I saw in the OP suggested that anywhere. rsync can't update images INSIDE the photos database, just update the file as a whole, leaving the original problem of not enough room on the drive for the write operation to complete.

Either way, rsync should be able to handle it as it's intended to identify differences and make the changes. Unless the Photo library is a single file that is more than 50% of the drive, all would be fine using rsync.
 
M

MacInWin

Guest
Unless the Photo library is a single file that is more than 50% of the drive, all would be fine using rsync.
And that is exactly the issue. The library IS one file and it was more than 50% of the drive. So it would not work, not enough room.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top