From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 17 10:33:30 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95D36106566C; Mon, 17 Sep 2012 10:33:30 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from tower.berklix.org (tower.berklix.org [83.236.223.114]) by mx1.freebsd.org (Postfix) with ESMTP id 032B98FC0A; Mon, 17 Sep 2012 10:33:29 +0000 (UTC) Received: from mart.js.berklix.net (p57BCFB12.dip.t-dialin.net [87.188.251.18]) (authenticated bits=0) by tower.berklix.org (8.14.2/8.14.2) with ESMTP id q8HAXKYw061207; Mon, 17 Sep 2012 10:33:21 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id q8HAX9WS028091; Mon, 17 Sep 2012 12:33:09 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.4/8.14.4) with ESMTP id q8HAWVMe039745; Mon, 17 Sep 2012 12:32:37 +0200 (CEST) (envelope-from jhs@fire.js.berklix.net) Message-Id: <201209171032.q8HAWVMe039745@fire.js.berklix.net> To: freebsd-hackers@freebsd.org From: "Julian H. Stacey" Organization: http://berklix.com BSD Unix Linux Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://berklix.com/free/ X-URL: http://www.berklix.com In-reply-to: Your message "Sun, 16 Sep 2012 10:41:49 BST." Date: Mon, 17 Sep 2012 12:32:31 +0200 Sender: jhs@berklix.com Cc: Chris Rees , Yuri , Benjamin Kaduk Subject: Re: Why fdisk can't open root disk with MBR for writing? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 10:33:30 -0000 Chris Rees wrote: > On 16 September 2012 10:23, Julian H. Stacey wrote: > > This is a resend as Benjamin Kaduk > > dropped the > > Yuri > > from CC line, & Yuri was the original first poster in thread who > > my patch would presumably have helped. > > > > Reference: > >> From: Benjamin Kaduk > >> Date: Sat, 15 Sep 2012 14:49:41 -0400 (EDT) > >> Message-id: > > > > Benjamin Kaduk wrote: > >> On Sat, 15 Sep 2012, Julian H. Stacey wrote: > >> > >> > I have been applying this diff to my man fdisk: > >> > > >> > http://berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/gen/sbin/fdisk/ > >> > > >> > *** 8.0-RELEASE/src/sbin/fdisk/fdisk.8 Sat Mar 14 22:32:16 2009 > >> > --- new-generic/src/sbin/fdisk/fdisk.8 Sat Mar 14 22:35:10 2009 > >> > *************** > >> > *** 462,464 **** > >> > --- 462,468 ---- > >> > The > >> > .Xr bsdlabel 8 > >> > command must be used for this. > >> > + .Pp > >> > + When running multi user, you cannot write unless you first run this: > >> > + .br > >> > + sysctl kern.geom.debugflags=16 > >> > > >> > I never submitted it as a send-pr, > >> > anyone think I should submit it to help save people ? > >> > >> We have had a long discussion about kern.geom.debugflags starting here: > >> http://lists.freebsd.org/pipermail/freebsd-current/2011-October/028090.html > >> My understanding from that discussion is that your patch should not be > >> accepted. > > > > Got to travel now, will read that thread later, > > > > A shame if we would leave fdisk crippled undocumented, when so easy > > to doc. the solution. Fdisk is known across many OSs Unix & beyond, > > our BSD tools may be better nicer, but fdisk it what many will first > > reach for, > > a shame not to help newer people & visitors used to fdisk. > > We inside FreeBSD crippled fdisk by adding these flags. Outsiders > > wont expect the weirdness & get impression FreeBSD has a bug. > > I think you have a point, but at the moment fdisk really doesn't work > properly at all; I find so many people complaining on IRC about "Why > doesn't fdisk work?" Long ago I used to have a lot of failures from fdisk, till some kind soul on a mail list rescued me with sysctl kern.geom.debugflags=16 One can but speculate how many others could be saved if we add a note to man fdisk (or as below per Chris, better fix the source). We should also add to 'man fdisk' SEE ALSO gpart(1) Adding both would rescue maximal people & point the way ahead. > To be honest, I'd be happy with replacing fdisk with a huge warning > "USE GPART!!"; fdisk isn't really standard anyway. For visitors from other Unixes, they'll look for fdisk. (I've never bothered moving to geom / gpart myself, fdisk works fine for me with debugflags=16) > The alternative of course is to fix fdisk... *properly*. Yes, better than adding to manual to document the bug, would be to fix src/ (IMO should have been done way back by those who introduced the bit in kern.geom.debugflags that broke fdisk). I'd be tempted to do it myself but must travel soon. Maybe someone fancies hacking the src/ ? Till src is patched, a tiny patch to manual would serve as a better than nothing rescue / reminder to rescue those stuck. >From Lokadamus > FreeBSD 9.1RC1 have a live-cd option and with this, fdisk work fine. Ah yes, that reminds me Ive also seen Fdisk work OK single user. (Single user awkward though when running a server or ssh/rlogin to a headless host) Cheers, Julian -- Julian Stacey, BSD Unix Linux C Sys Eng Consultant, Munich http://berklix.com Reply below not above, like a play script. Indent old text with "> ". Send plain text. Not: HTML, multipart/alternative, base64, quoted-printable.