mountfs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/sh
  2. ########################################################################
  3. # Begin $rc_base/init.d/mountfs
  4. #
  5. # Description : File System Mount Script
  6. #
  7. # Authors : Gerard Beekmans - gerard@linuxfromscratch.org
  8. #
  9. # Version : 00.00
  10. #
  11. # Notes :
  12. #
  13. ########################################################################
  14. . /etc/sysconfig/rc
  15. . ${rc_functions}
  16. case "${1}" in
  17. start)
  18. boot_mesg "Remounting root file system in read-write mode..."
  19. mount -n -o remount,rw / >/dev/null
  20. evaluate_retval
  21. # Remove fsck-related file system watermarks.
  22. rm -f /fastboot /forcefsck
  23. boot_mesg "Recording existing mounts in /etc/mtab..."
  24. > /etc/mtab
  25. mount -f / || failed=1
  26. mount -f /proc || failed=1
  27. mount -f /sys || failed=1
  28. (exit ${failed})
  29. evaluate_retval
  30. # This will mount all filesystems that do not have _netdev in
  31. # their option list. _netdev denotes a network filesystem.
  32. boot_mesg "Mounting remaining file systems..."
  33. mount -a -O no_netdev >/dev/null
  34. evaluate_retval
  35. ;;
  36. stop)
  37. boot_mesg "Unmounting all other currently mounted file systems..."
  38. umount -a -d -r >/dev/null
  39. evaluate_retval
  40. ;;
  41. *)
  42. echo "Usage: ${0} {start|stop}"
  43. exit 1
  44. ;;
  45. esac
  46. # End $rc_base/init.d/mountfs