From owner-freebsd-stable@FreeBSD.ORG Wed Aug 5 08:03:54 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 0C147106566B for ; Wed, 5 Aug 2009 08:03:54 +0000 (UTC) (envelope-from stark@mapper.nl) Received: from smtp-out0.tiscali.nl (smtp-out0.tiscali.nl [195.241.79.175]) by mx1.freebsd.org (Postfix) with ESMTP id 84DA18FC19 for ; Wed, 5 Aug 2009 08:03:53 +0000 (UTC) (envelope-from stark@mapper.nl) Received: from [82.170.17.27] (helo=mapper.nl) by smtp-out0.tiscali.nl with esmtp (Exim) (envelope-from ) id 1MYbTU-0006kU-JM; Wed, 05 Aug 2009 10:03:52 +0200 Received: from bowser ([192.168.0.1] helo=[0.0.0.0]) by mapper.nl with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1MYbTN-0005fe-WD; Wed, 05 Aug 2009 10:03:46 +0200 Message-ID: <4A793CDF.5030801@mapper.nl> Date: Wed, 05 Aug 2009 10:03:43 +0200 From: Mark Stapper User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Arnaud Houdelette References: <4A643F5B.8080806@mapper.nl> <4A656076.2060205@mapper.nl> <9bbcef730907210137udf7f90ax21aa530ab859f8a6@mail.gmail.com> <4A658205.5000709@mapper.nl> <4A65CE7F.8040906@tzim.net> <4A66B92C.8000800@mapper.nl> <4A67A582.8040702@tzim.net> In-Reply-To: <4A67A582.8040702@tzim.net> X-Enigmail-Version: 0.96.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA04D1F4D458447ABE6A9F583" 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: Wed, 05 Aug 2009 08:03:54 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA04D1F4D458447ABE6A9F583 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Arnaud Houdelette wrote: > Mark Stapper wrote: >> Arnaud Houdelette wrote: >> =20 >>> Mark Stapper a =C3=A9crit : >>> =20 >>>> Ivan Voras wrote: >>>> =20 >>>> =20 >>>>> 2009/7/21 Mark Stapper : >>>>> =20 >>>>>> Ivan Voras wrote: >>>>>> =20 >>>>>>> Mark Stapper wrote: >>>>>>> =20 >>>>>>>> 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= =2E >>>>>>>> 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 t= he >>>>>>>> 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?" >>>>>>>> =20 >>>>>>> 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. >>>>>>> =20 >>>>>> 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= =2E >>>>>> 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? >>>>>> =20 >>>>> You could do what "tail -f" does and simply hook a kqueue to get ne= w >>>>> messages from the /var/log/messages file. >>>>> =20 >>>> I'll try that! thanks! >>>> >>>> =20 >>> 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 >>> =20 >> I have been using a shell script containing: >> #!/bin.sh >> dd if=3D/dev/ad4 of=3D/dev/null count=3D1& >> dd if=3D/dev/ad6 of=3D/dev/null count=3D1& >> dd if=3D/dev/ad8 of=3D/dev/null count=3D1& >> dd if=3D/dev/ad10 of=3D/dev/null count=3D1& >> =20 > > Thanks. > > FYI, I made the little script behind to speed up the spinup of the > whole pool, in case it be some use for anybody : > > #!/bin/sh > wait-spinup() { > while true > do > read l > l=3D`echo $l | grep 'request while spun down'` > if [ -n "$l" -a "`date +%H%M%S`" !=3D "$d" ]; then > d=3D`date +%H%M%S` > dd if=3D/dev/ad4 of=3D/dev/null count=3D1 2> /dev/null & > dd if=3D/dev/ad6 of=3D/dev/null count=3D1 2> /dev/null & > dd if=3D/dev/ad8 of=3D/dev/null count=3D1 2> /dev/null & > dd if=3D/dev/ad10 of=3D/dev/null count=3D1 2> /dev/null & > fi > done > } > > tail -n 0 -F /var/log/messages | wait-spinup > > > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.or= g" after updating my kernel I made an addition to the script, enabeling spindown settings on startup. It is untested as of yet (last reboot locked up pf, and i am currently not sitting next to my freeBSD box), but should work just fine! Greetz, Mark #!/bin/sh wait-spinup() { while true do read l l=3D`echo $l | grep 'request while spun down'` if [ -n "$l" -a "`date +%H%M%S`" !=3D "$d" ]; then echo disks spinning up! d=3D`date +%H%M%S` dd if=3D/dev/ad4 of=3D/dev/null count=3D1 2> /dev/null & dd if=3D/dev/ad6 of=3D/dev/null count=3D1 2> /dev/null & dd if=3D/dev/ad8 of=3D/dev/null count=3D1 2> /dev/null & dd if=3D/dev/ad10 of=3D/dev/null count=3D1 2> /dev/null & fi done } atacontrol spindown /dev/ad4 1800 atacontrol spindown /dev/ad6 1800 atacontrol spindown /dev/ad8 1800 atacontrol spindown /dev/ad10 1800 tail -n 0 -F /var/log/messages | wait-spinup --------------enigA04D1F4D458447ABE6A9F583 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkp5POEACgkQN9xNqOOVnWDOZQCfWwohBkxNL5AsCTo94/A3EsTU ZFQAoISlBqe36QCdfQG2OgNB5mDwuKxr =NccS -----END PGP SIGNATURE----- --------------enigA04D1F4D458447ABE6A9F583--