Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Aug 2005 15:24:00 +0200
From:      m.ehinger@ltur.de
To:        "Matthew N. Dodd" <mdodd@FreeBSD.ORG>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Parking disk drive heads
Message-ID:  <OFAE7E33A6.2CB5B6A5-ONC1257069.00487818-C1257069.0049A908@gateway-inter.net>
In-Reply-To: <20050821025614.O84830@sasami.jurai.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks for that works well.

Is there a way to lock the drive in that state for some seconds?

What if an read/write request resumes the drive right after it was unloaded and we are still in a "shock" situation, if the drive is
resumed before we hit the ground?

Thanks

Maik





                                                                                                                                    
             "Matthew N. Dodd" <mdodd@FreeBSD.ORG>                                                                                  
                                                                                                                                    
             21.08.2005 09:12                                                                                                    An 
                                                               m.ehinger@ltur.de                                                    
                                                                                                                              Kopie 
                                                               freebsd-hackers@FreeBSD.ORG                                          
                                                                                                                              Thema 
                                                               Re: Parking disk drive heads                                         
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    




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 <sys/ata.h>
...

             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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?OFAE7E33A6.2CB5B6A5-ONC1257069.00487818-C1257069.0049A908>