From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 2 07:44:51 2003 Return-Path: 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 62F7137B401 for ; Mon, 2 Jun 2003 07:44:51 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36BC443F75 for ; Mon, 2 Jun 2003 07:44:50 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h52EicnA011068; Mon, 2 Jun 2003 16:44:44 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Andrew From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 03 Jun 2003 00:22:19 +1000." <20030603001755.S68271-100000@starbug.ugh.net.au> Date: Mon, 02 Jun 2003 16:44:38 +0200 Message-ID: <11067.1054565078@critter.freebsd.dk> cc: freebsd-hackers@freebsd.org Subject: Re: Retrieving disk geometry X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2003 14:44:51 -0000 In message <20030603001755.S68271-100000@starbug.ugh.net.au>, Andrew writes: >Hi, > >Under FreeBSD 4.x the ioctl DIOCGDINFO could be used to retrieve the >number of cylinders, heads and sectors of a drive. This could be called on >/dev/ad0 for example. Under FreeBSD 5 it seems to produce "Inappropriate >ioctl for device" unless you call it on an individual partition >(/dev/ad0s1a for example). > >Is there a way around this? Use the ioctls you find in they should work on all disk devices. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.