From owner-freebsd-stable Wed Sep 18 22:14:27 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CE29637B401 for ; Wed, 18 Sep 2002 22:14:24 -0700 (PDT) Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5471D43E42 for ; Wed, 18 Sep 2002 22:14:22 -0700 (PDT) (envelope-from grog@lemis.com) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id 138328147A; Thu, 19 Sep 2002 14:44:20 +0930 (CST) Date: Thu, 19 Sep 2002 14:44:20 +0930 From: Greg 'groggy' Lehey To: Jaime Bozza Cc: freebsd-stable@FreeBSD.ORG Subject: Re: vinum ad0h/ad0s1h issue Message-ID: <20020919051420.GH37454@wantadilla.lemis.com> References: <15612.59696.734708.21623@horsey.gshapiro.net> <025001c25f43$a57fd120$6401010a@bozza> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <025001c25f43$a57fd120$6401010a@bozza> User-Agent: Mutt/1.4i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wednesday, 18 September 2002 at 13:46:06 -0500, Jaime Bozza wrote: > Recently I wrote a message regarding some filesystem problems. One of > the differences I noticed on the system was that my drives were > referencing ad0/2h instead of ad0/2s1h. I also stated that rebooting > solved the problem. > > I was just able to duplicate the problem. Here's what I found out. > > (Happens on a recent 4.7-RC, vinum configuration with start_vinum="YES") > > First, boot into single-user mode. > > Next, mount / (for rw), then run 'vinum start'. Vinum reads the data > from ad0s1h/ad2s1h correctly. > > (I had then run my fsck's and such on the drives when I had the problem) > > Exit the single-user shell (which starts booting into multiuser) > > /etc/rc and friends run 'vinum start' a second time, which causes the > system to read data from ad0h/ad2h. System seems to be fine except for > "vinum ld". When rebooting the system and letting it come up normally, > it reads the slices correctly. > > If I run "vinum stop" before exiting single-user mode, it works fine. > In fact, I can easily duplicate the error just by running "vinum start" > twice. (BTW, a third time will panic the system and cause vinum to read > the ad0h/ad2h on reboot) Hmm. This is beginning to make a little more sense. > You said it was a known problem. How difficult would it be to > ingore subsequent start's (The overall start kind) once vinum has > already been "started", or could there be a situation where you'd > want to start it more than once? Yes. > (I can't think of any) You hot plug some drives into the system and want to start them. I think I now understand the problem here. Try the following patch and tell me if it solves the problem: --- vinumio.c 2 May 2002 08:43:44 -0000 1.52.2.6 +++ vinumio.c 19 Sep 2002 05:10:27 -0000 @@ -883,29 +883,6 @@ } } } - if (founddrive == 0) { /* didn't find anything, */ - for (part = 'a'; part < 'i'; part++) /* try the compatibility partition */ - if (part != 'c') { /* don't do the c partition */ - snprintf(partname, /* /dev/sd0a */ - DRIVENAMELEN, - "%s%c", - devicename[driveno], - part); - drive = check_drive(partname); /* try to open it */ - if ((drive->lasterror != 0) /* didn't work, */ - ||(drive->state != drive_up)) - free_drive(drive); /* get rid of it */ - else if (drive->flags & VF_CONFIGURED) /* already read this config, */ - log(LOG_WARNING, - "vinum: already read config from %s\n", /* say so */ - drive->label.name); - else { - drivelist[gooddrives] = drive->driveno; /* keep the drive index */ - drive->flags &= ~VF_NEWBORN; /* which is no longer newly born */ - gooddrives++; - } - } - } } if (gooddrives == 0) { The problem here is that vinum_scandisk() tries to read from each slice. If it doesn't find any (for example, on a dedicated disk), it tries the compatibility slice. That normally works fine, but if all of the slices have already been read, it still falls through into this part. Removing it should solve your problem; the real solution is a little more complicated and involves recognizing that we already know this drive. I probably won't do that until I finally have the root file system running on Vinum, which will require mods in this same area. Greg -- See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message