Forced Unmount

A collection of the known forced unmount implementations for Linux.


Fumount Script

Description

A rather ugly bash script that attempts to kill all processes accessing a filesystem, then umount the filesystem. If the umount still fails, a lazy umount is performed (see the mount man page), then the script continues trying to kill processes while the device is still in use. The basic algorithm looks like this:

Files


Kernel Implementation 1

Description

This implementation gives the ability to (really) force unmount a file system. It closes all the open files, flushes their contents, releases file locks and tears down memory maps for the files. The util-linux patch is needed to add the -F option to the mount command.

Files


Kernel Implementation 2

Description

This implementation adds a new filesystem called badfs. A forced unmount replaces a process' directories and files with badfs equivalents that return EIO on all operations. This removes references to the filesystem we're trying to unmount, and allows processes to catch the EIO and exit gracefully. For more details, see the comments in the broken-out patches against the most recent version of the kernel.

Files