Cannot unmount dvd - Device is busy

You cannot open dvd or cdrom drive without successfully unmount the device. There are several reasons why you cannot unmount dvd drive. One example is when you invoke mv command instead of cp command to transfer data from dvd to the hard disk drive.

What happen when you try to move content from a read only device? Of course you'll get the "cannot move" message warns you that the content is read only. If you were moving large data, then you can stop the process with "Ctrl+c". You can continue to transfer the data but use the cp command this time.

The problem occurs when you try to unmount the dvd drive afterward. You'll find that the device is busy and you cannot unmount dvd drive.

The situation above is just an example. This tutorial explains how to find solution if you cannot unmount dvd drive because the device is busy. Let's see an example when device is busy and you cannot unmount dvd drive:

[email protected]:~# umount /mnt/dvd/
umount: /mnt/dvd: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))

When a device is busy, it must be running a process or other process is still using the device. In this case, we must stop the running process before unmount the device. We can use ps command to check the running process. If you are clueless about what process to look for, just issue "ps aux" command. Look at the username or terminal you are using now. See the example below:

luzar 27955 0.0 0.0 3576 1940 pts/1 Ss 23:08 0:00 -bash
root 27969 0.0 0.0 3076 1736 pts/1 R 23:08 0:00 -su
luzar 28000 0.0 0.9 39116 20036 ? S 23:09 0:00 kio_file [kdein
root 28006 0.1 0.0 2052 780 pts/1 T 23:10 0:01 mv drupal etc m
root 28088 0.0 0.0 2564 936 pts/1 R+ 23:28 0:00 ps aux

The example above shows that I was using the pts/1 terminal. There must be something I did which made the dvd device busy. Now I can grab all processes running from pts/1 terminal and start looking for the answer there.

[email protected]:~# ps aux | grep pts/1
luzar 27955 0.0 0.0 3576 1940 pts/1 Ss 23:08 0:00 -bash
root 27969 0.0 0.0 3076 1736 pts/1 R 23:08 0:00 -su
root 28006 0.1 0.0 2052 780 pts/1 T 23:10 0:01 mv drupal etc m
root 28088 0.0 0.0 2564 936 pts/1 R+ 23:28 0:00 ps aux

We can see that the mv process is still running. That's what makes the device busy. We can terminate the process with kill command. See the example below:

[email protected]:~# kill -9 28006
[1]+ Killed mv * /home/luzar/ (wd: /mnt/dvd)
(wd now: ~)

Check if the mv process still there with ps aux command. See an example below:

[email protected]:~# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 772 324 ? Ss 16:59 0:01 init [3]
root 2 0.0 0.0 0 0 ? S ...
...
root 27969 0.0 0.0 3076 1744 pts/1 S 23:08 0:00 -su
luzar 28039 0.0 0.9 39116 19992 ? S 23:21 0:00 kio_file [kdein
luzar 28069 0.3 1.7 53696 36020 ? S 23:22 0:01 konqueror [kdei
root 28089 0.0 0.0 2564 936 pts/1 R+ 23:29 0:00 ps aux

The mv pid is 28006. It's not there, which means we successfully terminate the process.

You can also use "grep" command to grab word from the ps result. See the example below:

[email protected]:~# ps aux | grep mv
[email protected]:~#

There are many reasons why you cannot unmount dvd drive. But there must be a process that still using the device which made the device busy. You can always check the process and kill the process id like the example above. If you are unsure of what makes your device busy, check bash history. Maybe you'll get the idea of what went wrong.

Add new comment