[OpenAFS] Scripted? Whole partition moves

Stephen Joyce stephen@physics.unc.edu
Thu, 6 Aug 2009 08:11:56 -0400 (EDT)


On Thu, 6 Aug 2009, Jeff Blaine wrote:

> How are people handling whole partition moves in order
> to clear out a JBOD fileserver for OS upgrade?

I've just been doing some volume moves... and honestly, it's never been 
worth scripting to me. That said, I'll happily take a look at any automated 
tools others want to make me aware of. :-)

On tcsh, I do something like the following. You can probably adapt it to 
your favorite shell.

$ foreach i ( `vos listvol -server server1 -part /vicepa | grep -v Total | 
grep -v ^$ | grep -v backup | awk '{print $1}'` )
foreach? echo --------------
foreach? echo Moving $i in 3 seconds
foreach? sleep 3
foreach? vos move $i srcsvr srcpart destsvr destpart -verbose
foreach? vos backup $i
foreach? end

I usually run this in a screen session, and the sleep command gives me a 
chance to stop the process should I need to, without interrupting an actual 
move.

The greps can easily be replaced to match whatever you want. For instance, 
instead of excluding the blank lines and "Total" lines, you could grep for 
volumes of interest (user volumes, development volumes, etc). Just make 
sure the command in the backticks `` gives you the right results before you 
feed it into the loop for real.

Cheers, Stephen
--
Stephen Joyce
Systems Administrator
PANIC - Physics and Astronomy Network Infrastructure and Computing
University of North Carolina at Chapel Hill
voice: 919.962.7214
fax: 919.962.0480