#!/bin/bash
# Begin $rc_base/init.d/mountfs - File System Mount Script

# Based on mountfs script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
	start)
		echo "Remounting root file system in read-write mode..."
		mount -n -o remount,rw /
		evaluate_retval

		echo "Recording existing mounts in /etc/mtab..."
		> /etc/mtab
		mount -f / && mount -f /proc
		# add /dev above if you use devfs
		evaluate_retval

		# The following mount command will mount all file systems. If you
		# have other (network based) file system that should not be or
		# cannot be mounted at this time, add them to the NO_FS variable
		# below. All file systems that are added to the variable in the
		# form of no<filesystem> will be skipped.

		NO_FS="nonfs,nosmbfs,noproc"
		echo "Mounting remaining file systems..."
		mount -a -t $NO_FS
		evaluate_retval
		;;

	stop)
		echo "Unmounting all other currently mounted file systems..."
		umount -a -r
		evaluate_retval
		;;

	*)
		echo "Usage: $0 {start|stop}"
		exit 1
		;;
esac

# End $rc_base/init.d/mountfs

