Unmounting File Systems


Contents

About This Document
    Related Documentation
File Systems That Cannot Be Unmounted
Determining What Processes Have Open Files
Determining What Kernel Extensions Are Open
Determining What File Systems Are Mounted within a File System
Recommended Fixes

About This Document

This document addresses issues related to not being able to unmount a file system.

Information in this document applies to AIX Version 4.x.

Related Documentation

For more in-depth coverage of this subject, the following IBM publications are recommended:


File Systems That Cannot Be Unmounted

A file system cannot be unmounted if any references are still active within that file system. This is the case if you get messages back like "Device busy" or "A device is already mounted or cannot be unmounted" when trying to unmount that file system.

There are two situations that will leave open references to a mounted file system:

  1. Files are still open within that file system. You must close these files before you can unmount the file system.

  2. File systems are still mounted within that file system. You must unmount those file systems before you can unmount this file system.

Determining What Processes Have Open Files

The first case is the most common. The fuser command is often the best way to determine what is still active in this file system. fuser is designed to return process IDs for all processes that have open references within a specified file system.

NOTE: Use of the flags given for fuser to require enhancements for fuser be installed for the appropriate release of AIX, as listed below. Other additional fixes may be needed to reliably perform the operations of this document. Please refer to the list at the end of this document.

APAR Description AIX Level
IX78943 ENHANCEMENTS TO FUSER 4.1
IX78941 ENHANCEMENTS TO FUSER 4.2
IX78523 ENHANCEMENTS TO FUSER 4.3

The mount command shows that the following file system is mounted.

mounted          mounted over 
---------------  --------------- 
/dev/hd3         /tmp 

To see what processes are currently active in the /tmp file system, you could run the following commands:

fuser -xc /dev/hd3  
      or  
fuser -xc /tmp 
After performing the appropriate actions based on the processes that are still active in that file system, you should re-run these commands. Once fuser no longer returns any process IDs, there should not be any active processes in this file system, and the file system should now be unmountable.

If the file system is still busy and will not unmount, the issue may be due to a kernel extension that is loaded but exists within the source file system.


Determining What Kernel Extensions Are Open

Processes are not the ONLY instances that can have open references. A loaded kernel extension can act as an open reference. To be more specific, if this file system CONTAINS kernel extensions and those files are in use, the file system will be unmountable until the references to those kernel extension files are closed as well. fuser will not show these kinds of references, since a user process is not involved.

Normally, kernel extensions will reside in the /usr/lib/drivers directory, so they should not be an issue with unmounting most file systems. In the case that a kernel extension resides in file system outside of /usr, the genkex command will report on all loaded kernel extensions.

Any kernel extension that is detected by this command that is referenced from the source file system must first be unloaded before the file system will be unmountable. Instructions to perform this are specific to the provider of the kernel extension.

In addition, if that kernel extension holds any private file references within the source file system, it must release those references for the file system to be unmountable. Again, instructions to perform this are specific to the provider of the kernel extension. If the problem is reproducible, try disabling the kernel extension and reboot the machine. If the problem no longer occurs with the source kernel extension inactive, then the problem will need to be pursued with the supplier of the kernel extension.

genkex is not a base AIX command. It is part of the Performance Toolbox product. In AIX 4.1 and 4.2, this is not a part of the base distribution media and must be purchased separately. It is distributed with the base operating system media in AIX 4.3.


Determining What File Systems Are Mounted within a File System

If any file system is mounted within a file system, this leaves open references in the source file system at the mount point of the other file system. Use the mount command to get a list of mounted file systems.

Here is a sample mount listing of four file systems:

mounted        mounted over 
-------        ------------ 
/dev/lv00      /database 
/dev/lv01      /database/table1 
/dev/lv02      /database/table2 
/dev/lv03      /database/table3 

In this case, the file system /database has three file systems mounted within it. The /database file system will not be unmountable until the three file systems mounted within it are unmounted.

Once all of the above steps have been verified, the file system should be in an unmountable state. If problems still exist afterward, please contact your local support organization.


Recommended Fixes

APAR Description AIX Level
IX78873 MALLOC FAILED ERRORS FROM FUSER 4.3
IX75855 PROBLEMS READING FROM NFS-MOUNTED CD 4.3
IX76120 CANNOT UNMOUNT CDROM AFTER ERROR 4.2
IX83509 PROBLEMS READING FROM NFS-MOUNTED CD 4.2
IX66132 /ETHAN MOUNTS MAY BE LEFT FROM MKINSTTAPE 4.2
IX67237 CANNOT UNMOUNT CDROM AFTER ERROR 4.1
IX83511 PROBLEMS READING FROM NFS-MOUNTED CD 4.1
IX70229 UNMOUNT FAILS WITH EBUSY 4.1

Unmounting File Systems: unmount.fs.4.krn ITEM: FAX
Dated: 99/04/30~00:00 Category: krn
This HTML file was generated 99/06/24~12:42:02
Comments or suggestions? Contact us