[OpenAFS] Offline migration of AFS partition files (i.e. the contents of `/vicepX`)

Ciprian Dorin Craciun ciprian.craciun@gmail.com
Mon, 4 Mar 2019 14:00:55 +0200


On Wed, Dec 5, 2018 at 3:29 PM Harald Barth <haba@kth.se> wrote:
> > Can I safely `rsync` the files from the old partition to the new one?
>
> For Linux (The "new" server partition layout):
>
> If the file tree really is exactly copied (including all permissions
> and chmod-bits) then you have everything you need. This was not true
> for the old file system layout for example in SunOS UFS.


Just for reference (perhaps it would help others in the future) I've
used something on the lines:
(please note that it would erase everything from the destination
folder;  thus it must be used only for migration purposes;)
(also note that it is safe to run this multiple times, perhaps to
resume a failed synchronization, or perhaps to rollback and try the
salvage operation with various options, etc.)

rsync \
        --recursive --one-file-system \
        --delete \
        --ignore-times \
        --checksum --checksum-choice md5 \
        --links --safe-links \
        --hard-links \
        --perms --times \
        --owner --group --numeric-ids \
        --whole-file --no-compress \
        --preallocate \
        --verbose --progress --itemize-changes \
        -- \
        /mnt/old-disk/vicepX/ \
        /mnt/new-disk/vicepX/ \
#



> I would copy to a not-yet used partition, mount it then as /vicepY
> (where Y is a new unused letter) and then as the first thing when
> startting the server run a salvage with the options
> -orphans attach -salvagedirs -force


I've run the following before starting any OpenAFS services (i.e.
without `bos` running.)

/usr/lib/openafs/dasalvager \
        -partition /vicepX \
        -orphans attach \
        -salvagedirs \
        -force \
#

Apparently outside some lines like:
Vnode 18800: version < inode version; fixed (old status)
, no other "strange" lines appear in the `SalvageLog` file.



And finally I've created a completely new OpenAFS (1.8.0) deployment
from scratch, initializing the protection database with the same users
and groups as in the previous deployment, making sure I've kept the
same UID's.  (Hopefully this is enough to keep ACL's and ownership
from the old volumes intact.)

Afterwards I've started the OpenAFS `bos` service, and run the following:

vos syncvldb \
        -server 172.xx.xx.xx \
        -partition X \
        -verbose \
        -localauth \
#

vos syncserv \
        -server 172.xx.xx.xx \
        -partition X \
        -verbose \
        -localauth \
#



Hopefully this was enough to "migrate" my old AFS deployment to the new server.

Thanks all for the help,
Ciprian.