You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Cannot eject USB HDD that is being used for Time Machine after upgrading to Lion

After upgrading to Lion from SL, I have had only one issue. Amazing! Great job Apple with making the process smooth, but my issue is this. Ever since the upgrade, I cannot eject the external USB HDD that I use for Time Machine. I get the following error:


The disk "Time Machine" wasn't ejected because one or more programs may be using it. To eject the disk immediately, click the Force Eject button. There is the little spinning fan and the message "Trying to eject" and then the fan disappears and where it said, "To eject the disk immediately..." it now says "You can try to eject the disk again or click Force Eject to eject it immediately." I can click Force Eject and it will work, but seems like there is an issue that needs to be addressed. Any thoughts anyone?

User uploaded file

User uploaded file

Posted on Jul 22, 2011 2:53 PM

Reply
19 replies

Jul 27, 2011 3:49 PM in response to Greg Shields

Ok, I think there's a slightly better way, but try this:


Open the Terminal app (in your Applications/Utilities folder). Be very careful with this app. It's a direct link into UNIX, the underpinnings of OSX, but without the protections of OSX.


In Terminal, the prompt looks like this: <Computer Name>:~ <your name>$


(where <your name> is your short user name). It's followed by a non-blinking block cursor.


Copy the following after the prompt:


lsof |grep


and leave a space. Then drag the Backups.backupdb folder on the TM drive from a Finder window into the Terminal window (Terminal will convert that into a "path").


Press Return.


You should get a list of geeky stuff; but the first thing on the next line should be the process that's using the drive (Finder in the sample), followed by another prompt:


User uploaded file

Jul 27, 2011 5:01 PM in response to Pondini

Thanks for all your help! Can't tell you how much I appreciate it. I have left for vacation and won't be able to check this until week after next, but I will do it and see what I can find when I am back in the office. I use the Terminal app regularly. I am a Network Engineer and use it to manage some networking gear we have, Junipers mostly.


I checked startup items and it ain't there, but that was a good thought!


Thanks again!

Jul 27, 2011 6:55 PM in response to Pondini

The problem isn't finder. You can quit your finder process and the disk is still not ejectable. Running `sudo lsof | grep /Volumes/Backups` will show that `mds` is the culprit. `mds` is the brains behind Spotlight and it looks like most of the processes have to do with merging backup indicies together.


I have yet to come up with a good way to deal with this. Force Eject causes the next backup to take about 10 minutes longer than it should because it has to make sure everything is OK (basically, it reindexes everything).

I've filed a bug with apple.

Jul 27, 2011 9:29 PM in response to Pondini

mds is certainly the culprit in my case as described above. I don't see how you come to the conclusion that Repair Disk is the first thing to try. In my case that will probably take at least 24 hours just to run. If the software is buggy in Lion, then it is buggy in lion and it has nothing to do with the state of the filesystem.


The idea that the index might be corrupt is much quicker to test, so I'll go that route first.

Jul 28, 2011 7:48 AM in response to zenspider

zenspider wrote:

. . .

Force Eject causes the next backup to take about 10 minutes longer than it should because it has to make sure everything is OK (basically, it reindexes everything).

That can corrupt your backups. And it usually triggers a "deep scan," where Time Machien must compare everything on your system to the backups.


mds is certainly the culprit in my case as described above. I don't see how you come to the conclusion that Repair Disk is the first thing to try.


The indexing problem may be caused by a corrupted filesystem, especially since you've apparently done improper disconnects. mds being involved is likely a symptom, not the cause.


You've jumped in to an existing thread; we don't know what your symptoms are, or what you've done already.


In my case that will probably take at least 24 hours just to run.

What are you backing-up to?


If the software is buggy in Lion, then it is buggy in lion and it has nothing to do with the state of the filesystem.

That's a big "if" with no indication of a general problem with Time Machine. There are a number of threads with what seem to be similar problems; but many turn out to have different causes. A few seem to be damaged indexes. Some folks on Snow Leopard have similar symptoms, too, for a variety of reasons. There may be something unique to Lion, in a relatively few cases, but that's not clear yet.

Jul 28, 2011 1:38 PM in response to Pondini

I jumped into this thread because it directly addressed my problems and your advise to use lsof (without sudo) was wrong.


I don't know about you, but I'm running 10.7.zero... It is much more likely that there is a bug in mds (which had some major changes in this release) than there is in the filesystem drivers (something that hasn't had a major rev is quite some time and is tested to **** and back). The fact that I can mount and eject the disk on 10.6 but can't on 10.7 is evidence in that direction. Looking into the mds corruption only took a couple hours. Looking into disk corruption by running Disk First Aid would likely take 1-2 days (my backups go back since time machine was introduced, and is up to ~20m files). And if it is mds corruption, Disk First Aid wouldn't address it at all. This is why I say that repair disk isn't something you should blithely advise.


The likelyhood of filesystem corruption caused by force ejecting the backup partition is possible, but minimal. The system has had more than enough time to flush everything to disk and it is on a journaled partition.


I did fix my problem and it was an mds corruption issue:


  1. Go to Time Machine System Preferences.
  2. Turn Time Machine off.
  3. Go to Options and set the backup disk to "None".
  4. Start Terminal.app
  5. execute: sudo mdutil -i off -V /Volumes/Backups
  6. execute: sudo mdutil -E -V /Volumes/Backups


And then, because my mds process went wonky on the last step (it hung), for good measure I did:


  1. execute: sudo mv /Volumes/Backups/.Spotlight-V100 /Volumes/Backups/DeadSpotlight
  2. reboot


After everything was reindexed, I can cleanly unmount all partitions on that disk after doing backups.

Jul 28, 2011 1:54 PM in response to zenspider

zenspider wrote:


I jumped into this thread because it directly addressed my problems and your advise to use lsof (without sudo) was wrong.

Wrong how, or why?


I don't know about you, but I'm running 10.7. zero...

I believe we're all running 11A511.


It is much more likely that there is a bug in mds

If there's a general bug, there would be far most posts about it.


my backups go back since time machine was introduced, and is up to ~20m files

Four years of backups? I can't imagine why you'd want that, but as long as you realize certain things will take much longer, it's your call.


And if it is mds corruption, Disk First Aid wouldn't address it at all.

If it's directory corruption, Repair Disk will find it and repair it if it can.


The likelyhood of filesystem corruption caused by force ejecting the backup partition is possible, but minimal.

It does happen fairly often; that's why Repair Disk is usually the first thing to try when no other problem is obvious.


But, glad you've got it sorted out.

Cannot eject USB HDD that is being used for Time Machine after upgrading to Lion

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.