From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 2 08:51:08 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 54E9137B401 for ; Mon, 2 Jun 2003 08:51:08 -0700 (PDT) Received: from bluejay.mail.pas.earthlink.net (bluejay.mail.pas.earthlink.net [207.217.120.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE31543F93 for ; Mon, 2 Jun 2003 08:51:07 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38ldshk.dialup.mindspring.com ([209.86.242.52] helo=mindspring.com) by bluejay.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19MraT-00056k-00; Mon, 02 Jun 2003 08:51:05 -0700 Message-ID: <3EDB7214.B9004DF7@mindspring.com> Date: Mon, 02 Jun 2003 08:49:40 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Andrew References: <20030603001755.S68271-100000@starbug.ugh.net.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a491185bfa2acea751e56ad75961b048fea8438e0f32a48e08350badd9bab72f9c350badd9bab72f9c 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 15:51:08 -0000 Andrew wrote: > 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? All the geometries returned by this call are fictitous these days, so there's really no value to it. What you really want is the SCSI mode page 2, or the Maxtor or Quantum vendor-private command, for IDE. Anything else means that you're going to be pessimising, rather than optimizing, when you make decisions on the basis of disk geometry reported by this call. -- Terry