#!/bin/bash # $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/mountfs,v 1.4 2005-07-03 21:32:06 niro Exp $ #%rlevels: 7:s 0:k 6:k #%start: 40 #%stop: 60 #deps #%needs: #%before: #%after: source /etc/sysconfig/rc source $rc_functions case "$1" in start) echo -e ${COLOREDSTAR}"Remounting root file system in read-write mode ..." mount -n -o remount,rw / evaluate_retval echo -e ${COLOREDSTAR}"Recording existing mounts in /etc/mtab ..." > /etc/mtab mount -f / && mount -f /proc # records devfs as mounted if is_fs_mounted devfs then mount -f -t devfs devfs /dev fi # records devpts as mounted if is_fs_mounted devpts then mount -f -t devpts devpts /dev/pts fi # records sysfs as mounted if is_fs_mounted sysfs then mount -f -t sysfs sysfs /sys fi # records udev as mounted if is_fs_mounted udev then mount -f -t ramfs udev /dev fi 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 will be skipped. NO_FS="nonfs,nosmbfs,noproc,nocoda,noncpfs,noshm" echo -e ${COLOREDSTAR}"Mounting remaining file systems ..." mount -a -t $NO_FS evaluate_retval update_svcstatus $1 splash svc_started "$(basename $0)" 0 ;; stop) echo -e ${COLOREDSTAR}"Unmounting all other currently mounted file systems ..." if [ -e /dev/.udev ] then NO_FS="noramfs" umount -a -r -d -t ${NO_FS} else # -d, umount loop devices as well umount -a -r -d fi evaluate_retval update_svcstatus $1 splash svc_stopped "$(basename $0)" 0 ;; *) echo "Usage: $0 {start|stop}" exit 1 ;; esac