Is it possible to disable write caching on a USB mass storage device on Mac OS X?

10,051

This should be possible by manually mounting the drive via the terminal. You'll have to eject the drive when you plug it in and then remount it in the terminal using the noasync option.

The best way to go about this would be to run mount in the terminal and take down the device so you know what to remount. Then umount /dev/disk1s1 (where disk1s1 is the device name) then mount -o noasync /dev/disk1s1. This method would also apply to most linux distros.

As you can see, it's easier to just remember to eject.

More info on mount available here: http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man8/mount.8.html

Share:
10,051

Related videos on Youtube

Ted Mielczarek
Author by

Ted Mielczarek

Hack of all trades.

Updated on September 17, 2022

Comments

  • Ted Mielczarek
    Ted Mielczarek over 1 year

    On Windows, there's a setting for removable drives called "optimize for quick removal", which disables write caching so you can just unplug your removable drive without causing filesystem corruption.

    I've googled a lot, but I can't find any information on whether the same setting exists for OS X. Is it possible to change this?

    The specific problem here is that my wife is a teacher, and her students use SD card readers for some class projects. Of course they don't ever eject the drive before removal, resulting in random disk corruption.

    • Dan Rosenstark
      Dan Rosenstark about 14 years
      If they have Internet access, free DropBox accounts may solve the problem. Or not...
    • Ted Mielczarek
      Ted Mielczarek about 14 years
      No, they're using the SD cards in digital cameras. Offering suggestions completely unrelated to the question at hand is not useful.
  • Ted Mielczarek
    Ted Mielczarek about 14 years
    Thanks! It might be a pain to actually use this in practice, but it's good to know that it's at least possible. (Of course getting high school students to follow directions is always harder.)
  • haridsv
    haridsv almost 13 years
    Too bad, there is no automatic way to do this. I recently connected an SD card via a reader and it turned out that the cable had a loose connection, so the drive appeared for a second and it was gone with the warning message from osx that the drive was removed without ejecting it first. Guess what, it became unusable to the point that I couldn't even format it on windows. I am now scared of connecting any external drives to a mac.