System Administration Guide, Volume I

Unmounting File Systems

Unmounting a file system removes it from the file system mount point, and deletes the entry from the /etc/mnttab file. Some file system administration tasks cannot be performed on mounted file systems. You should unmount a file system when:

Prerequisites

The prerequisites to unmount file systems are:

Verifying an Unmounted File System

To verify that you unmounted a file system or a number of file systems, look at the output from the mount command. This is described in "How to Determine Which File Systems Are Mounted".

How to Stop All Processes for a File System

  1. Become superuser.

  2. List all the processes that are using the file system, so you know which processes you are going to stop.


    # fuser -c [ -u ] mount-point
    

    -c

    Reports on files that are mount points for file systems and any files within those mounted file systems. 

    -u

    Displays the user login name for each process ID. 

    mount-point

    The name of the file system for which you want to stop processes. 

  3. Stop all processes for the file system.


    Note -

    You should not stop a user's processes without warning.



    # fuser -c -k mount-point
    

    A SIGKILL is sent to each process using the file system.

  4. Verify that there are no processes using the file system.


    # fuser -c mount-point
    

Example--Stopping All Processes for a File System

The following example stops process 4006c that is using the /export/home file system.


# fuser -c /export/home
/export/home:     4006c
# fuser -c -k /export/home
/export/home:     4006c
# fuser -c /export/home
/export/home: 

How to Unmount a File System

Use the following procedure to unmount a file system (except / or /usr):


Note -

The root (/) and /usr file systems are special cases. The root (/) file system can be unmounted only during a shutdown, since the system needs the root (/) file system to function.


  1. Make sure you have met the prerequisites listed on "Prerequisites".

  2. Unmount the file system.


    # umount mount-point
    

    mount-point

    The name of the file system that you want to unmount. This can either be the directory name where the file system is mounted, the device name path of the file system, the resource for an NFS file system, or the loopback directory for LOFS file systems. 

Examples--Unmounting a File System

The following example unmounts a local home file system.


# umount /export/home

The following example unmounts the file system on slice 7.


# umount /dev/dsk/c0t0d0s7

How to Unmount File Systems Listed in the /etc/vfstab File

Use the following procedure to unmount all the file systems listed in the /etc/vfstab file, except for the /, /proc, /var, and /usr file systems.

  1. Make sure you have met the prerequisites listed on "Prerequisites".

  2. Unmount all the file systems listed in the /etc/vfstab file.


    # umountall
    

    All systems that are unmounted, except those that are busy.

  3. For the file systems that were busy and not unmounted, make them available to be unmounted as described in "How to Stop All Processes for a File System".

  4. Repeat Step 2 as needed until all file systems are unmounted.