Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Ayrehead

macrumors member
Original poster
May 14, 2019
32
5
I have a question about writing files from a Mac to a USB flash drive. Many people say that macOS uses write caching for that. However, when I transfer files it takes significant time to complete. A 800 MB file takes more than a minute. Does that mean write caching is not used for that operation?

If I'm right, that means I don't have to eject the flash drive after I transfer files there. The files will still be on the flash if there is a power outage.

Am running Sonoma 14.5
 
Flash drive write speeds are dependent on the specs of the flash drive and the file system format. If your flash drive will only be used with Macs, format the flash drive as APFS or HFS+. If you take the flash drive between Windows and Mac systems, format the drive as ExFAT.

As for write caching.. that is why you have to "Eject" external media. Yanking out the external media could corrupt the data on the media... what if some process is writing to the media when you go to yank it? Always "Eject".
 
My question: Was write caching actually being used when I did that transfer?
 
Was write caching actually being used when I did that transfer?
Caching can be in multiple places. You have not said how you are writing to the flash disk, so it hard to be specific. But, for example, I would not expect a Finder drag and drop to complete until the data was all written to the flash drive.

Flash drives can be very slow.

But don't remove the flash disk until the eject has completed - that ensures that the file system on the drive is good. If you don't wait, there is risk of corruption.
 
See https://bonsaidb.io/blog/acid-on-apple/
There is "write caching" in the sense that a write() does not block until the data is fully committed to the disk. I cannot find at the moment stats on the expected delay between a write() returning and the data actually hitting disk, probably you can assume it's at most on the order of a few dozen seconds or something.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.