initscripts/etc/rc.d/init.d/mountfs

59 lines
1.6 KiB
Plaintext
Raw Normal View History

2011-04-26 12:26:24 +02:00
#!/bin/sh
# mountfs - File System Mount Script
# Based on mountfs script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans <gerard@linuxfromscratch.org>
# Modified by Davide Madrisan <davide.madrisan@gmail.com>
. /etc/sysconfig/rc
. $rc_functions
case "$1" in
start)
echo -n "Remounting root file system in read-write mode: "
mount -n -o remount,rw /
evaluate_retval
echo
# Dump dmesg to log file
dmesg > /var/log/dmesg.log
# Check that mtab is a symlink to /proc/mounts
[ -L /etc/mtab ] || {
rm -f /etc/mtab # delete if not a symlink
rm -f /etc/mtab~ /etc/mtab~~
ln -s /proc/mounts /etc/mtab
}
2011-04-26 12:26:24 +02:00
$PLYMOUTH --sysinit
2011-04-26 12:26:24 +02:00
# The follow 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,nonfs4,nosmbfs,nocifs,noproc,nosysfs,nousbdevfs,nodevfs"
2011-04-26 12:26:24 +02:00
echo -n "Mounting remaining file systems: "
mount -a -t $NO_FS
evaluate_retval
echo
;;
stop)
echo -n "Unmounting all other currently mounted file systems: "
# [ -f /proc/bus/usb/devices ] && umount /proc/bus/usb >/dev/null 2>&1
# umount -l /proc
# umount -l /sys
NO_FS="nonfs,nonfs4,nosmbfs,nocifs,noproc,nosysfs,nousbdevfs,nodevfs"
2011-04-26 12:26:24 +02:00
sync
umount -a -f -r -t $NO_FS >/dev/null 2>&1
evaluate_retval
echo
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac