# How to unmount a drive

## at

I am trying to unmount a hard drive. To no avail. Instead the following message is produced:

```
# umount -vf /mnt/new/usr

umount2: Device or resource busy

umount: /mnt/new/usr: device is busy.

        (In some cases useful info about processes that use

         the device is found by lsof(8) or fuser(1))

umount2: Device or resource busy

# mount -v -o remount,ro /mnt/new/usr

mount: /mnt/new/usr is busy
```

Unfortunately, "In some cases" seems to be the key here, since neither 'lsof' nor 'fuser' show anything:

```
# lsof /mnt/new/usr

# lsof -a /mnt/new/usr

# fuser -m /mnt/new/usr
```

Is there a way to unmount the drive other than pulling the plug? Or at least find out why it is considered to be busy?

Thank you!

----------

## 1clue

Make sure no shells have that directory (or any subdirectory) as their current working directory.

Make sure that no applications are being run from that directory.

Make sure no applications have opened files in that directory.

----------

## at

Yes, thank you. I did. There are no applications. No open files. And no shells. Incidentally, all of them would have been detected by fuser.

Any way to find why the drive is considered to be in use?

----------

## 1clue

Not that I know off the top of my head.

Are you chrooted?  I'm not sure if a chroot would have access to files from outside the jail.

Also, keep in mind that you have the shell you're typing in.  I've been caught by that a bunch of times, so you might try to cd / just to humor me.  Not trying to be a smartass, just can't think of anything else to try.   :Smile: 

----------

## at

I was chrooted, but I exited before trying to unmount the drive.

Yes, I am absolutely certain that the shell's pwd is not on that drive.

I suppose what I am really trying to understand is what could be preventing unmounting that is not detected by lsof or fuser.

----------

## 1clue

Yes, not deliberately being obtuse, it's the real deal here.  I just don't know.  I'll have to step out and hope you get somebody else who knows.

----------

## cach0rr0

check the output of mount and make sure nothing else is mounted over the top of that directory? 

only other thing that comes to mind

----------

## Hu

A file attached to a /dev/loopX device can render the filesystem that holds it "busy", but not show up on lsof since the user is the kernel loopback driver, not a user application.  If the file is opened read-write, then remounting read-only is prohibited.

----------

