On server1, we had an NFS share mounted from server2 like this:
/nfs/server2/share
Recently, we took down server2 to install a new OS on it. Now we can't get NFS setup the way it was. When I do this:
ls -l /nfs/server2
and it's empty. So therefore I cannot mount my share at /nfs/server2/share
.
When I try to create /nfs/server2/share
directory, I get
mkdir: cannot create directory `share': No such file or directory
I think this is because it doesn't really think the /nfs/server2
directory really exists. Even if I use the -p option with mkdir, it doesn't work.
Next I tried to remove /nfs/server2
so I could just recreate it. I try to rm -r /nfs/server2
but I get
rm: cannot remove directory `/nfs/server2': Device or resource busy
So now I'm at a loss. I need to mount this NFS share in the same exact place on server1
(at /nfs/server2/share
) because other software on server1 depend on this. But if I can't create that share directory and I can't remove that directory, what do I do?
Also, just for testing, I attempted to mount the share at /nfs/testing/share
and it mounted just fine. But like I said, I need to mount it back in the same location.
UPDATE
The server2 is not mounted in any way on server1. I think that the problem started when another admin took down server2 to reinstall the OS without first unmounting the share on server1. I'm not sure if that makes a difference or not. In any case, mount | grep server2
shows nothing and there is nothing in fstab
.
SOLVED
Apparently automount was running on server1 and that service was keeping me from deleting that old NFS directory. Lack-of-communication-between-sysadmins FTL…
I suppose that the way to solve this problem would have been to grep for some process or service that is using that directory I tried to delete. But I don't know how to do that.
Best Answer
For future reference, the
mount --move
switch is very useful to move a misbehaving mount out of the way. See also theumount -l
option.