Solaris: fuser to find users or processes making filesystem umount fail

Home -> UNIX -> Solaris -> System administration

15829 views

From the computer of: qmchenry (339 recipes)
Created: Nov 27, 2005


0 comments:
View all comments

Add a comment

Add to:
Add to stumbleuponAdd to del.icio.usDigg itAdd to FURL

Before unmounting a filesystem, Solaris checks to ensure that no files are open to prevent loss of data. The following are steps that can be followed when a filesystem won't unmount.

The fuser utility lists processes using a file or files in a filesystem. It's To determine what processes may be preventing a filesystem's umount, the -c switch must be used as running this command as root:

fuser -c /mnt
/mnt:    19504tm   19492tm   19460tm


This command will list the process ids of processes with open files in the filesystem mounted under /mnt. The characters following the pid provide additional information about the file:

    c - the process is using the file as its current working directory
    m - the file is mapped with mmap
    o - the process is using it as an open file
    r - the file is the root directory of the process
    t - the process is accessing the file as a text file
    y - this file is the controlling terminal for the process


A useful option for fuser is -u which adds the username owning the process to the display:

fuser -cu /mnt
/mnt:    19504tm(root)   19492tm(root)   19460tm(qmchenry)


If you feel comfortable killing the processes reported by fuser, you can do it in one quick blow with the -k option:

fuser -ck /mnt


This sends the SIGKILL signal to each process which is the same as running kill pid to each process.

However, before you go to this extreme, perhaps the most common reason a filesystem won't unmount is because you (or a previous shell you used) has its current working directory in that filesystem.

Subscribe to the Tech-Recipes Newsletter

You can get tips like this delivered in your email every week!

Enter your Email

We will never, ever sell your email address or spam you.





Related recipes:

  Solaris: unmounting a filesystem with umount
  Solaris: disk usage of all users on a filesystem
  Boot Solaris from CD-ROM to solve problems
  find which package a file belongs to
  Solaris: Mount filesystem with UFS logging enabled
  Solaris 10: Create multi-terabyte UFS filesystem
  Find out how many open files by all processes
  ZFS: List or view filesystems
  Automatically answer yes to all fsck questions
  ZFS: Set or change the mount point of a filesystem

 

Sponsored links

 

Login

Nickname

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.