mountfs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. mount -f /run || failed=1
  29. (exit ${failed})
  30. evaluate_retval
  31. # This will mount all filesystems that do not have _netdev in
  32. # their option list. _netdev denotes a network filesystem.
  33. boot_mesg "Mounting remaining file systems..."
  34. mount -a -O no_netdev >/dev/null
  35. evaluate_retval
  36. ;;
  37. stop)
  38. boot_mesg "Unmounting all other currently mounted file systems..."
  39. umount -a -d -r >/dev/null
  40. evaluate_retval
  41. ;;
  42. *)
  43. echo "Usage: ${0} {start|stop}"
  44. exit 1
  45. ;;
  46. esac
  47. # End $rc_base/init.d/mountfs