Linux – Force unmount of a device, how to

linuxUbuntu

I've mounted a block device (internal hard disk) to say ~/HD, and I'm trying,

~# umount ~/HD

It answers,

umount: device is busy.

Now I kill all processes manually by examining

~# fuser -m ~/HD

I also make sure that really no process is accessing the ~/HD path

~# lsof | grep HD

Still umount ~/HD says device is busy even with -f option.

PS: I don't want to use the -l option of umount, since the mounted device is actually an encrypted mapper device, which in turn won't get unmounted unless mapper device is clearly unmounted.

So basically my question is how to really force umount to unmount a device OR How can a device still be marked as busy while no processes are accessing it (or at least fuser and lsof don't report it) and what can I do about it?

I'm on Ubuntu 9.10 x64.

Best Answer

You will see this behavior if you have mounted something else on a subdirectory of ~/hd. In this case, neither fuser nor lsof will show anything. If you haven't mounted anything under ~/hd ('mount' will answer this question), then I'm not sure what to check.

Related Question