Public Service Announcement: "Disk Not Ejected Properly" error frequently recurring with external USB drive solved by adding a wall-powered USB hub
I've spent a lot of time (months) and done a lot of googling to solve this problem and seem to finally have solved it. I don't see any obvious google results that summarize it well, so here it is in case you're looking to solve the same problem.
Problem: I have been trying to load lots of photos and videos (nearly 1 TB) from my Mac Photos library to Google Photos using "Backup and Sync from Google", but it is frequently interrupted by the external hard drive being ejected randomly or by Backup and Sync crashing or freezing.
Use case/scenario: I upgraded my iMac to Mojave shortly after it was released publicly. My Photos library is stored on an external USB drive. The USB drive is a "WD My Passport Ultra Portable External Hard Drive". The drive has only a USB port, with no other power supply. Backup and Sync has a lot of data to process, and it would never get past 'scanning files' before starting over because of random ejects, indicated by the "Disk Not Ejected Properly" notification.
Solution: I bought a powered USB hub (in my case an AmazonBasics hub), ensured its power cable was plugged into the wall, its USB cord was plugged into my iMac, and my external hard drive was plugged into it. I also created a new user account on my iMac, with nothing running on it other than Amphetamine (to ensure the external disk is routinely prodded to stay awake), and Backup and Sync from Google. Energy preferences and schedule are all set to prevent disks from sleeping. After adding the powered USB hub, but before creating this new user account, Backup and Sync would crash and/or freeze randomly. I think having a clean, minimal user account and having that be the only account logged in and working has eliminated the random crashing/freezing by Backup and Sync. And I think that the random ejects were due to the external hard drive having a power disruption because of only being previously powered via the USB port on my iMac.
Outcome: Since taking these steps, I have not had a single random improper disk ejection, and Backup and Sync from Google has been uploading my photos and videos to Google Photos non-stop for three days thus far.
I hope this helps others who might be encountering a similar problem!
Cheers,
Larry
iMac (21.5-inch, Late 2013), macOS High Sierra (10.13)