How do I unmount an NFS share in Solaris 2.7 if the NFS server cannot be contacted?

5,423

Solution 1

Sometimes this works:

mount /some/fs -o remount,soft
umount -f /some/fs

Solution 2

Your last entry, "filesystem is busy", implies that there is an open file somewhere on that mount, which is the real cause of your pain. Any chance you can track down that file and kill whatever process is using it?

Solution 3

If there is a reason other than trying to keep things tidy, such as it causing hangs every time you accidentally enter that directory, I wonder if you could mount something else over the top. I'm not sure if lofs is in solaris 2.7 (the mount command I used works in Solaris 10), but you could try just mounting another directory over the top:

mkdir /var/tmp/some_dir
mount -F lofs /var/tmp/some_dir /path/to/nfs/mount

That way you won't have any issues whenever someone tried to mount that directory. You might still hit issues with commands like df though.

If that isn't an optimal solution, you could try setting up a temporary nfs server where it used to be and hope the server will succeed in connecting to it. You could create a VM for it, or even just set up an nfs share on your laptop and change the IP temporarily. Just long enough to make the server think it has a valid nfs mount and unmount it.

This is all sounding a little more work than just rebooting at an opportune time (such as when you install patches) however.

Share:
5,423

Related videos on Youtube

another average joe
Author by

another average joe

Updated on September 17, 2022

Comments

  • another average joe
    another average joe almost 2 years

    Every time I try doing unmount /some/fs it says it is busy. The server has gone bye bye; anyone have any ideas?

    I have tried:

    unmount -f /some/fs
    Illegal option
    
    unmount -o force /some/fs
    Illegal option
    
    unmount /some/fs
    File system is busy
    
    • AWesley
      AWesley about 15 years
      Is umount -l a valid option? Luckily I don't have a Solaris 2.7 machine to check on ;)
  • another average joe
    another average joe about 15 years
    When using mount /some/fs -o remount,soft the command hangs and does not return. unmount -f is not an available option in Solaris 2.7.
  • Steve Townsend
    Steve Townsend about 15 years
    You're not going to like the only other option I have for you: rebooting. Unfortunately, when NFS goes away, things get very miserable :(