System Administration Guide: Basic Administration

How to Find Out If Removable Media Is Still in Use

  1. Become superuser.

  2. Identify the processes accessing the media.


    # fuser -u [-k] /media
    

    -u

    Displays the user of the media. 

    -k

    Kills the process accessing the media. 

    For more information on using the fuser command, see fuser(1M).

  3. (Optional) Kill the process accessing the media.


    # fuser -u -k /media
    

    Caution – Caution –

    Killing the process accessing the media should only be used in emergency situations.


  4. Verify the process is gone.


    # pgrep process-ID
    

Example—Finding Out If the Media Is Still in Use

The following example shows that the process 26230c, owner ripley, is accessing the /cdrom/cdrom0/Solaris_8/EA/products/Live_Upgrade_1.0 directory.


# fuser -u /cdrom/cdrom0/Solaris_8/EA/products/Live_Upgrade_1.0
/cdrom/cdrom0/Solaris_8/EA/products/Live_Upgrade_1.0:    26230c(ripley)