#!/bin/sh # # PROVIDE: mountfs # REQUIRE: SERVERS checkfs # BEFORE: NETWORKING $_rc_subr_loaded . /etc/rc.subr name="mountfs" start_cmd="mountfs_start" stop_cmd=":" NETFS="nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,nosysfs,noshfs,nofuse,nofuseblk" mountfs_start() { echo -n "=> Mounting local filesystems... " mount -n -o remount,rw / rm -f /etc/mtab* # make sure / gets written to /etc/mtab mount -o remount,rw / # Write /proc, /sys and /dev to /etc/mtab if [ -e /proc/mounts ]; then grep -e "/proc " -e "/sys " -e "/dev " /proc/mounts \ >> /etc/mtab fi # now mount all the local filesystems mount -a -t $NETFS echo "done." } load_rc_config $name run_rc_command "$1"