From owner-freebsd-stable@FreeBSD.ORG Tue Jul 21 14:19:49 2009 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7CAB1065670 for ; Tue, 21 Jul 2009 14:19:49 +0000 (UTC) (envelope-from arnaud.houdelette@tzim.net) Received: from golanth.tzim.net (unknown [IPv6:2001:41d0:1:d91f:21c:c0ff:fe4b:cf32]) by mx1.freebsd.org (Postfix) with ESMTP id 84CC48FC16 for ; Tue, 21 Jul 2009 14:19:49 +0000 (UTC) (envelope-from arnaud.houdelette@tzim.net) Received: from alarante.irisa.fr ([131.254.13.244]) by golanth.tzim.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1MTGC4-000FKz-F1; Tue, 21 Jul 2009 16:19:48 +0200 Message-ID: <4A65CE7F.8040906@tzim.net> Date: Tue, 21 Jul 2009 16:19:43 +0200 From: Arnaud Houdelette User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Mark Stapper References: <4A643F5B.8080806@mapper.nl> <4A656076.2060205@mapper.nl> <9bbcef730907210137udf7f90ax21aa530ab859f8a6@mail.gmail.com> <4A658205.5000709@mapper.nl> In-Reply-To: <4A658205.5000709@mapper.nl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Authenticated-User: tzim@tzim.net X-Authenticator: plain Cc: stable@freebsd.org Subject: Re: ZFS RAIDZ and atacontrol spindown settings X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 14:19:50 -0000 Mark Stapper a écrit : > Ivan Voras wrote: > >> 2009/7/21 Mark Stapper : >> >> >>> Ivan Voras wrote: >>> >>> >>>> Mark Stapper wrote: >>>> >>>> >>>>> Good day, >>>>> >>>>> I am the proud user of a FreeBSD 7.2 AMD64 system housing, amongst other >>>>> things, a data server. >>>>> My "server"(It's called "Yoshi") runs FreeBSD from a mirrored system >>>>> disc, and has a zfs RAIDZ array with 4 discs for bulky data. >>>>> As it is a home server, and I work during the day, these four discs were >>>>> spinning happily all day long without much use for them doing so. >>>>> To save the world(and money) I issued the command "atacontrol spindown >>>>> 1800" for all the discs in my array spinning them down after thirty >>>>> minutes of idle spinning. >>>>> So far so good, me very happy! However, when I access the array after >>>>> the discs have been spun down, it spins up the discs one after the >>>>> other... >>>>> Mind you one AFTER the other, taking 4*9 seconds to do a "ls" command on >>>>> my music directory. >>>>> Content as I am with the smooth down- and upspinning of the disks, I >>>>> would like it better if the four discs would spin up simultaneously. >>>>> Thus my question: "Is it possible to \"group\" discs to be spun up >>>>> together, or to issue a custom command upon upspinning of a disc such as >>>>> to spin up other disks?" >>>>> >>>>> >>>> Good question but the answer is probably no - it really only depends >>>> on how ZFS accesses the drives; if it accesses them in sequence, you >>>> can't change it. >>>> >>>> >>> I've been looking at writing a shell script which monitors >>> /var/log/messages. >>> something like: >>> >>> If last line in /var/log/messages is like "request while spun down. >>> Starting." >>> spinup disks >>> >>> couple of problems though, I should probably poll the kernel messages >>> every second or so, but if I only check the last linee, I could miss the >>> spinup message. >>> I could count the number of lines in /var/log/messages and keep count of >>> the number of lines i've seen. Problem with this approach is that it's >>> not very efficient. >>> So I was hoping there is a way to receive this kernel message directly. >>> I am now thinking in the lines of a program which received a signal on >>> new kernel messages available or something similar. >>> >>> Any thoughts? >>> >>> >> You could do what "tail -f" does and simply hook a kqueue to get new >> messages from the /var/log/messages file. >> >> > I'll try that! thanks! > > As I get quite the same issue with a 4 disk raidz pool, could you please tell me the result of your tries ? which command do you use to force the disks to spin up ? Thanks