Say I''m firing off an at(1) or cron(1) job to do scrubs, and say I want to scrub two pools sequentially because they share one device. The first pool, BTW, is a mirror comprising of a smaller disk and a subset of a larger disk. The other pool is the remainder of the larger disk. I see no documentation mentioning how to scrub, then wait-until-completed. I''m happy to be pointed at any such documentation. I''m also happy to be otherwise clued-in if no such documentation exists, or if no such feature exists. Thanks! Dan McD. This message posted from opensolaris.org
Sorry, no such feature exists. We do generate sysevents for when resilvers are completed, but not scrubs. Adding those sysevents would be an easy change, but doing anything more complicated (such as baking that functionality into zpool(1M)) would be annoying. If you want an even more hacked up version, you could try the following dtrace script: spa_scrub_thread:entry { self->scrubber = 1; } thread_exit:entry /self->scrubber/ { system("do something"); exit(0); } - Eric On Wed, Jan 23, 2008 at 11:12:59AM -0800, Dan McDonald wrote:> Say I''m firing off an at(1) or cron(1) job to do scrubs, and say I want to scrub two pools sequentially > because they share one device. The first pool, BTW, is a mirror > comprising of a smaller disk and a subset of a larger disk. The other > pool is the remainder of the larger disk. > > I see no documentation mentioning how to scrub, then > wait-until-completed. I''m happy to be pointed at any such > documentation. I''m also happy to be otherwise clued-in if no such > documentation exists, or if no such feature exists.-- Eric Schrock, Fishworks http://blogs.sun.com/eschrock
Dan McDonald wrote:> Say I''m firing off an at(1) or cron(1) job to do scrubs, and say I want to scrub two pools sequentially > because they share one device. The first pool, BTW, is a mirror comprising of a smaller disk and a subset of a larger disk. The other pool is the remainder of the larger disk. > > I see no documentation mentioning how to scrub, then wait-until-completed. I''m happy to be pointed at any such documentation. I''m also happy to be otherwise clued-in if no such documentation exists, or if no such feature exists. >This is pretty trivial to code in a script. Here is a ksh function I use for testing resilvering performance. function wait_for_resilver { date while zpool status $POOLNAME | grep "resilver in progress" do sleep 10 date done } For your case, a longer sleep and fewer dates would make good sense. You probably want to redirect the grep output or use the -q flag for grep (caveat: I don''t know which grep you prefer to use, so check the flags for your version) -- richard
On Wed, Jan 23, 2008 at 12:56:16PM -0800, Richard Elling wrote:> This is pretty trivial to code in a script. Here is a ksh function > I use for testing resilvering performance. > > function wait_for_resilver { > date > while zpool status $POOLNAME | grep "resilver in progress" > do sleep 10 > date > done > }Doh! I should''ve thought of this one. It''s a decent-enough hackaround.> For your case, a longer sleep and fewer dates would make > good sense. You probably want to redirect the grep output or > use the -q flag for grep (caveat: I don''t know which grep you > prefer to use, so check the flags for your version)/usr/xpg4/bin/grep has -q, that''s easy enough to code-in, as we do that for punchctl already. Thanks! Dan
Hello Eric, Wednesday, January 23, 2008, 7:21:42 PM, you wrote: ES> Sorry, no such feature exists. We do generate sysevents for when ES> resilvers are completed, but not scrubs. Adding those sysevents would ES> be an easy change, but doing anything more complicated (such as baking ES> that functionality into zpool(1M)) would be annoying. zpool --wait so it doesn''t exit till requested scrub is completed? Shouldn''t be that hard to implement (it should wait in user space so it could be killed). Best regards, Robert Milkowski mailto:milek at task.gda.pl http://milek.blogspot.com