Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Dec 1999 16:48:24 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        David Malone <dwmalone@maths.tcd.ie>
Cc:        freebsd-current@FreeBSD.ORG, iedowse@maths.tcd.ie
Subject:   Re: fsck not cleaning on first try
Message-ID:  <Pine.BSF.4.10.9912231635350.21985-100000@alphplex.bde.org>
In-Reply-To: <199912230005.aa90222@salmon.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9912231635350.21985-100000>