Solved

ejecting cd rom

Posted on 2004-10-29
551 Views
Last Modified: 2010-04-20
i have fedora linux installed in my system , when ever i try to unmount or eject  my cdrom error message comes that  "the device is busy" . it is not possible to  take it by pressing the button why? is it possible to take it out by killing the process ,if possible which process is associated with the cdrom?
0
Question by:sree01
    11 Comments
     
    LVL 2

    Expert Comment

    by:mmartha
    try typing "eject"
    0
     
    LVL 2

    Expert Comment

    by:mmartha
    at the console, that is.
    0
     
    LVL 34

    Expert Comment

    by:PsiCop
    A device is busy when something is accessing it. Try making sure that you have closed all programs that are using the CD-ROM. Also, make sure any terminal/command-line sessions do nto have a path on the CD-ROM as their current working directory.
    0
     
    LVL 2

    Expert Comment

    by:mmartha
    am... sorry, I think you already tried that.

    Check that the folder isn't in use too (like you're inside it when you are trying to do unmount or eject)
    0
     
    LVL 38

    Accepted Solution

    by:
    Hi,

       run "fuser -k /mnt/cdrom" as root to kill whatever process access /mnt/cdrom
    or use "lsof" to check which process access cdrom and kill that process. Then you should be able to eject cdrom.

    Wesly
    0
     
    LVL 2

    Expert Comment

    by:Matt_Avery
    This exact problem happens to me a lot. There are two common variations:

    1. Pop a CDROM into the drive, GNOME / KDE destop mounts the CDROM automatically and brings up a navigator window showing the contents of the CDROM. Need to remember to close that window before ejecting the CDROM or it will refuse to eject (because the navigator window has the CDROM as it's working directory)

    2. Insert a CDROM, mount it manually with a "mount" command, "cd" into the CDROM filesystem, do some stuff. Need to remember to "cd" *out* of the CDROM filesystem or it will refuse to eject (becuase my shell has the CDROM as it's working directory).

    Less common variation is that some other user or process is using the CDROM. In that case, need to read up on the "fuser" command.
    0
     
    LVL 2

    Expert Comment

    by:w00pie
    umount /dev/cdrom
    or type mount and see if there is a cd mounted
    after its unmounted you can press button
    0
     
    LVL 10

    Expert Comment

    by:Luxana
    that is just because some of your processes are still using your cdrom.

    easy help, Lets say that you have mounted your cdrom to /mnt/cdrom and now you can't unmout it and device is always busy so you can use this commnad:

    # fuser -mk /mnt/cdrom
    then
    #eject
    or
    # unmout /mnt/cdrom
    This command will find all processes using you /mnt/cdrom and kill them.

    but please do not use this commnad to you mounted partitions use it just in case that you can't unmont your cdrom otherwise it can cause damage to your system.

    LUXANA
    0
     
    LVL 2

    Expert Comment

    by:hoonexpert
    Very simple in 2 steps

    1. Change directory to anything else than cd #cd will take u to ur home directory
    2. #eject

    Done

    Manish.
    0
     
    LVL 5

    Expert Comment

    by:pbhj
    I get this a lot, KDE seems to keep a device open even when you navigate away from it in the directory structure.

    What I do is run something like

    "lsof | grep cdrom"

    This will list all open files which include the word cdrom, usually you'll get some KDE programs (kdeinit I think) - if you use KDE. Now, lsof lists the pid (process ID) of the processes accessing the file, just kill the process (eg "kill 1204") and you should then be able to "eject /dev/cdrom".

    I'd not come across tha fuser util though, will check it out.

    Sorry for the "me too" will read the thread more closely next time!!

    pbhj
    0
     
    LVL 8

    Expert Comment

    by:pjcrooks2000
    Make sure your logged in as root and do

    umount /mnt/cdrom


    Hope this helps

    pjcrooks2000
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Shellfire Box VPN + Lifetime Subscription

    The Shellfire Box easily connects all of your devices, even those that don't offer the possibility to establish a safe vpn connection. Access blocked content and surf safely, no matter where in the world you are located.

    Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
    In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    933 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now