From owner-freebsd-current@FreeBSD.ORG Fri Oct 28 02:58:03 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 ABBA616A41F for ; Fri, 28 Oct 2005 02:58:03 +0000 (GMT) (envelope-from cpressey@catseye.mine.nu) Received: from priv-edtnes28.telusplanet.net (outbound04.telus.net [199.185.220.223]) by mx1.FreeBSD.org (Postfix) with ESMTP id E914A43D45 for ; Fri, 28 Oct 2005 02:58:02 +0000 (GMT) (envelope-from cpressey@catseye.mine.nu) Received: from catseye.biscuit.boo ([154.20.76.195]) by priv-edtnes28.telusplanet.net (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with SMTP id <20051028025800.YGVB16565.priv-edtnes28.telusplanet.net@catseye.biscuit.boo> for ; Thu, 27 Oct 2005 20:58:00 -0600 Date: Thu, 27 Oct 2005 20:04:48 -0700 From: Chris Pressey To: freebsd-current@FreeBSD.org Message-Id: <20051027200448.1ba236fe.cpressey@catseye.mine.nu> Organization: Cat's Eye Technologies X-Mailer: Sylpheed version 1.0.5 (GTK+ 1.2.10; i386-portbld-freebsd4.11) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Subject: fdisk(8) no longer capable of altering geometry X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2005 02:58:03 -0000 [this is a follow-up to / correction of my post to geom@ a few days ago, to which there was no reply] Hello, It appears that fdisk(8) is no longer capable of altering the geometry of a disk. (By which I mean, the kernel's idea of the BIOS'es idea of the geometry, of course.) I'd find it reassuring to know whether or not anyone else is seeing the same behaviour, before I go the official route and file a PR. Initially I thought that this failure case was only for uninitialized disks, but I have tried further tests and I can't get fdisk(8) to change the geometry in any of the cases. These cases are: a. uninitialized, totally blank disk (dd if=/dev/zero of=/dev/ad1 ...) b. initialized disk with FreeBSD (or any other OS) installed on it c. same as b, but with its root partition mounted on /mnt d. the disk containing the currently booted FreeBSD system (mounted on /, of course) In each of these cases, I tried a sequence like the following: fdisk -BI ad1 fdisk -u ad1 fdisk ad1 The behaviour I see is, in summary: a & b: fdisk issues the warning "fdisk: Geom not found" which presumably refers to the fact that there is no GEOM MBR provider for that disk. It then falls back to the legacy behaviour of raw-writing the partition table into sector zero of the disk. This does not, however, trigger an update of the kernel's idea of the geometry. c & d: no "Geom not found" warning, but no change in geometry either. I don't see this behaviour on DragonFly; cases a and b work as you would logically expect (as they worked in 4.x, AFAIR, but I have not yet tested this) where the geometry does get changed, and subsequent runs of fdisk report the changed geometry. In cases c & d, the behaviour is the same as FreeBSD - nothing changes. This is not too surprising, since the disk _is_ in use - but an error message would probably make more sense. This bug is one of the few remaining things standing in the way of porting the BSD Installer to FreeBSD. Without some way of altering the the geometry, it can't install onto a system whose BIOS misreports the disk geometry. My analysis of the problem can be found in my previous post to geom@, but to sum it up: I think fdisk needs to inform GEOM somehow that the geometry should be changed. It might need to trigger the creation of a GEOM MBR provider for the disk before it does so; but I'm not certain of any of this, since my knowledge of GEOM is slim at best. Hopefully someone more familiar with GEOM and such under -CURRENT is listening and can shed more light on this problem and/or provide a workaround and/or explain how I'm wrong and show me the right way to do what I'm trying to do (change geometry) in -CURRENT. Thanks for your time, -Chris