How to determine what's being used on a connected server?

Discussion in 'Apple' started by Patty Winter, Jun 2, 2009.

  1. Patty Winter

    Patty Winter Guest

    I mounted my MacBook on the desktop of my Power Mac earlier today
    so that I could transfer a file. Now when I try to unmount the
    MacBook, I get the error message, "The operation could not be
    completed because the disk 'MacBook HD' is in use."

    How can I figure out what my Mac Pro thinks is still being used
    on the MacBook so that I can get it unmounted? I looked at Process
    Viewer, but nothing jumped out at me. (Although truth be told,
    aside from the UNIX daemons and the obviously named application
    processes, I'm not sure what most of the process names mean. :) )

    (I've got 10.2.8 on the Mac Pro and 10.4.11 on the MacBook,
    if that matters.)

    Patty Winter, Jun 2, 2009
    1. Advertisements

  2. Patty Winter

    David Empson Guest

    I assume both your "Mac Pro" references are supposed to be "PowerMac"
    and there isn't a third computer involved. :)

    On the PowerMac, do you have any disk images from the MacBook mounted?
    If so, eject them first. All mounted disk images are open files.

    I don't know offhand what command line tools are available on 10.2.8,
    but more recent systems have an 'lsof' tool which can be used to list
    open files. You could do something like this in Terminal:

    lsof | grep MacBook

    A more brute force solution: quit each application running on the
    PowerMac, and try ejecting the MacBook HD again after each one. If you
    are able to eject it, then the previous application you quit had
    something open on the drive.

    If quitting all applications doesn't solve it, log out and log in again.
    David Empson, Jun 2, 2009
    1. Advertisements

  3. Patty Winter

    Chris Eckert Guest

    use lsof (list open files) in the terminal shell in order to get a
    listing of all open files and their
    associated processes. once you've spotted the process in question you
    can terminate it. see also 'man ls'.

    Chris Eckert, Jun 2, 2009
  4. Patty Winter

    Greg Buchner Guest

    If I remember correctly with 10.2.8 (and earlier), you could not unmount
    a volume if Finder was still calculating folder size. And if you tried
    to eject it while it was doing that, the volume basically became
    unejectable. I haven't really had that problem since moving past 10.2...

    To get around it, I learned to use the umount command line tool.

    Greg B.
    Greg Buchner, Jun 2, 2009
  5. Patty Winter

    Patty Winter Guest

    Hi, Dave et al.

    Well, the problem "solved" itself this time. When I woke up
    the Power Mac this morning, it crashed. :-( Of course, when
    I restarted it, it no longer had a connection to the MacBook.
    But for future reference, I still appreciate all the ideas.

    A few responses below...

    Oops. ;-) Yes, you're correct--there were only two computers.
    Nope, nothing like that.
    Yes, lsof is available in 10.2.8. I just tried that on the Power Mac,
    and got a list of files that was even more esoteric than what I saw
    with Process Viewer. :) So I'm not sure that I'd be able to identify
    the troublemaker with lsof, but I'll keep it in mind. Thanks to Chris
    for suggesting lsof, also.
    Yeah, I did that with MS Word, since the file I transferred had been
    a Word file. But (1) that didn't work, and (2) I know that I was viewing
    the file on the Power Mac, not using Word on the Power Mac to view the
    version of the file on the MacBook. So Word shouldn't have been "linked"
    to the MacBook anyway. Good idea to try quitting other apps one by one.
    Ah, you know, since I'm the only one who ever uses this computer,
    and thus never log out, it never occurs to me to try logging out
    as a way to solve system problems.

    Also, Greg, the MacBook had been mounted for an hour or more, so
    even if the Power Mac was trying to gather folder-size data, it
    should have been long finished. But I'll check that next time
    this happens, and see whether some of the folder sizes aren't
    displayed yet. Given that I ruled out the only user application
    (Word) that might have wanted to talk with the MacBook, a system
    process of some sort was certainly the likely candidate for the

    Patty Winter, Jun 2, 2009
  6. Patty Winter

    David Empson Guest

    Another one which I've struck occasionally: if you have a Terminal
    window open, and the current directory is set to be anywhere on the
    MacBook hard drive, then that directory is "open" and you won't be able
    to eject the MacBook's hard drive.

    You can solve this one by closing the Terminal window, or by entering a
    'cd' command with no arguments, which will take you back to your home
    That's why I suggested the compound command:

    lsof | grep MacBook

    This will list all open files (that your user account has open) and pipe
    it to the grep tool, which will filter out all lines that don't contain
    the word "MacBook" (which is part of the name of your MacBook's hard
    drive, according to your earlier post).

    It should only display files currently open on your MacBook hard drive,
    as well as enough information to identify the offending process.

    If you want to see files that ALL users and the system have open on your
    MacBook, you can use the following command (you must be an

    sudo lsof | grep MacBook

    You will be prompted to type in your password, and the first time you
    run 'sudo' it will warn you about potential security issues.
    David Empson, Jun 3, 2009
  7. Patty Winter

    Patty Winter Guest

    Ah, got it. I thought it would list all files *on* the MacBook.
    Yes, filtering the Power Mac's files to list just the ones coming
    from the MacBook would be very helpful. Thanks, David.

    Patty Winter, Jun 3, 2009
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.