From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 21 07:12:21 2005 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.ORG 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 9BC1916A41F for ; Sun, 21 Aug 2005 07:12:21 +0000 (GMT) (envelope-from mdodd@FreeBSD.ORG) Received: from sasami.jurai.net (sasami.jurai.net [69.17.104.113]) by mx1.FreeBSD.org (Postfix) with ESMTP id 31E4F43D45 for ; Sun, 21 Aug 2005 07:12:21 +0000 (GMT) (envelope-from mdodd@FreeBSD.ORG) Received: from sasami.jurai.net (winter@sasami.jurai.net [69.17.104.113]) by sasami.jurai.net (8.13.1/8.13.1) with ESMTP id j7L7C8aY049944; Sun, 21 Aug 2005 03:12:20 -0400 (EDT) (envelope-from mdodd@FreeBSD.ORG) Date: Sun, 21 Aug 2005 03:12:08 -0400 (EDT) From: "Matthew N. Dodd" X-X-Sender: winter@sasami.jurai.net To: m.ehinger@ltur.de In-Reply-To: Message-ID: <20050821025614.O84830@sasami.jurai.net> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.6 (sasami.jurai.net [69.17.104.113]); Sun, 21 Aug 2005 03:12:20 -0400 (EDT) Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Parking disk drive heads 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: Sun, 21 Aug 2005 07:12:21 -0000 On Wed, 17 Aug 2005 m.ehinger@ltur.de wrote: > which is the correct way to park the hd head? The documentation will refer to this operation as "Unload". Standby (0xE2) or Standby Immediate (0xE0) would be the only way I can see to do this. (Sleep performs an unload as well, but is not useful for your purposes.) Some of the low power idle modes supported by the Hitachi 5k100 mention head retraction to the ramp position, which might be of use provided the feature is widely supported on new hardware. Many drives support an "Emergency Unload" but it only appears to be activated by power failure. Anyhow, here is a snippet that should get you going (on 6.x/CURRENT): %%% #include ... struct ata_ioc_request req; int fd; fd = open("/dev/ad0", O_RDONLY); memset(&req, 0, sizeof(struct ata_ioc_request)); req.u.ata.command = ATA_STANDBY_IMMEDIATE; req.flags = ATA_CMD_CONTROL; req.timeout = 5; ioctl(fd, IOCATAREQUEST, &req); close(fd); -- 10 40 80 C0 00 FF FF FF FF C0 00 00 00 00 10 AA AA 03 00 00 00 08 00