From owner-freebsd-hackers Sat Jan 25 18:38:22 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D4E537B401 for ; Sat, 25 Jan 2003 18:38:20 -0800 (PST) Received: from kestrel.alerce.com (kestrel.alerce.com [209.182.219.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id 74A4043ED8 for ; Sat, 25 Jan 2003 18:38:19 -0800 (PST) (envelope-from hartzell@rosebud.alerce.com) Received: from rosebud.alerce.com (w092.z064001164.sjc-ca.dsl.cnc.net [64.1.164.92]) by kestrel.alerce.com (8.12.4/8.12.4) with ESMTP id h0Q2c2k6081348 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Sat, 25 Jan 2003 18:38:03 -0800 (PST) (envelope-from hartzell@rosebud.alerce.com) X-Authentication-Warning: kestrel.alerce.com: Host w092.z064001164.sjc-ca.dsl.cnc.net [64.1.164.92] claimed to be rosebud.alerce.com Received: from rosebud.alerce.com (rosebud.alerce.com [127.0.0.1]) by rosebud.alerce.com (8.12.7/8.12.7) with ESMTP id h0Q2c8N0090373 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 25 Jan 2003 18:38:09 -0800 (PST) (envelope-from hartzell@rosebud.alerce.com) Received: (from hartzell@localhost) by rosebud.alerce.com (8.12.7/8.12.6/Submit) id h0Q2c79N090370; Sat, 25 Jan 2003 18:38:07 -0800 (PST) From: George Hartzell MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15923.18959.507300.156728@rosebud.alerce.com> Date: Sat, 25 Jan 2003 18:38:07 -0800 To: freebsd-hackers@freebsd.org Subject: Problem opening /dev/ad0{,s2} O_RDWR (also disklabel, grub) on 5.0. X-Mailer: VM 7.07 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid Reply-To: hartzell@kestrel.alerce.com (George Hartzell) 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 Hi I'm trying to set up my first 5.0 machine, and I've run into a problem right off of the bat. The machine is a Dell OptiPlex GX110 that has three slices. The first contains Windows 2000, the second has historically contained FreeBSD 4.7,and the third contains Linux. Since I use the system to test stuff before I roll it onto my laptop, and since the laptop seems to need it's original MBR in place so that suspend to disk works properly, I've been running the Dell with GRUB installed in the beginning of the freebsd slice (which is active) [(hd0,1) or /dev/ad0s2] and it's been working great. I tried to do a standard install from the 5.0 release ISO images. After answering all of the standard questions and telling it to go ahead, it spat out an error message as it was presumably setting up the disk. The screen redraws fast enough that I cant' catch the message, but I've tried a couple of times and it's happened each time. When I tried to boot up, I get a message about an unbootable operating system from the code in the MBR. Booting from CD 2, interrupting the loader, setting currdev=disk1s2a: and then "boot /boot/kernel/kernel" brings the machine up just fine. I tried building grub and it wouldn't admit that there was an (hd0,1). Oddly enough, starting grub with --read-only made it able to see (hd0,1). Inside gdb, I noticed that an open of "/dev/ad0" with O_RDWR was returning -1 and setting errno = 1 (EPERM, "Operation not permitted"). Some playing with 'call open("/dev/ad0", 0)', 'call open("/dev/ad0", 1)', and 'call open("/dev/ad0", 2)' made it clear that anything that would write to the disk was failing. I stepped back and started digging around with disklabel, and got some results that seem similar. disklabel -B /dev/ad0s2 auto should reinstall the boot stuff on that slice, but instead it says disklabel: /dev/ad0s2: Operation not permitted and I get the same error message from disklabel -W /dev/ad0s2. So, my questions are: 1) does this ring a bell with anyone? 2) Is there something in 5.0 that requires special magic to write to the raw disk devices? 3) Am I being a bonehead? g. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message