Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Nov 1995 13:41:46 +0100 (MET)
From:      grog@lemis.de (Greg Lehey)
To:        hackers@freebsd.org
Subject:   CD automount and things
Message-ID:  <199511041241.NAA18913@allegro.lemis.de>

next in thread | raw e-mail | index | archive | help
OK, guys, you've said so much that I don't think there's any point
boring you with replying to individual points.  Here's what I see:

1. Currently, /etc/rc contains:

   mount -a -t nonfs
   if [ $? != 0 ]; then
        echo "Filesystem mount failed, startup aborted"
        exit 1
   fi

   By comparison, BSD/OS contains:

   umount -a >/dev/null 2>&1

   More generally, I don't know *any* other operating system which
   fails to come up if the mount fails.  Admittedly, it makes sense to
   drop back into single user mode if you can't mount /usr, but it
   generally doesn't make much sense for any other file system.  We
   only see this problem with /cdrom because it's the most likely to
   fail.  My FreeBSD box has a separate shoebox with a disk, tape and
   CD-ROM in it.  If I forget to power on the shoebox, my mounts will
   obviously fail, but since there's nothing essential to system
   startup there, there's no reason to abort the startup.  So, how
   about the following changes:

   - add a variable 'essential-fs' to sysconfig, and set it to the
     names of the file systems essential for normal system startup,
     e.g.
     
     essential-fs="/usr /var"

   - mount these explicitly.

   I've done all this, and it works.  The diffs follow.

Any comments?
Greg

--- 1.1 1995/09/29 14:03:24
+++ rc  1995/11/04 12:33:44
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $Id: rc,v 1.1 1995/09/29 14:03:24 grog Exp $
+#      $Id: rc,v 1.2 1995/11/04 12:33:44 grog Exp $
 #      From: @(#)rc    5.27 (Berkeley) 6/5/91
 
 # System startup script run by init on autoboot
@@ -62,21 +62,34 @@
 
 trap "echo 'Reboot interrupted'; exit 1" 3
 
+# If there is a global system configuration file, suck it in.
+if [ -f /etc/sysconfig ]; then
+       . /etc/sysconfig
+fi
+
 # root must be read/write both for NFS diskless and for VFS LKMs before
 # proceeding any further.
 mount -u -o rw /
 if [ $? != 0 ]; then
-       echo "Filesystem mount failed, startup aborted"
+       echo "Remount of root filesystem failed, startup aborted"
        exit 1
 fi
 
-umount -a >/dev/null 2>&1
-
-mount -a -t nonfs
-if [ $? != 0 ]; then
-       echo "Filesystem mount failed, startup aborted"
+# I don't understand this.  Are we relying on umount / failing?
+# (Grog, 4 November 1995)
+# umount -a >/dev/null 2>&1
+
+for i in $essential_fs; do
+  if egrep "[  ]+$i[   ]+" /etc/fstab; then
+     echo Mounting $i
+     mount $i
+     if [ $? != 0 ]; then      # lose, lose
+         echo Can\'t mount $i.  Going into single-user mode.
        exit 1
 fi
+   fi
+done
+mount -a -t nonfs
 
 # If the machine runs wall CMOS clock (compatible with MSDOS),
 # activate following line by creating empty file /etc/wall_cmos_clock
@@ -83,11 +96,6 @@
 # If this file not exist, following line does nothing (assumed
 # the machine runs UTC CMOS clock). See adjkerntz(8) for details.
 adjkerntz -i
-
-# If there is a global system configuration file, suck it in.
-if [ -f /etc/sysconfig ]; then
-       . /etc/sysconfig
-fi
 
 # configure serial devices
 if [ -f /etc/rc.serial ]; then
--- 1.14.4.5    1995/09/19 12:09:03
+++ sysconfig   1995/11/04 12:32:15
@@ -4,7 +4,7 @@
 # This is sysconfig - a file full of useful variables that you can set 
 # to change the default startup behavior of your system.
 #
-#      $Id: sysconfig,v 1.14.4.5 1995/09/19 12:09:03 jkh Exp $
+#      $Id: sysconfig,v 1.16 1995/11/04 12:31:56 grog Exp grog $
 
 ######################### Start Of Syscons Section #######################
 
@@ -188,3 +188,5 @@
 
 # Set to YES if you want ibcs2 (SCO) emulation loaded at startup
 ibcs2=NO
+
+essential_fs="/usr /var"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511041241.NAA18913>