From owner-freebsd-hackers Fri Jul 21 17:24:58 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mass.osd.bsdi.com (adsl-63-202-177-51.dsl.snfc21.pacbell.net [63.202.177.51]) by hub.freebsd.org (Postfix) with ESMTP id 66C9337C51A for ; Fri, 21 Jul 2000 17:22:29 -0700 (PDT) (envelope-from msmith@mass.osd.bsdi.com) Received: from mass.osd.bsdi.com (localhost [127.0.0.1]) by mass.osd.bsdi.com (8.9.3/8.9.3) with ESMTP id RAA02106; Fri, 21 Jul 2000 17:31:58 -0700 (PDT) (envelope-from msmith@mass.osd.bsdi.com) Message-Id: <200007220031.RAA02106@mass.osd.bsdi.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: Doug White Cc: hackers@freebsd.org Subject: Re: suprising mount root behavior In-reply-to: Your message of "Fri, 21 Jul 2000 17:02:44 PDT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 21 Jul 2000 17:31:58 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Some new root mount behavior in 4.0 just saved my bacon, but I'm curious > as to how it's implemented. 8) > My custom installer accidentally created fstab entries for IDE disks on a > SCSI-only system. Thus, fstab point to /dev/ad0s1a for / and /dev/ad0s1b > for swap. > > I rebooted the system to try and fix it, and lo and behold it booted up > correctly! I had no swap but root was mounted RW so I could fix the > fstab. > > Now my question is: How did it know? I'm not setting vfs.root.mountfrom > in the loader. > > Also, how did mount know to not override the / mountpoint to the one from > fstab (and subsequently fail)? There's a complex order of battle associated with mounting /. 8) You can read /sys/kern/vfs_conf.c:vfs_mountroot() and associated stuff to get the gory details, but the bottom line is that there are several layers of fallback, and you were saved by the one that looks at the major and minor numbers passed in by the bootloader and tries them if the fstab entry fails. -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message