umountfs 540 B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides: umountfs
  4. # Required-Start:
  5. # Required-Stop:
  6. # Default-Start:
  7. # Default-Stop: 0 6
  8. # Short-Description: Turn off swap and unmount all local file systems.
  9. # Description:
  10. ### END INIT INFO
  11. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  12. echo "Deactivating swap..."
  13. [ -x /sbin/swapoff ] && swapoff -a
  14. # We leave /proc mounted.
  15. echo "Unmounting local filesystems..."
  16. grep -q /mnt/ram /proc/mounts && mount -o remount,ro /mnt/ram
  17. mount -o remount,ro /
  18. umount -f -a -r > /dev/null 2>&1
  19. : exit 0