From owner-freebsd-hackers Tue Jun 12 15: 4:14 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from hokkshideh.jetcafe.org (hokkshideh.jetcafe.org [205.147.43.4]) by hub.freebsd.org (Postfix) with ESMTP id D3A5637B401 for ; Tue, 12 Jun 2001 15:04:10 -0700 (PDT) (envelope-from dave@jetcafe.org) Received: from hokkshideh.jetcafe.org (localhost [127.0.0.1]) by hokkshideh.jetcafe.org (8.8.8/8.8.5) with ESMTP id PAA04457 for ; Tue, 12 Jun 2001 15:04:10 -0700 (PDT) Message-Id: <200106122204.PAA04457@hokkshideh.jetcafe.org> X-Mailer: exmh version 2.2 06/23/2000 with version: MH 6.8.4 #1[UCI] To: freebsd-hackers@FreeBSD.ORG Subject: The real answer to Re: Why does fsck try to fsck a CDROM? Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 12 Jun 2001 15:04:10 -0700 From: Dave Hayes Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Well I found the problem. It's related to this routine I found in /usr/src/lib/libc/gen/fstab.c: static void fixfsfile() { static char buf[sizeof(_PATH_DEV) + MNAMELEN]; struct stat sb; struct statfs sf; if (strcmp(_fs_fstab.fs_file, "/") != 0) return; if (statfs("/", &sf) != 0) return; if (sf.f_mntfromname[0] == '/') buf[0] = '\0'; else strcpy(buf, _PATH_DEV); strcat(buf, sf.f_mntfromname); if (stat(buf, &sb) != 0 || (!S_ISBLK(sb.st_mode) && !S_ISCHR(sb.st_mode))) return; _fs_fstab.fs_spec = buf; } This apparently tries to make sure that whatever is mounted on "/" loads the actual device it is mounted on in the fs_spec section of the struct. The bottom line to all this is that if there is any line in an /etc/fstab that mounts on "/", fsck will use the device actually mounted as root, and not the one in the file. Back to the drawing board. ------ Dave Hayes - Consultant - Altadena CA, USA - dave@jetcafe.org >>> The opinions expressed above are entirely my own <<< Nasrudin was driving a friend in his car at a spanking pace. Suddenly, glimpsing a signpost, the friend called out "Mulla, we're going in the wrong direction!" "Why don't you ever think of something good?" came the reply. "Just look, for instance, at the speed we are going at." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message