System Administration Guide, Volume 1

How to Find Out If a Diskette Is Still in Use

  1. Become superuser.

  2. Invoke the fuser command.

    The fuser command lists the processes that are currently accessing the CD that you specify.

    # fuser -u [-k] floppy0


    Displays the user of the diskette. 


    Kills the process accessing the diskette. 

Example--Finding Out If a Diskette Is Still In Use

In the following example, the processes 6400c and 6399c are accessing the /floppy/floppy0 directory, and the process owners are root and smith, respectively.

# fuser -u /floppy/floppy0
/floppy/floppy0: 6400c(root)  6399c(smith)

You can kill the processes individually (as superuser), or you can use the fuser command with the -k option, which kills all the processes accessing that file system. The fuser command might not always identify all the killed processes. To be sure, run it again with the -u option.

# fuser -u -k /floppy/floppy0
/floppy/floppy0: 6400c(root)Killed  6399c(smith)Killed