Page 1 of 1

Copying between B2 & B3

Posted: 03 Nov 2010, 14:04
by cwhommes
Hi there,

I am the proud owner of both a B2 and a B3 (got it yesterday!). I need to move a large number of files from B2 to B3. I could use FTP of course but that would be cumbersome. Is it possible to connect the two servers through the eSata cable and use the web-interface of B2 to move files to the 'external' hard-disk? I know this works with a regular external harddisk but also with a server?

Look forward to some advice!

Kind regards, Kees Hommes | The Hague | The Netherlands

Re: Copying between B2 & B3

Posted: 03 Nov 2010, 14:49
by Ubi
I doubt it. But you can always rip the drive from the b3 and stick it into a HD enclosure

ubi

Re: Copying between B2 & B3

Posted: 06 Nov 2010, 07:20
by Cheeseboy
Hi,

I used rsync to copy all my media content from the Bubba|2 to the B3 when I got the B3.
It works, but it took 3 days for it to copy everything across. It is very slow as rsync uses ssh, so the Bubba|2 has to encrypt everything during the operation.

Perhaps you could use netcat as outlined in this thread:
http://forum.excito.net/viewtopic.php?f ... lit=netcat

Cheers,

Cheeseboy

Re: Copying between B2 & B3

Posted: 06 Nov 2010, 08:27
by DanielM
Cheeseboy wrote:It is very slow as rsync uses ssh, so the Bubba|2 has to encrypt everything during the operation.
I'd just like to note here that rsync of course doesn't use ssh if you don't want it to, this is just a matter of configuration. I copied over all data from my old B1 to the B3 using rsync without problems (though of course the muscle power of B1 was the weak link in that configuration).

/Daniel

Re: Copying between B2 & B3

Posted: 06 Nov 2010, 09:19
by pcrene
Hello CwHommes,

I installed MidnichtCommander on the B3 and used the ftp copy to transfer all data from my B2 -> B3.

on the B3 do: apt-get install mc

Rene

Re: Copying between B2 & B3

Posted: 08 Jan 2011, 06:58
by theWebalyst
How did you guys connect the two and execute the operations?

Did you just connect the LAN ports together SSH to b3 over WiFi?

Is there any need to configure B2 to stop IP address clashes, fighting over DHCP provision or other hackery?

Do you just address the machines as bubba and b3 in your rsync commands? Can you give example rsync command?

Thanks

Mark

Re: Copying between B2 & B3

Posted: 08 Jan 2011, 07:11
by Cheeseboy
Howdy,

In short (and probably simplified):
I changed the configuration on my Bubba2 from being a router etc, to just a server, removed the internet from it's WAN port and plugged it into the B3 instead, which I then configured to be the router. Then I plugged both machines' LAN port into the same switch.
I also disabled a lot of services on the B2 that I now wanted the B3 to handle.
If I remember correctly, I forgot about several things, so it was a gradual process, including several reboots of both machines. If I had planned ahead it should have been simple, but I forgot about how many things I was actually relying on my B2 to do...

Re: Copying between B2 & B3

Posted: 08 Jan 2011, 10:55
by theWebalyst
Cheeseboy wrote:Howdy,

In short (and probably simplified):
I changed the configuration on my Bubba2 from being a router etc, to just a server, removed the internet from it's WAN port and plugged it into the B3 instead, which I then configured to be the router. Then I plugged both machines' LAN port into the same switch.
I also disabled a lot of services on the B2 that I now wanted the B3 to handle.
If I remember correctly, I forgot about several things, so it was a gradual process, including several reboots of both machines. If I had planned ahead it should have been simple, but I forgot about how many things I was actually relying on my B2 to do...
Thanks for sharing what you remember. I've got a bit of progress but still a bit stuck..

So far I have B3 as WLAN/Server/Router and cable between B3 and B2 LAN ports. My PC is connected to B3 WiFi (though I can also see B2's).

I can SSH to both B2 & B3 from laptop, which means I can see B2 via the LAN-LAN connection. However then I'm a bit stuck! Samba let's me see B3 file system but not B2 (maybe I turned it off - will check!).

But what I wonder is how to address B2's file system from B3?
Do I need some NFS mounting apps installed?
Can I access B2 through rsync, and if so how?

Any clues on these last bits would be helpful. BTW I don't want to use FTP, I think it screws permissions or ownership.

Thanks

Mark

Re: Copying between B2 & B3

Posted: 08 Jan 2011, 11:44
by Cheeseboy
Hi,

You could sort out the samba problem, install NFS, or tar & zip your stuff up before FTPing it over.
Or use rsync. It is easy to get it wrong, so please read up on the man page (and pay attention to the bit about trailing slash).
I would test it with a target in a temp directory first so you don't accidentally overwrite something important.

Example syntax:.

Code: Select all

rsync -av -e ssh niklas@bubba2:/home/niklas /media/disk2/Backups/bubba2home
(flags: a for archive (preserve all your files ownerships, dates etc), v for verbose, and e to tell it how to log in to the remote system)

This will recreate my bubba2 home directory in /media/disk2/Backups/bubba2home on the machine where I execute it.
This means that there will be a directory called /media/disk2/Backups/bubba2home/niklas with all the files and subdirectories in it.

This behaviour is controlled by the trailing slash (or lack thereof) in the path of the first argument to rsync (again: please read the man page and experiment before you do it for real)

Please be aware that even if your users and groups have the same names, they must also have the same uid and gid on the new system if you want things to be the same.

Cheers,

Cheeseboy

Re: Copying between B2 & B3

Posted: 08 Jan 2011, 11:46
by theWebalyst
Ok, sorted. Perhaps this is one for the Wiki?

Transferring files from Bubba|2 to B3. Here is my experience.

Configured B2 network to a fixed IP (192.168.10.49).
Connected cable between B3 LAN and B2 LAN.
Windows laptop connected to B3's WiFi.
Windows laptop has PuTTY installed for SSH.

From laptop I can SSH to B2 (as 192.168.10.49) and B3 (as 192.168.10.1)
From laptop Windows Explorer I can (Samba) access \\B3 but not \\Bubba (maybe I turned Samba off on B2? - need to check this)

Forum advice (from Johannes) is to use netcat for file transfers.
(See http://forum.excito.net/viewtopic.php?f ... cat#p10806)

So I installed netcat on B2 and B3 with:
su
apt-get install netcat

Example commands suggested in the thread (see link above) were:
First, on your server, type:

Code: Select all

nc -l -p 9999|tar xz
Second, on your bubba, type:

Code: Select all

tar cz <folder>|nc -w 1 <host> 9999
where <folder> is the folder you want to copy, and <host> is the host name (or IP) of your server.
And that's all there is to it, your folder has been piped over the network to the server, without wasting any space.
The above is copying TO the server. In which case let's make B3 the server so I can copy from B2 TO B3.

So on B3 I type:
# cd /
# nc -l -p 9999|tar xz

And on B2 as a test, I type:
# cd /
# tar cz /home/storage/pc/backup/pluto | nc -w 1 192.168.10.1 9999
tar: Removing leading `/' from member names

Am not sure what the tar message means but things then seemed to proceed as required. In a second SSH to B3 I can see the files appearing as expected. I can see the copy is proceeding by typing 'du' in the destination folder from time to time and seeing the disk space total increasing.

With these settings file ownership seems to be preserved on everything except /home/storage/pc (which is owned by root on B3 but me on B2).

I accidentally killed this with ^C on B2 and had to re-issue both commands but it all seems to have resumed ok!

So I will redo the commands for each tree of files I want to copy. Awesome. Thanks for the help!

Mark

Re: Copying between B2 & B3

Posted: 08 Jan 2011, 11:52
by Cheeseboy
Well you sorted it out yourself, with netcat of all things, I could not imagine a more hands-on (read geeky) approach. Good for you! :-)