[OpenAFS] 'split' a tree of directory into volumes?

Lester Barrows barrows@email.arc.nasa.gov
Mon, 9 Feb 2004 11:20:45 -0800


Todd,

I've used the up command for the occasional splitting of a volume, but noticed 
that it doesn't preserve timestamps on directories. It's possible of course, 
though cumbersome, to go back and set them after the fact as long as the 
original directory still exists. To get around this I went through up.c and 
copied the code used to set a file's timestamp into the directory code, only 
needing to declare the tv[2] struct in the directory routine and modifying 
the target name to file2 from tempfile.

It seems to work as-is, but begs the question: If it's that easy, do you (or 
does anyone) know why this isn't done already? Is there a reason that in 
general we don't want to preserve directory timestamps when duplicating a 
directory? Or is it possible for this to somehow blow up on me in an obscure 
fashion? :-)

Regards,

Lester Barrows
Asani Solutions, LLC
Code IC Systems Group
NASA Ames Research Center
Voice: 650-604-2639

"Jura rapelcgvba vf bhgynjrq, bayl bhgynjf jvyy unir cevinpl."

On Saturday 07 February 2004 06:13 pm, Todd Lewis wrote:
> Michael,
>
> You may have to wrap a script around it to handle the details, but you may
> end up using the 'up' utility to get the data into the volumes. 'up' is a
> recursive 'cp' that knows about and copies ACLs as well as files.  Hardly
> anybody knows about it though, and fewer use it.
>
> It also knows about mount points (at least the recent OpenAFS version does
> on UNIX; the Windows versions probably doesn't, and the Transarc AFS 'up'
> doesn't) so if you happen to have volumes mounted in your tree they don't
> get copied, just the mount points.
>
> It shouldn't be hard to come up with a script that creates a volume based
> on the directory name, mv the old "20020101" dir for example to
> ".20020101", mount the new volume at "20020101", use 'up' to copy the data
> w/ ACLs, and if everything looks good, remove the ".20020101" directory and
> it's contents -- watching out for mount points of course, else you might
> clobber more than you mean to.
>
> 'up' can only copy files that you have read access to, so if ACLs are
> restrictive you might have to become a system:administrator, but that
> doesn't sound like your problem.
>
> On the other hand, if neither ACLs nor mount points in your subtree are
> issues, then you can just use 'mv' instead of 'up'.  You'll still have to
> deal with creating and mounting appropriately named volumes in either case.
>
> Hope this helps a little.  If you create something beautiful, share it! I'm
> sure this problem will come up again, if not for you then for somebody
> else. Good Luck,
> --
> Todd_Lewis@unc.edu
>
> Michael Loftis wrote:
> > OK I have a large number of directories, in this case a dated archive,
> > it's all been in one volume for quite some time, but now that volume is
> > unmanageably large.  Going forward I can easily vos create and fs
> > mkmount, but for the existing stuff I was wondeirng if anyone wrote a
> > scrip to take a tree of directories and split them into volumes?
> >
> > If not I'll hack something together, just seems like someone already did
> > this....
> >
> >
> > Currently it looks something like this:
> > <volume>  <dirs>
> > archvol--+20020101
> >         +20020102
> >         +20020103
> >         ...
> >
> > I want to split all those dirs into their own volumes then fs mkmount
> > them back into their original places so I end up with a number of much
> > smaller volumes.
> >
> > Thanks in advance all!!!
> >
> > --
> > Undocumented Features quote of the moment...
> > "It's not the one bullet with your name on it that you
> > have to worry about; it's the twenty thousand-odd rounds
> > labeled `occupant.'"
> >   --Murphy's Laws of Combat
> >
> > _______________________________________________
> > OpenAFS-info mailing list
> > OpenAFS-info@openafs.org
> > https://lists.openafs.org/mailman/listinfo/openafs-info
>
> _______________________________________________
> OpenAFS-info mailing list
> OpenAFS-info@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-info