From owner-freebsd-hackers Sat Nov 4 04:48:27 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id EAA15065 for hackers-outgoing; Sat, 4 Nov 1995 04:48:27 -0800 Received: from cls.net (freeside.cls.de [192.129.50.1]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id EAA15058 for ; Sat, 4 Nov 1995 04:48:24 -0800 Received: by mail.cls.net (Smail3.1.28.1) from allegro.lemis.de (192.109.197.134) with smtp id ; Sat, 4 Nov 95 12:48 GMT From: grog@lemis.de (Greg Lehey) Organisation: LEMIS, Schellnhausen 2, 36325 Feldatal, Germany Phone: +49-6637-919123 Fax: +49-6637-919122 Reply-To: grog@lemis.de (Greg Lehey) Received: (grog@localhost) by allegro.lemis.de (8.6.9/8.6.9) id NAA18913 for hackers@freebsd.org; Sat, 4 Nov 1995 13:41:47 +0100 Message-Id: <199511041241.NAA18913@allegro.lemis.de> Subject: CD automount and things To: hackers@freebsd.org Date: Sat, 4 Nov 1995 13:41:46 +0100 (MET) X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 3622 Sender: owner-hackers@freebsd.org Precedence: bulk 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"