From owner-freebsd-current Wed Dec 22 21:49:14 1999 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id F0DDC14CA6 for ; Wed, 22 Dec 1999 21:49:07 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (beefcake.zeta.org.au [203.26.10.12]) by mailman.zeta.org.au (8.8.7/8.8.7) with ESMTP id QAA20262; Thu, 23 Dec 1999 16:48:42 +1100 Date: Thu, 23 Dec 1999 16:48:24 +1100 (EST) From: Bruce Evans X-Sender: bde@alphplex.bde.org To: David Malone Cc: freebsd-current@FreeBSD.ORG, iedowse@maths.tcd.ie Subject: Re: fsck not cleaning on first try In-Reply-To: <199912230005.aa90222@salmon.maths.tcd.ie> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 23 Dec 1999, David Malone wrote: > The problem seems to be that I'm listing the "/dev/wd1s1a" devices > in fstab instead of "/dev/ad1s1a", and fsck doesn't recognise that > they are the same thing, and so doesn't spot that it needs to set > the hotroot flag. > > I'm not sure if this is purely a config problem, or if the compatility > devices should be more compatable. What is the root device according to mount(8)? If it is /dev/ad1s1a, then the problem would have been fixed by ignoring the fstab entry and using the actual root device, except the translation was broken by unimplementing block devices. Lightly tested fix for the translation: diff -c2 libc/gen/fstab.c~ libc/gen/fstab.c *** libc/gen/fstab.c~ Fri Oct 2 15:08:53 1998 --- libc/gen/fstab.c Sat Dec 4 00:57:09 1999 *************** *** 72,76 **** strcpy(buf, _PATH_DEV); strcat(buf, sf.f_mntfromname); ! if (stat(buf, &sb) != 0 || !S_ISBLK(sb.st_mode)) return; _fs_fstab.fs_spec = buf; --- 72,77 ---- 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; The boot loader now reads fstab and may defeat this by forcing the actual root device to the one given in fstab. setrootbyname() in the kernel could translate from "wd" to "ad" in the device name, but I don't think it does. Summary: put the actual root device in fstab unless you are working on fixing the compatibility cruft. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message