[Box Backup] How to move store to new machine

E.W. Peter Jalajas boxbackup@fluffy.co.uk
Sat, 13 May 2006 23:53:07 -0700 (PDT)


Hi again and thanks, Chris.

> Please could you try to find out if they're related? i.e. do you get
> an 
> error on the write lock file, or corruption detected by bbackupstore 
> check, only when the client is currently logged in and backing up
> during 
> the rsync? (I hope so).

Each of my 8 accounts on the old store looks exactly like this:

user@old:~$ date
Sun May 14 00:57:05 EDT 2006
user@old:~$ sudo find /root/.bu/ -name write.lock -exec ls -l {} \;
-rw-------  1 _bbstored users 0 2006-05-14 00:51
/root/.bu/backup/<acctno>/write.lock

I did:

user@old:~$ ps -ef | grep bbstored
1003      9304     1  0 May11 ?        00:00:00 /etc/init.d/bbstored
1003      9305  9304  0 May11 ?        00:16:23 /etc/init.d/bbstored

user@old:~$ sudo /etc/init.d/bbstored stop
Box Backup Store Server v0.09, (c) Ben Summers 2003, 2004
bbstored: exception Common OSFileOpenError (Can't open a file --
attempted to load a non-existant config file or bad file referenced
within?) (1/2)
{Note to self:  add this to
http://boxbackup.hostworks.ca/index.php/Feature_requests )

user@old:~$ sudo kill 9304  

(sudo xargs kill < /var/run/bbackupd.pid # should work too)

user@old:~$ ps -ef | grep bbstored
<none>

user@old:~$ sudo find /root/.bu/ -name write.lock -exec ls -l {} \;
-rw-------  1 _bbstored users 0 2006-05-14 00:51
/root/.bu/backup/<acctno>/write.lock

user@old:~$sudo fuser /root/.bu/backup/<acctno>/write.lock
user@old:~$sudo lsof  /root/.bu/backup/<acctno>/write.lock

Then on the new server:

user@new:~$ ps -ef | grep bb
<none>

user@new:~$ sudo nice rsync -v -u -a --delete --rsh=ssh --stats
user@old:/root/.bu/backup /media/ raid/bu
Password:
Password:
receiving file list ... done
backup/<acctno>/
backup/<acctno>/info.rfw
backup/<acctno>/odf.rfw
rsync: send_files failed to open
"/root/.bu/backup/<acctno>/write.lock": Permission denied (13)

with the rsync error repeated once for each of the 8 accounts.

user@new:~$ sudo bbstored check
Box Backup Store Server v0.10, (c) Ben Summers and contributors
2003-2006
bbstored: failed to start: failed to open configuration file: check
(I didn't think that was right...)

user@new:~$ sudo bbstoreaccounts check <acctno>
Check store account ID <acctno>
Phase 1, check objects...
Directory ID 5e53 has wrong size for object 653b
<error repeated hundreds of times with many different objects for each
of many different Directory IDs>
Phase 3, check root...
Phase 4, fix unattached objects...
Phase 5, fix unrecovered inconsistencies...
Phase 6, regenerate store info...
Store account checked, no errors found.

So, answering your question, I think I get the error and corruption
whether or not the client is logged in (there never is a client logged
in on the new server, yet) or the rsync is running.  

Well, now thinking about it a bit more, I tried:
user@new:~$ sudo find /media/bu/ | grep 5e53
user@new:~$ sudo find /media/bu/ | grep 653b
(the Directory ID and object listed above) and found nothing. 
Does that make sense?

user@new:~$ ls -al /media/bu/backup/<acctno>
total 1920
drwxr-xr-x 103 _bbstored users  8192 2006-05-14 00:51 .
drwxr-xr-x  10 _bbstored users  4096 2006-05-04 01:22 ..
drwxr-xr-x   2 _bbstored users  8192 2006-05-12 05:12 01
drwxr-xr-x   2 _bbstored users  8192 2006-05-03 14:43 02
<snip>
-rw-r--r--   1 _bbstored users    88 2006-05-14 00:51 info.rfw
-rw-r--r--   1 _bbstored users   456 2006-02-06 19:08 o01.rfw
<snip>
-rw-------   1 _bbstored users     0 2006-05-14 01:16 write.lock

Does that look right?

Here's the same from the old server:
user@old:~$ sudo ls -l  /root/.bu/backup/<acctno>/ | less
total 1908
drwxr-xr-x  2 _bbstored users  8192 2006-05-12 05:12 01
drwxr-xr-x  2 _bbstored users  8192 2006-05-03 14:43 02
<snip>
-rw-r--r--  1 _bbstored users    88 2006-05-14 00:51 info.rfw
-rw-r--r--  1 _bbstored users   456 2006-02-06 19:08 o01.rfw
<snip>
-rw-------  1 _bbstored users     0 2006-05-14 00:51 write.lock

Wait, how did the write.lock file get there in the first place, if it
wasn't ever readable by the rsync from the new server?!

And just to be sure:
user@old:~$ sudo du -shc /root/.bu/backup/*
869M    /root/.bu/backup/<acctno>
664M    /root/.bu/backup/<acctno>
3.2G    /root/.bu/backup/<acctno>
1.4G    /root/.bu/backup/<acctno>
88M     /root/.bu/backup/<acctno>
1.7G    /root/.bu/backup/<acctno>
168M    /root/.bu/backup/<acctno>
1.5G    /root/.bu/backup/<acctno>
9.4G    total

and

user@new:~$ sudo du -shc /media/bu/backup/*
869M    /media/bu/backup/<acctno>
664M    /media/bu/backup/<acctno>
3.2G    /media/bu/backup/<acctno>
1.4G    /media/bu/backup/<acctno>
88M     /media/bu/backup/<acctno>
1.7G    /media/bu/backup/<acctno>
168M    /media/bu/backup/<acctno>
1.5G    /media/bu/backup/<acctno>
9.4G    total

Should I try?:
/usr/local/bin/bbstoreaccounts check <acctno> fix
from: 
http://boxbackup.hostworks.ca/index.php/Fixing_problems_with_corruption_on_the_server

Hmm, I just noticed that my old store raidfile.conf has:
 BlockSize = 4096
and my new store raidfile.conf has:
 BlockSize = 1024
Could that be the/a problem?  (See my other comment about asking for
someone to doc how to choose a BlockSize.  When is a high or low
BlockSize preferred?)

It is fairly painless for me to reconstruct the new store from scratch
if we have to (I can reformat the harddrives and rebuild the array if
we have to).  But, I _really_ don't want to re-backup all the clients
(I'm only getting about 4 hours per stored GB from the clients at the
moment, so that would be about 40 hours.  Copying from the old to the
new server is so fast that I haven't measured it, yet.).

By the way, where are the account limits stored?  Are they in info.rfw?

I'm too exhausted at the moment to freak out about the fact that I have
to upgrade my clients.  I had thought that the constraint was the other
way around...stupid me, it's pretty clear at
http://www.fluffy.co.uk/boxbackup/ but not mentioned on the wiki, I
think.  Any pointers to the easiest way to upgrade Windows clients from
0.09 to 0.10? 

Thanks again for all your time and effort, Chris!  I really appreciate 
it.  

(Per, I'm poking around the doc stuff.  It'll take me some time to
setup  my xml editing system.)

Pete
--- Chris Wilson <chris@qwirx.com> wrote:

> Hi Pete,
> 
> On Sat, 13 May 2006, E.W. Peter Jalajas wrote:
<snip> 
> > I don't know if that "wrong size" error is important, and/or
> related to
> > the write.lock error, or neither.
> 
> Please could you try to find out if they're related? i.e. do you get
> an 
> error on the write lock file, or corruption detected by bbackupstore 
> check, only when the client is currently logged in and backing up
> during 
> the rsync? (I hope so).
> 
<snip> 

> Unfortunately not. You have to upgrade all the clients to 0.10 to
> work 
> with a 0.10 server, or leave the server on 0.09.