S6-LINUX-INIT-UMOUNTALL(8)

NAME
s6-linux-init-umountall - unmount all filesystems

SYNOPSIS
s6-linux-init-umountall

DESCRIPTION
s6-linux-init-umountall unmounts all filesystems.

s6-linux-init-umountall unmounts all filesystems according to /proc/mounts. It processes /proc/mounts in the reverse order, starting with the most recently mounted partition and ending with the root filesystem ( “unmounting” the root filesystem means remounting it read-only).

It makes an exception for the first instances of devtmpfs, proc and sysfs filesystem types, but not for later instances. In other words: it does not attempt to unmount /dev, /proc and /sys, but it will attempt to unmount duplicates of those pseudo-filesystems.

s6-linux-init-umountall does not touch /etc/mtab.

If a filesystem fails to unmount, a warning is printed to stderr, but s6-linux-init-umountall still attempts to unmount all the other ones.

s6-linux-init-umountall is automatically called at the very end of the shutdown procedure, in “stage 4”, i.e. after a SIGKILL has been sent to all the processes on the system, and right before the system reboots ( or halts, or is powered off). By that point, there is no possible process that could prevent real file systems from being unmounted.

It is likely that some filesystems will still fail to unmount, typically cgroups or tmpfses. That's okay: those are pseudo-filesystems, and will not cause data loss or a fsck if the system shuts down while they are still mounted.

Distributions usually provide a umount(8) command with a -a option to unmount all filesystems. That command is usually bloated with historical artifacts and relies on unsafe interfaces, so it was decided not to use it.

EXIT STATUS
s6-linux-init-umountall returns the number of errors it encountered when attempting to unmount the filesystems listed in /proc/mounts.

SEE ALSO
s6-linux-init-echo(1), s6-linux-init-overview(7), s6-linux-init-quickstart(7), s6-linux-init-why(7), s6-linux-init(8), s6-linux-init-hpr(8), s6-linux-init-logouthookd(8), s6-linux-init-maker(8), s6-linux-init-nuke(8), s6-linux-init-shutdown(8), s6-linux-init-shutdownd(8), s6-linux-init-telinit(8)

This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6-linux-init/s6-linux-init-umountall.html

AUTHORS
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)