New HDD – transfer data with rsync

A new Samsung 4tb external HDD has arrived to replace the almost full WD1tb HDD that is attached to a raspberry pi and serves up media to the network with minidlna and grabs iplayer programmes with getiplayer. So with 950gb(ish) of data to transfer from the old drive to the new drive I used rsync.

I did use another pc to transfer the data as it would have taken ages with the pi as both usb’s and the network are on all one SMSC9514 chip – but it would work.

First things first, I used Gparted to format the drive to EX4, a native linux file system. Then I connected up both drives and run this command in the terminal:

sudo rsync -rvtP  “/media/bertha/WD 1TB/” /media/bertha/samsung_4tb

Commands as follows:

-r, --recursive             recurse into directories
-v, --verbose               Increase verbosity
-t, --times                 Preserve times
 --progress                  Show progress during transfer
 -P                          equivalent to --partial --progress

Adding -n for a dryrun to check everything is a good idea!

-n, --dry-run               Perform a trial run with no changes made

Lots of great guides online to prep the rsync command – this one is great

It transferred the data at approx. 30Mb/s and took 8 hours or so. I will get another soon to keep a backup of the data and again use rsync to sync the data with a daily cron job.