From owner-freebsd-questions@FreeBSD.ORG Tue Jun 20 16:38:48 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B2CC616A481 for ; Tue, 20 Jun 2006 16:38:48 +0000 (UTC) (envelope-from jjf@mind.net) Received: from anima.mind.net (anima.mind.net [69.9.129.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D4B243D60 for ; Tue, 20 Jun 2006 16:38:43 +0000 (GMT) (envelope-from jjf@mind.net) Received: (qmail 25645 invoked by uid 89); 20 Jun 2006 16:38:43 -0000 Received: by simscan 1.0.7 ppid: 25573, pid: 25642, t: 0.0506s scanners: attach: 1.0.7 clamav: 0.87/m:39/d:1548 Received: from office-gw.mind.net (HELO 192.168.9.28) (69.9.130.28) by anima.mind.net with SMTP; 20 Jun 2006 16:38:43 -0000 Received: (qmail 55737 invoked by uid 501); 20 Jun 2006 16:38:28 -0000 Date: Tue, 20 Jun 2006 09:38:28 -0700 From: John Fox To: freebsd-questions@freebsd.org Message-ID: <20060620163828.GA23425@mind.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Vocabulary-Word: ethical X-Quip: Fly the white flag of war! User-Agent: Mutt/1.5.11 Subject: GEOM issue -- making changes to slices/partitions on used disk X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2006 16:38:48 -0000 This happened on a FreeBSD 6.0 machine. Installed a SCSI drive on the machine -- drive had been used for testing previously and had an ext2 FS on it. I was able to use the sysinstall fdisk utility to remove the ext2fs partition and create a FreeBSD slice that utilized the entire disk. Then I loaded up the sysinstall disklabel utility, setup my partitions and when I went to write my changes, recieved an error about being unable to mount these new partitions -- said mount point did not exist. I decided I'd just try it again, so I exited sysinstall and restarted it. In the disklabel tool, I added only a swap partition. Swap partition was created without a problem. Exited sysinstall, restarted it to add the other new partitions. I could not write anything, however, as whenever I attempted to do so, I got the error message "ERROR: Unable to write data to disk da1". I decided I'd remove the slice and start fresh, however when I attempted to write this change, I again got an error message stating that data could not be written. At this point I did some research, and it seems that the issue is related to GEOM not allowing alteration of MBR/slices/partitions on used devices, and that the solution is to set sysctl knob kern.geom.debugflags=16 (Found it on this thread: http://groups.google.com/group/mailing.freebsd.current/browse_thread/thread/e7db21985d1b1cc3/3113b6502c5450ef?lnk=st&q=freebsd+sysinstall+fdisk+ERROR%3A+Unable+to+write+data+to+disk&rnum=4&hl=en#3113b6502c5450ef) Also on this thread is a word of caution, stating that use of this sysctl knob has been known to result in dev entries getting confused and blowing away the wrong partition -- which would obviously be quite undesirable. This seems like a rather clunky solution, and the posts in the cited thread are two years old, so I am wondering if there's another way to go now, or if the bugs are now worked out and it's safe to use this sysctl knob. One more thing to note: the posts in the thread mention 5.x specifically, but the behavior certainly seems to match that encountered on my 6.0 box. Any thoughts or input are quite appreciated! Thank you, John -- jjf@mind.net John Fox, Systems Administrator InfoStructure - http://www.mind.net Vox: (541)773-5000 / Fax: (541)488-7599