Ever try to unmount a drive and it came back with Device is busy even with umount -f? Well that is because a process is still accessing that drive. Use the following commands to find out which process that is and kill it so you can safely unmount your drive!

  • lsof (device) ex: lsof /dev/cdrom
  • kill -9 (pid)

If you are confused you can run this: lsof -t ‘device here’ | xargs kill -9 . Just make sure you put the device in. After that command you should be able to unmount the drive.

3 Responses to “Unmounting a Busy Device”
  1. Venom says:

    If you were to translate that command to english.. how would you say it.

    Would “|” mean then?

    So you do the first part.. and THEN the second part?

  2. themaceisback says:

    the | means do this command after that command

  3. Aaron says:

    The | is actually a pipe tool used in linux. It pipes the output of the first command and sends it to the preceding command. Eg.
    ls -lR /home/* | grep *.pdf

    This will list all the pdf files in the home directory.

Leave a Reply