Greg Shields

Q: 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?

Screen Shot 2011-07-22 at 5.47.45 PM.png

Screen Shot 2011-07-22 at 5.51.54 PM.png

Posted on Jul 22, 2011 2:53 PM

Close

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

  • All replies
  • Helpful answers

Page 1 Next
  • by Pondini,

    Pondini Pondini Jul 22, 2011 4:53 PM in response to Greg Shields
    Level 8 (38,747 points)
    Jul 22, 2011 4:53 PM in response to Greg Shields

    Is a backup running? 

     

    Is Spotlight indexing it (click the Spotlight icon at the right of your menubar).

     

    If neither, you may have to Restart your Mac to get it to let go of the disk.

  • by DavidMalin,

    DavidMalin DavidMalin Jul 27, 2011 11:25 AM in response to Greg Shields
    Level 1 (0 points)
    Jul 27, 2011 11:25 AM in response to Greg Shields

    I have a small USB hard drive that will not eject under Lion. The message says the drive is in use. It is not! And I do not get a Force Eject option like Greg's. Just an OK button. Help has no response.

     

     

    Help!

  • by Greg Shields,

    Greg Shields Greg Shields Jul 27, 2011 2:33 PM in response to Pondini
    Level 1 (28 points)
    Apple Watch
    Jul 27, 2011 2:33 PM in response to Pondini

    Hi Pondini.  No a backup is not running and Spotlight is not indexing.  I can restart and it will let go of the disk, but as soon as one Time Machine backup completes then I have the same issue.

  • by Pondini,

    Pondini Pondini Jul 27, 2011 2:39 PM in response to Greg Shields
    Level 8 (38,747 points)
    Jul 27, 2011 2:39 PM in response to Greg Shields

    Something is trying to use it.

     

    Are you running anti-virus software, or anything else that may be monitoring it?

  • by Greg Shields,

    Greg Shields Greg Shields Jul 27, 2011 2:42 PM in response to Pondini
    Level 1 (28 points)
    Apple Watch
    Jul 27, 2011 2:42 PM in response to Pondini

    Nope, no anti virus.  I have also quit every app that is running.

  • by Pondini,

    Pondini Pondini Jul 27, 2011 2:53 PM in response to Greg Shields
    Level 8 (38,747 points)
    Jul 27, 2011 2:53 PM in response to Greg Shields

    Rats.

     

    There's a UNIX command you can run in Terminal to tell you what's using a file, but I'll have to do some poking around to find it.

     

    Stay tuned . . .

  • by Pondini,

    Pondini Pondini Jul 27, 2011 2:54 PM in response to Greg Shields
    Level 8 (38,747 points)
    Jul 27, 2011 2:54 PM in response to Greg Shields

    One other thought; it's not shown in the Login Items for any of your user accounts, is it?

  • by Pondini,

    Pondini Pondini Jul 27, 2011 3:49 PM in response to Greg Shields
    Level 8 (38,747 points)
    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:

     

    Screen shot 2011-07-27 at 6.46.07 PM.png

  • by Greg Shields,

    Greg Shields Greg Shields Jul 27, 2011 5:01 PM in response to Pondini
    Level 1 (28 points)
    Apple Watch
    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!

  • by zenspider,

    zenspider zenspider Jul 27, 2011 6:55 PM in response to Pondini
    Level 1 (0 points)
    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.

  • by Pondini,

    Pondini Pondini Jul 27, 2011 7:07 PM in response to zenspider
    Level 8 (38,747 points)
    Jul 27, 2011 7:07 PM in response to zenspider

    If mds is the culprit (which we don't know yet in this case), Repair Disk is the first thing to try.  As a last resort, it appears that deleting the index will fix it; at least it has in a few cases.

  • by zenspider,

    zenspider zenspider Jul 27, 2011 9:29 PM in response to Pondini
    Level 1 (0 points)
    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.

  • by Pondini,

    Pondini Pondini Jul 28, 2011 7:48 AM in response to zenspider
    Level 8 (38,747 points)
    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.

  • by zenspider,

    zenspider zenspider Jul 28, 2011 1:38 PM in response to Pondini
    Level 1 (0 points)
    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.

Page 1 Next