Coping Files PC to PC

OK, let’s say I have 2 laptops. I want to copy about 250 GB from one to another. I could:

  1. Connect another disk to the laptop A via the USB port, copy the file to it, then reconnect the disk to laptop B using a USB port. I end up coping the files twice.
  2. Remove the disk from laptop A and connect it to laptop B via a USB port. I only have to copy the files once, but more work removing / then re-installing the disk from laptop A.

Not sure how to do this but other options might be; 1) Connect the 2 laptop by an Ethernet cable. -or-
2) Use the home network either wired or WiFi to copy the files.

I was wondering what your suggestion might be to copy the files from one PC to the other.

1 Like

My first thought is to use a wired local network connection and rsync the files across.

4 Likes

Does rsync perform better then cp?

I’ve done full on data migrations of some 30 TB in the “recent” past (pre-Covid)…

Did a number of benchmarks and this came out fastest :

tar

I think it worked out about twice as fast as rsync… or maybe 1/3 faster - it was a few years ago now.

Over NFS (one mounted NFS share to another mounted NFS - on different storage platforms - but all on the same host) - no point doing compression - just adds overhead** :

Let’s say Source is /mnt/SHARE1 and Desination is /mnt/SHARE2

SOURCE="/mnt/SHARE1"
DEST="/mnt/SHARE2"

cd $SOURCE
tar cvpf - * | ( cd $DEST ; tar xvpf - )

(where " - " represents stdin, and stdout - no need to think about this)

there’s only one other UNIX program I’d trust to preserve ALL file and directory attributes, “cpio” but I haven’t used it in 20 years (note : I believe Debian DEB files are actually CPIO archives).

Where there was a delta to capture anything that changed during the migration - I used rsync - again without compression e.g.

rsync -av $SOURCE/. $DEST/.

Your case may be different. e.g. if this was going over SSH - I might use compression if the ethernet link isn’t a proper “smart” switch that can do compression on the fly… Previously when copying gigabytes or terabytes of data using SSH (i.e. the “scp” program) I’ve specified a “quicker” algorithm that doesn’t encrypt so heavily (thus speeding up the transfer) - I think I used “blowfish” encryption algorithm (read the man pages for openssh, ssh and scp) as it was much lower overhead than the default.

I believe you can pipe the output of tar to SSH - but I haven’t done anything like that in over 10 years…

** per the last paragraph above, and the asterisks at the top - if you’re going “host to host” - then compression may in fact speed up the transfer as it’s compressed locally, and decompressed remotely - less data over your wifi or ethernet.

6 Likes

Just another idea but @daniel.m.tripp and @pdecker opinions are better than mine…

In the source PC
If it’s Linux Mint, use the following command:

  • Install ssh on the PC where you have the files.

  • sudo apt install openssh-server

  • Enable ssh.service:

  • sudo systemctl enable ssh

  • Confirm if it is running
    sudo systemctl status ssh

  • Configure ufw to open port 22 just to your other PC:
    sudo ufw allow from <IP of Target PC> port 22

  • reload ufw
    sudo ufw reload

In the target PC
Create a directory on the target PC to which you will copy the files.

Open FreeFileSync on the target PC you want to copy the files to

Configure it as follows:

  • Select the cloud icon on the side of the source PC

  • Follow these steps on the Source PC side:

    • Select SFTP;
    • Insert IP of your Source PC;
    • Select Authentication: Password;
    • insert username of your Source PC;
    • Insert user password of your Source PC;
    • Click on the Browse icon and choose the directory where the files you want to copy are located.
  • Follow these steps on the target PC side:

    • click on the Browse button and choose the directory you want to copy the files to;
    • Choose the type of synchronisation you want to do (beware that Mirror deletes anything extra on the target PC). I would choose synchronise → update
    • And then use FreeFileSync as you usually do



Ohter way:
In the source PC
If it’s Linux Mint, use the following command:

  • Install ssh on the PC where you have the files.

  • sudo apt install openssh-server

  • Enable ssh.service:

  • sudo systemctl enable ssh

  • Confirm if it is running
    sudo systemctl status ssh

  • Configure ufw to open port 22 just to your other PC:
    sudo ufw allow from <IP of Target PC> port 22

  • reload ufw
    sudo ufw reload

In the target PC
Create a directory on the target PC to which you will copy the files.


Install Filezilla:
sudo apt install filezilla

Open Filezilla:

  • In Host field insert IP from your source PC;
  • insert username of your Source PC;
  • Insert user password of your Source PC;
  • Insert port 22 and press enter

Now, on Source PC side, you have the Source PC directory tree . Choose what directory or files you want to copy and drag to Target PC

This is an example of my Filezilla with both source and target PCs:

I hope this information is useful

Jorge

5 Likes

I think it is more a matter of rsync having more options.
Rsync will automatically invoke ssh if the transfer is across a network. I am not sure if cp will do that?

4 Likes

What he said… “cp” can only copy stuff over network via NFS or SMB shares - it’s also nowhere near as good as rsync or tar or cpio at retaining file and folder attributes…

Agreed that rsync is probably going to be your best option, and automatically knows if you’re doing it over SSH

Let’s say :

Source Host = HOSTA (we don’t need to “know” about this as we’re running it on this host)
Destination Host = HOSTB
Source Folder = /mnt/SOURCE
Destination Folder = /mnt/DESTINATION

rsync -avz /mnt/SOURCE/. HOSTB:/mnt/DESTINATION/.

(the “z” in “-avz” does compression / decompression over the network - and HOSTB: lets rsync know to use SSH)

Notice the terminating “dot” for each source (/mnt/SOURCE/.) and destination - I ALWAYS do that to be “safe”…

4 Likes

That is by far the best option.
You need to give the ethernet port a static IP address in each laptop
If you want to use hostnames rather than IP addresses, you need to put entries in /etc/hosts in each laptop.
Then just use any of the copy software suggested by @daniel.m.tripp, or the filezilla option mentioned by @Tech_JA if you want gui.

5 Likes

I would drop the disk out of the first machine into a external disk box,
Connect that through usb
Copy from external drive
Then put the disk back
But I have several external boxes and dropping disks out no big deal for me
Except if it’s a SSD as don’t have connections for that

1 Like

The laptop has a SSD and I believe the connections are the same for all 2.5 inch disks.

Many thanks to you both. I had not heard about either NFS or SSH. I know very little about telecommunications. I now have some reading and testing to do. I like the idea @daniel.m.tripp had about using the tar command and thanks @Tech_JA for the detail instructions for installing SSH.

Connect the 2 PC with an Ethernet cable.

Thanks for the advice. I heard this can be done, but never tried it. Again, not knowing much about telecommunications, I will have to do some reading and testing with static IP address on the PC.

3 Likes

Ok Howard,
If you have any questions, just ask and we’ll help you so you don’t get stuck reading about this subject.

Jorge

1 Like

Hi Paul,
Do SATA HDDs have the same connection as SATA SSDs, or am I wrong?
Sorry for this silly question.

Jorge

Hi Daniel,
Thanks for explaining the rsync command.
Tomorrow, my day off, I’ll have time for the PC and I’ll test this command.

Jorge

Most laptop hard disks like towers have data connections if within The last 20 years or so, before that they used IDE and before that SCSI.

Although I have one in the workshop not used either of these for a long time.

But now on SSD you get
Sata SSD
M2 SATA
Switch b, switch m, switch b and m
M.2 PCI-E SSD
M.2 NVMe SSD

Far to complex and too many standards

To guide you here are some images and a covering item

Btw I have no connection with either of the sites listed it’s just for information

3 Likes

Hello, Paul,
I apologize for my question. I know it’s not justified, but I read the post at 5:00am in a hurry before leaving for work.
My mistake, because when I talk about SSD, I always think of SATA SSD.
Thanks for the clarification. I know and work with the other formats, but, for example, I don’t use the terminology M.2 NVMe SSD, it’s my mistake.

Sorry to bother you, my friend.

Jorge

3 Likes

My mistake too. When I think of laptops, I think 2.5 disks.

Thank you for the reminder that PC storage have come a long way over the last 35+ years.
My first home PC was an Atari 400 that only had cassette tape as storage. Then I thought I was really with the times when I got a 5 1/4 external disk drive to go with my system.

3 Likes

Update.
The copy of the files is finished. I will mark this thread closed by giving Paul (@callpaul.eu) credit for the solution. It was not that I did not want to learn something new, but telecommunications is hard for me to understand for some reason.
Sometimes when you want to get a task done, you go with what you know.
Thanks for all the replies (ideas).

4 Likes

Hi Howard,
I’m glad to hear that you already did the the copy of your files, but now you can calmly try copying, for example, a test file between two PCs with the rsync command mentioned by Daniel.
I’ll try it too, my friend.
Come on, let’s test it, shall we?

Jorge

4 Likes

Yes, 2.5" SSD and mechanical drives use the same connexion. The only difference is that SSD is thinner… and much faster.

4 Likes