0

I've created an encrypted volume with TrueCrypt that is currently mounted on Mac OS X (v10.6.6). I have moved both MySQL and Postgres (v8.4) data to my encrypted volume and created symlinks to them. When the MySQL daemon is running and I eject the volume, it will eject without an issue. However, when the Postgres daemon is running and I attempt to eject the volume, a notice pops up saying,

The disk wasn't ejected because one or more programs may be using it.

Are there any work arounds for this?

1 Answer 1

5

Stop the daemon so it closes out the files?

I guess I'm not fully understanding...you put the database files on the volume that you're trying to eject while the database is running? That really won't work well. You'd have to stop the database first so there's no open file handles referencing the volume.

9
  • I have the database files on the volume. And I'm trying to eject it while it is running, yes. My goal is to have this encryption work intuitively so it disrupts my workflow as little as possible. It works with MySQL and my guess is, instead of symlinking the entire data directory like I did with Postgres, I just symlinked the databases which allows me to eject the drive with MySQL running without complaint. Perhaps I will experiment with symlinking directly to the Postgres databases instead of the entire data directory, and see if that works out. Feb 7, 2011 at 16:53
  • Forcing a dismount usually works still, but it wont end well for the DB. +1 Best to stop the daemon first.
    – Chris S
    Feb 7, 2011 at 16:54
  • 2
    You can't eject it while the files are open unless you want corrupted databases. It won't work properly if the volume is yanked out from under the application. Feb 7, 2011 at 16:55
  • 1
    @Zoredache - maybe he's a data-corruption-pro
    – Chopper3
    Feb 7, 2011 at 17:03
  • 1
    Never before has the phrase "You're doing it wrong" been so accurate. Feb 8, 2011 at 1:28

Not the answer you're looking for? Browse other questions tagged .