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.
20 local dev mp type opts
21 if read dev mp type opts
23 # recurse - unmount later items
25 # skip / and needed virtual filesystems
27 /|/dev|/proc|/sys) return 0;;
29 # then unmount this, if possible, otherwise make
35 echo "Unmounting local filesystems..."
40 # sync to flush pending writes for loop-mounted file system.