System Administration Guide: Devices and File Systems

ProcedureHow to Find Out If Removable Media Is Still in Use

Steps
  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 2–2 Finding Out If the Media Is Still in Use

The following example shows that the process 26230c, owner pmorph, is accessing the /cdrom/sol_9_1202_sparc/s0/Solaris_9/Tools/ directory.


# fuser -u /cdrom/sol_9_1202_sparc/s0/Solaris_9/Tools/
/cdrom/sol_9_1202_sparc/s0/Solaris_9/Tools/:     7258c(pmorph)