From owner-freebsd-hackers Thu May 2 09:13:51 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id JAA07799 for hackers-outgoing; Thu, 2 May 1996 09:13:51 -0700 (PDT) Received: from diablo.ppp.de (diablo.ppp.de [193.141.101.34]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id JAA07782 for ; Thu, 2 May 1996 09:13:37 -0700 (PDT) Received: from allegro.lemis.de by diablo.ppp.de with smtp (Smail3.1.28.1 #1) id m0uF10W-000QXyC; Thu, 2 May 96 18:13 MET DST From: grog@lemis.de (Greg Lehey) Organisation: LEMIS, Schellnhausen 2, 36325 Feldatal, Germany Phone: +49-6637-919123 Fax: +49-6637-919122 Received: (grog@localhost) by allegro.lemis.de (8.6.9/8.6.9) id SAA11265 for hackers@freebsd.org; Thu, 2 May 1996 18:07:01 +0200 Message-Id: <199605021607.SAA11265@allegro.lemis.de> Subject: New disks on 2.1-RELEASE: help To: hackers@freebsd.org (FreeBSD Hackers) Date: Thu, 2 May 1996 18:07:00 +0200 (MET DST) X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I'm currently in the process of writing up how to set up a second hard disk on 2.1 RELEASE. This has been slightly hampered by 2 problems: 1. I currently don't have a disk with 2.1 RELEASE, and I don't have time to rebuild things to install it (there's a whole lot of work backed up there). 2. There's a bug in -current disklabel, probably as the result of a kernel change. I'll get back to that in a minute. So: my question. Would some kind soul please try this with a SCSI disk they don't mind overwriting. Please stick very closely to the sequence (or tell me why it's broken :-), since that's what I'm going to write. Obviously the disk doesn't have to be sd1. 1. Format: scsiformat sd1 2. fdisk -u sd1 Put at least 2 partitions in. 3. disklabel -w -r sd1 is a tag in /etc/disktab. If you don't have one for your disk, and you don't know how to make one, but you're prepared to let the rest of the ordeal pass over you, contact me and I'll send you my writeup tomorrow. It's currently too flaky to send. Back to the problem: disklabel issues an ioctl (DIOCSDINFO) against the raw disk, and then checks the return value. disklabel.c:408: if (ioctl(f, DIOCSDINFO, lp) < 0 && errno != ENODEV && errno != ENOTTY) { l_perror("ioctl DIOCSDINFO"); return (1); } In the -current kernel, this ioctl returns an EINVAL when issued against a disk with an invalid label. I changed this to: if (ioctl(f, DIOCSDINFO, lp) < 0 && errno != ENODEV && errno != ENOTTY && errno != EINVAL) { l_perror("ioctl DIOCSDINFO"); return (1); } and things now work. That doesn't help the users of 2.1, of course, and I'd rather like this to be correct. Greg