From owner-freebsd-current@FreeBSD.ORG Thu Jun 9 19:06:06 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 90AD416A41C for ; Thu, 9 Jun 2005 19:06:06 +0000 (GMT) (envelope-from noackjr@alumni.rice.edu) Received: from smtp808.mail.sc5.yahoo.com (smtp808.mail.sc5.yahoo.com [66.163.168.187]) by mx1.FreeBSD.org (Postfix) with SMTP id 4743E43D4C for ; Thu, 9 Jun 2005 19:06:06 +0000 (GMT) (envelope-from noackjr@alumni.rice.edu) Received: (qmail 89191 invoked from network); 9 Jun 2005 19:06:06 -0000 Received: from unknown (HELO optimator.noacks.org) (noacks@swbell.net@70.240.186.139 with login) by smtp808.mail.sc5.yahoo.com with SMTP; 9 Jun 2005 19:06:05 -0000 Received: from localhost (localhost [127.0.0.1]) by optimator.noacks.org (Postfix) with ESMTP id B5D0B60D4; Thu, 9 Jun 2005 14:06:04 -0500 (CDT) Received: from optimator.noacks.org ([127.0.0.1]) by localhost (optimator.noacks.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 09950-05; Thu, 9 Jun 2005 14:06:02 -0500 (CDT) Received: from compgeek.noacks.org (compgeek [192.168.1.10]) by optimator.noacks.org (Postfix) with ESMTP id E2C2960D2; Thu, 9 Jun 2005 14:06:02 -0500 (CDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by compgeek.noacks.org (8.13.4/8.13.3) with ESMTP id j59J62Op002684; Thu, 9 Jun 2005 14:06:02 -0500 (CDT) (envelope-from noackjr@alumni.rice.edu) Message-ID: <42A89316.1000706@alumni.rice.edu> Date: Thu, 09 Jun 2005 14:05:58 -0500 From: Jonathan Noack User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050428) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Oberman References: <20050609185113.2BB295D07@ptavv.es.net> In-Reply-To: <20050609185113.2BB295D07@ptavv.es.net> X-Enigmail-Version: 0.91.0.0 OpenPGP: id=991D8195; url=http://www.noacks.org/cert/noackjr.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5EA6DD04A0289C89A4390AC4" X-Virus-Scanned: amavisd-new at noacks.org Cc: Randy Bush , FreeBSD Current , Rainer Duffner Subject: Re: boot0cfg and kern.geom.debugflags X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: noackjr@alumni.rice.edu List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2005 19:06:06 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5EA6DD04A0289C89A4390AC4 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 06/09/05 13:51, Kevin Oberman wrote: >>Date: Thu, 09 Jun 2005 13:06:27 -0500 >>From: Jonathan Noack >>Sender: owner-freebsd-current@freebsd.org >> >>On 06/09/05 09:02, Randy Bush wrote: >>>>I looked in my archives (well, it's actually at gmane): >>>> >>>>I got this from Doug White: >>>> >>>>>This is a erroneous message. The actual problem is: >>>>> >>>>>> 484 boot0cfg NAMI "/dev/twed0" >>>>>> 484 boot0cfg RET open -1 errno 1 Operation not permitted >>>>>> >>>>>>This is a known problem with certain MBR layouts. To work around this >>>>>>problem, set: >>>>>> >>>>>>sysctl kern.geom.debugflags=16 >>>>>>then try your boot0cfg. There's a protection mechanism that sometimes gets >>>>>>confused by certain partition table layouts. Flag 16 disables that >>>>>>protection. I don't recommend running this unless you are explicitly >>>>>>trying to updating something in a partition table-like area; its very easy >>>>>>to destroy your system with the flag set! >>>> >>>>Can you try this? >>> >>>bingo!!! >>> >>> # sysctl kern.geom.debugflags=16 >>> kern.geom.debugflags: 0 -> 16 >>> # boot0cfg -B -d 1 -s 1 -v twed0 >>> # flag start chs type end chs offset size >>> 1 0x80 0: 1: 1 0xa5 1023:254:63 63 72292437 >>> >>> version=1.0 drive=0x1 mask=0xf ticks=182 >>> options=packet,update,nosetdrv >>> default_selection=F1 (Slice 1) >> >> From what I gather from Poul-Henning Kamp's posts on the matter, this >>is a design feature and not a bug. If a disk is mounted in any way >>(including read-only), you may not update the MBR to prevent foot >>shooting. The real problem is that the error that is returned gives >>little information. There has not been a consensus on how to make >>things easier for the user. Various ways to print friendly error >>messages have been proposed and shot down. >> >>This issue is documented in boot0cfg(8) as the first entry in the BUGS >>section: >>"Protection mechanisms in the geom(4) subsystem might prevent boot0cfg >>from being able to update the MBR on a mounted disk. Instructions for >>temporarily disabling these protection mechanisms can be found in the >>geom(4) manpage." >> >>Under the DIAGNOSTICS section of geom(4) describing the use of the >>kern.geom.debugflags sysctl: >>"0x10 (allow foot shooting) >>Allow writing to Rank 1 providers. This would, for example, allow the >>super-user to overwrite the MBR on the root disk or write random sectors >>elsewhere to a mounted disk. The implications are obvious." >> >>I'm not sure what "tracing" is so I don't understand why 0x02 and 0x04 >>are necessary (to give us 0x16). > > I think you forgot which bases the numbers are in. 16base10 is the same > thing as 0x10. No other flags are involved. Or 16(10) = 10(16). *blush* I never considered they would be listed with different bases, although that makes perfect sense. Thanks! -- Jonathan Noack | noackjr@alumni.rice.edu | OpenPGP: 0x991D8195 --------------enig5EA6DD04A0289C89A4390AC4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFCqJMaUFz01pkdgZURAqNoAKDQ4pb+a+VAZSKoQ/vLvNEadSPVQQCfZXNY nuBGv2QHBDfQWxwEp5IaAuI= =CUoR -----END PGP SIGNATURE----- --------------enig5EA6DD04A0289C89A4390AC4--