How to properly umount when the device is busy

Valic —  April 24, 2013 — 2 Comments

When you try to unmount a device sometimes you get this error: /media/sdxy: device is busy when you need to unmount a CD drive or to remove an external drive or anything else.The ideal situation is when your Linux is telling you what is keeping the device busy, but is not happening.

This is how to properly use umount command:

When you get this error,

# umount /media/sdxy
umount: /media/
sdxy: device is busy
umount: /media/
sdxy: device is busy

1. First thing you’ll probably do is to use fuser to find out what process is keeping your device busy. You can do it like this:

# fuser -m /dev/sdxy
/dev/sdxy: 230452
# ps -aux | grep 230452
root     230452  0.2  0.0  20756  3764 pts/0    Ss   22:35   0:00 -bash

You need to kill the 230452 process then umount the drive.

2. The second way to umount your drive is to use the -l argument from umount command. This is short for Lazy unmount. This will unmount any device from your system and will cleanup all references to the filesystem as soon as it is not busy anymore.

mount -l /dev/sdxy

Done.

Valic

Posts Twitter Facebook

Editor in Chief at Debian-Tutorials, Linux enthusiast.

2 responses to How to properly umount when the device is busy

  1. Hello, I have two doubts:

    1. The order to use should be <> or <> command.

    2. In the second way, if “-l” is argument from <> command, then the order line should be

    <>

    Thanks, is very interesting know this command.

    fdm

  2. I sorry, the sentences now well-written are:

    1. The order to use should be “umount” or “unmount” command.

    2. In the second way, if “-l” is argument from “unmount” command, then the order line should be

    “unmount -l /dev/sdxy”

    Thanks, is very interesting know as use this command.

    fdm

Leave a Reply