iTunes and an external hardrive problem

Discussion in 'Mac Apps and Mac App Store' started by AnthonyFlower, Oct 5, 2012.

  1. AnthonyFlower macrumors member

    Joined:
    Nov 4, 2011
    Location:
    UK
    #1
    I have a problem with an external drive I use for iTunes.

    I have two 2tb external drives used solely for iTunes, with separate content (two because the first one filled up).

    Every couple of days I get an error when I try to buy content on iTunes, it's error 50, which I know is common, but the usual fixes don't help.

    What I have to do is shut down itunes, forcibly eject the newer hard drive (it won't eject on it's own as it says it's in use), unplug/plug back in, then open iTunes again. Now it will download happily.

    When the error occurs I can still access the drive in Finder, I can play content from it in iTunes and write to it in Finder, I just can't write new content to it in iTunes.

    Any ideas on the cause and a fix would be greatly appreciated, or any way to find out what program is using the drive once iTunes is shut down? I have Googled the latter and have found ways to see what is using a file but not a whole drive.

    Many thanks

    Anthony
     
  2. Brian33 macrumors 6502a

    Joined:
    Apr 30, 2008
    Location:
    USA (Virginia)
    #2
    I don't know how to solve your problem, but the diskutil command may make it less painful to eject it. Maybe it will even give some informational message if it can't eject it.

    In Terminal.app, type 'man diskutil' to get all of the details. Use 'diskutil list' to display all your disks and partitions. Here are some subcommands that might be handy. When it mentions volumes here I think it means what we usually call partitions (at least it seems so on my system). I'd start with the unmountDisk and eject subcommands, and leave the unmount force as a last resort...


    Code:
         unmount | umount [force] device
                    Unmount a single volume.  Force will force-unmount the volume
                    (less kind to any open files; see also umount (8)).
    
         unmountDisk | umountDisk [force] device
                    Unmount an entire disk (all volumes).  Force will force-
                    unmount the volumes (less kind to any open files; see also
                    umount (8)).
    
    
         eject device
                    Eject a disk.  Media will become offline for the purposes of
                    being a data store for file systems or being a member of con-
                    structs such as software RAID or direct data.  Additionally,
                    removable media will become eligible for safe manual removal;
                    automatically-removable media will begin its physical (motor-
                    ized) eject sequence.
    
     
  3. AnthonyFlower thread starter macrumors member

    Joined:
    Nov 4, 2011
    Location:
    UK
    #3
    Thank you Brian33 for the suggestion unfortunately it didn't yield any further information. Also ejecting or unmounting both failed (without giving a reason) so i was still left with forcing it again.
     
  4. Brian33 macrumors 6502a

    Joined:
    Apr 30, 2008
    Location:
    USA (Virginia)
    #4
    I was curious about how to find the process that might be preventing the eject. If you don't mind using Terminal, I think I have an easy way to find any process that has any file open on a particular drive. That doesn't itself solve your iTunes purchasing problem, but if you know what process it is maybe it would provide some clue about that problem. At the very least you can terminate the process to do a normal eject (if that's still required to clear up the iTunes problem) instead of a force eject.

    Basically, I used the lsof command to find the PID(s) of processes having open files on my external drive, then used the PID(s) in the ps command to get the path and filename of the process. Then you could use kill to terminate that process and (hopefully) you can eject the drive normally and maybe even fix your iTunes problem.

    I don't know how familiar you are with the command line. Here are some examples: lsof provides lots of neat info about open files. The PID of the process holding the file open is the second column:

    Code:
    lsof /Volumes/disk-name/
    (alternatively you could get the list of every open file and pipe it to grep.)

    Get the PID from the second column, and substitute it into the command below:

    Code:
    ps -ef | grep your-pid
    That'll give you the full path and name of the process' executable. From there you can use kill on it.
     
  5. AnthonyFlower thread starter macrumors member

    Joined:
    Nov 4, 2011
    Location:
    UK
    #5
    Thank you for your suggestions they look extremely helpful.

    I have run it this morning (not had the error yet today but was curious) and the only two things using the drive are iTunes and Finder. Once the error reoccurs I will run it again and see if it's different.

    Thanks again

    Anthony
     
  6. DoctorCrap macrumors regular

    DoctorCrap

    Joined:
    Oct 6, 2012
    Location:
    Penang, Malaysia
    #6
    How can someone possibly fill a 1TB hard drive with songs, videos and apps?
     
  7. justperry macrumors 604

    justperry

    Joined:
    Aug 10, 2007
    Location:
    In the core of a black hole.
    #7
    Erm, he said 2TB, that doubles it.:eek:

    Actually he said 2tb which is 250GB.:p
     
  8. DoctorCrap macrumors regular

    DoctorCrap

    Joined:
    Oct 6, 2012
    Location:
    Penang, Malaysia
    #8
    2 TB = 2000 GB right?
     
  9. justperry macrumors 604

    justperry

    Joined:
    Aug 10, 2007
    Location:
    In the core of a black hole.
    #9
    No.:p

    TB or Tb, TerraByte or Terrabit, one byte is 8 bits.

    And 2TB = 2048 GB not 2000 GB.
     
  10. parc macrumors newbie

    Joined:
    Oct 13, 2012
    #10
    Crap again.
     
  11. DoctorCrap macrumors regular

    DoctorCrap

    Joined:
    Oct 6, 2012
    Location:
    Penang, Malaysia
    #11
    Oh Terabyte.. That makes sense now.
     
  12. AnthonyFlower thread starter macrumors member

    Joined:
    Nov 4, 2011
    Location:
    UK
    #12
    Is our media collection size that unusual?

    We don't watch broadcast TV so my wife and I buy what we want to watch from iTunes (for the last 4 years), add to that every DVD we own ripped and stored on there to save keeping a ton of DVDs to hand, it adds up fast.

    As for the original problem, it hasn't actually happened today, despite buying an episode of American Dad for tonight, so nothing new to report.

    (PS my apologies for my inaccurate use of 2tb instead of 2TB)
     

Share This Page