3 # umountfs Turn off swap and unmount all local filesystems.
6 PATH=/sbin:/bin:/usr/sbin:/usr/bin
8 # Ensure /proc is mounted
9 test -r /proc/mounts || mount -t proc proc /proc
11 echo "Deactivating swap..."
14 # We leave /proc mounted, the umount of /dev/devpts seems to fail
15 # quite frequently, the busybox umount apparently gives up at the
16 # first failure, so it is necessary to go file system by file
17 # system. It is necessary to go backward in the /proc list, because
18 # later things may have been mounted on earlier mounts.
21 local dev mp type opts
22 if read dev mp type opts
24 # recurse - unmount later items
26 # skip /proc and /dev but not the sub-directories
32 # then unmount this, if possible, otherwise make
38 echo "Unmounting local filesystems..."
41 # now /dev and read-only / (halt/reboot may need /proc!)
42 test -n "$devfs" && umount -f -r /dev