21.02.2013 Views

AIX 5L Problem Determination - IBM Redbooks

AIX 5L Problem Determination - IBM Redbooks

AIX 5L Problem Determination - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The following situations can leave open references to a mounted file system.<br />

► Files are open within a file system. These files must be closed before the file<br />

system can be unmounted. The fuser command is often the best way to<br />

determine what is still active in the file system. The fuser command will return<br />

the process IDs for all processes that have open references within a specified<br />

file system, as shown in the following example:<br />

# umount /home<br />

umount: 0506-349 Cannot unmount /dev/hd1: The requested resource is busy.<br />

# fuser -x -c /home<br />

/home: 11630<br />

# ps -fp 11630<br />

UID PID PPID C STIME TTY TIME CMD<br />

guest 11630 14992 0 16:44:51 pts/1 0:00 -sh<br />

# kill -1 11630<br />

# umount /home<br />

The process having an open reference can be killed by using the kill<br />

command (sending a SIGHUP), and the unmount can be accomplished. A<br />

stronger signal may be required, such as SIGKILL.<br />

► If the file system is still busy and still cannot be unmounted, this could be due<br />

to a kernel extension that is loaded but exists within the source file system.<br />

The fuser command will not show these kinds of references, since a user<br />

process is not involved. However, the genkex command will report on all<br />

loaded kernel extensions.<br />

► File systems are still mounted within the file system. Unmount these file<br />

systems before the file system can be unmounted. If any file system is<br />

mounted within a file system, this leaves open references in the source file<br />

system at the mount point of the other file system. Use the mount command to<br />

get a list of mounted file systems. Unmount all the file systems that are<br />

mounted within the file system to be unmounted.<br />

7.4.6 Removing file systems<br />

When removing a JFS, the file system must be unmounted before it can be<br />

removed. The command for removing file systems is rmfs.<br />

In the case of a JFS, the rmfs command removes both the logical volume on<br />

which the file system resides and the associated stanza in the /etc/filesystems<br />

file. If the file system is not a JFS, the command removes only the associated<br />

stanza in the /etc/filesystems file, as shown in the following example:<br />

# lsvg -l testvg<br />

testvg:<br />

LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT<br />

loglv00 jfslog 1 1 1 open/syncd N/A<br />

Chapter 7. LVM, file system, and disk problem determination 155

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!