Force Time Machine Drives to Unmount
Posted by Kevin Purdy at 1:30 AM on February 23, 2008
Tech blogger Phil Windley grew tired of trying to eject his external back up disk, first the suggested Apple+E way and then by yanking a cord, just to see that ominous red stop sign of warning every day, even when he knew his disk operations were (or should have been, at least) done. His suggestion for others suffering from clingy back up drives: Parse together a terminal command similar to the one below (substituting name and other portions for whatever fits your system):
sudo umount -f /Volume/Name\ BackupIf you then add that command to your bash path (changing the first "u" for whatever shortcut you'd like:alias u="sudo umount -f /Volume/Name\ Backup"You can avoid even the slightest suggestion that you're harming your precious back up files by simply typing your shortcut into a terminal window (or creating a shortcut). Anyone out there have a similar problem to Phil's, or another solution? Let's hear it in the comments.
Tags: backup utilities | how to | mac os x | mac os x leopard | mac os x tip | mac tip | top

Comments (AU Comments · US Comments)
There are currently no AU comments for this post.
chrisgeleven
Posted 3:24 AM 23/2/08
One of the main reasons why I am seriously interested in Time Capsule (which btw, when are they coming out) is so I don't have to worry about disconnecting my external drive. For laptop users, Time Capsule should be perfect for us.
chrisgeleven
davidinmanhattan
Posted 3:24 AM 23/2/08
I'll try the Terminal command. I got the "improperly disconnected" message once. Now I "just" eject, shut down, unplug, reboot. Which is why I backup only once a day... I don't usually have a hard time ejecting my Time Machine-dedicated external hard drive, but I'm not taking chances. Would like a way to test my backup data without having to "go back in time..."
davidinmanhattan
DT
Posted 4:25 AM 23/2/08
I've been using Ejector... laptop heaven. Gina had it as a download of the day a while back (link to post [lifehacker.com])
It's a must have on my mac... With an external itunes library, time machine, and a thumb drive, I can't imagine dealing without it.
DT
mrakins
Posted 5:09 AM 23/2/08
I've just been dragging the TimeMachine disk from the desktop to the trash/eject button on the dock. Give it a few seconds until the icon disappears, and then unplug. No problems so far.
mrakins
Donathius
Posted 5:09 AM 23/2/08
I'm with Geoff. Unless you have a problem ejecting the drive is it really that much harder to wait a couple seconds before you unplug the drive? I guess it would be possible to write a Perl script that does all the Terminal stuff for you, but it seems like a lot of work just to unmount a drive.
Donathius
Geoff Wozniak
Posted 5:09 AM 23/2/08
I've found that ejecting a Time Machine disk by way of the Finder works just fine. It must be done using a Finder window, however. As noted above, the Apple-E approach doesn't work.
I don't think opening a Terminal window is going to save me a lot of effort, but it's a handy thing to keep around.
Geoff Wozniak
lemur
Posted 6:10 AM 23/2/08
Does umount -f notify the programs that are using the disk that they must flush the content of the files to the disk and close them?
If not, is this not just a little safer than unplugging the drive but still risky?
I don't have a Mac but I've been using Unix for a long time. I would not try to force to unmount a filesystem unless I had good evidence that all the files on there are in a consistent state. In this case, I'd want to tell TimeMachine to suspend its operations first and then umount the drive.
It seems to me, judging by what other people have posted, that it is in fact possible to eject the disk just using the GUI and I would expect the Apple programmers to be intelligent enough to allow it only if it is safe. In fact the report that it takes "a few seconds" to eject the disk through the GUI makes me think that the OS is first asking all software using the disk to please flush their files and close them, and then the OS unmounts the disk. That seems reasonable. If "umount -f" is doing the same thing, then fine. But if somehow it pulls the rug from under TimeMachine, that's dangerous.
If the filesystem is journaling and the journaling interface is exported to apps like TimeMachine, then corruption could be avoided. At the next mount, the filesystem would just be in the last consistent state before the disk was unmounted. But if that's the case "umount -f" is only minimally better than yanking the plug.
Or perhaps I'm missing something. Anybody can give a technical answer to this?
lemur
flypen
Posted 10:19 AM 23/2/08
Any suggestions for a Windows ejector?
Thanks.
flypen
DT
Posted 3:54 PM 23/2/08
@flypen: yup... I use this for my porable apps dirve at work... [quick.mixnmojo.com]
DT
JustEaton
Posted 3:59 AM 22/3/08
I believe the directory should be "/Volumes/" not "/Volume". An added tip: If your drive's name is "Time Machine", you need to type "/Volumes/Time\ Machine" with the space in there.
JustEaton