mountfs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #Create a symlink for shared memory after /dev is mounted
  37. boot_mesg "Redirect /dev/shm to /run/shm..."
  38. ln -s /run/shm /dev/shm
  39. evaluate_retval
  40. ;;
  41. stop)
  42. boot_mesg "Unmounting all other currently mounted file systems..."
  43. umount -a -d -r >/dev/null
  44. evaluate_retval
  45. ;;
  46. *)
  47. echo "Usage: ${0} {start|stop}"
  48. exit 1
  49. ;;
  50. esac
  51. # End $rc_base/init.d/mountfs