Tag Archives: nfs

umount not possible – device is busy!!!

Share Button

Hello everybody,
Welcome to a new issue at UbuntuVideoCast. Did you ever ran into the situation that you have an external storage device attached and now you like to umount it and disconnect it from your system and when you execute for example the command umount /mnt/storage that the system tells you it is not possible because the device is busy? Well here is the solution to figure out who or what is keeping the device busy.
Situation:
# umount /mnt/storage/
umount: /mnt/storage: device is busy
umount: /mnt/storage: device is busy

 

What now? The answer is simple use fuser. fuser is a command used to show which processes are using a specified file, file system, or socket.
Here are the options:
-k kills all process accessing a file. For example fuser -k /home/export/ganesh kills all processes accessing this directory without confirmation. Use -i for confirmation
-i interactive mode. Prompt before killing process
-v verbose.
-u append username
-a display all files
-m name specifies a file on a mounted file system or a block device that is mounted. All processes accessing files on that file system are listed. If a directory file is specified, it is automatically changed to name/. to use any file system that might be mounted on that directory.

 

In order to solve the issue in our example we have to execute the following command:
# fuser -m /mnt/storage
/
mnt/storage: 15738
# ps auxw| grep
15738user 15738 0.4 2.7 219212 56792 Sep10 11:16 beremote
You should receive something like displayed above. Either close the program, shutdown the service or just kill the process.
I hope that this was helpful to you. Please send me or post any comments, regarding this article or my website. I am happy to receive criticism. I am always looking for a way to improve this website.

NFS error: Stale File Handle

Share Button

I ran into an interesting issue this week and thought I share that with you guys.
If you have a customer site that makes use of NFS file shares may it be in a
Virtual Environment or as a regular share for Linux Desktops/Servers you
have to be aware of a common error message. Sometime NFS can result in
to weird problems. If you run a command such as ls or nano you will see an error:

$ ls
.: Stale File Handle

Here is a short explanation of Stale File Handle.
A file handle becomes stale whenever the file or directory referenced by the handle is removed by another host, while your client still holds an active reference to the object. A typical example occurs when the current directory
of a process, running on your client, is removed on the server (either by a
process running on the server or on another client).

So this can occur if the directory is modified on the NFS server, but the directories modification time is not updated.

How do I fix this problem?
The best solution is to remount directory from the NFS client using mount command:

# umount -f /mnt/local
# mount -t nfs nfsserver:/path/to/share /mnt/local

First command forcefully unmount a disk partition /mnt/local (NFS) and the second command mounts it to the mount point.

How to mount a NFS Share

Share Button

In this Clip I demonstrate how to temporarily mount a NFS Share to your Workstation also how to mount it upon boot time.

1 2