rsync hangs during transfer (9.10 STABLE)

PhilZJ81

Explorer
Joined
Mar 29, 2016
Messages
99
I hope I'm posting this in the correct section, if not feel free to move or delete.

I'm running "FreeNAS-9.10-STABLE-201605240427".

I'm copying data from my standalone drive in my NAS to a ZFS array. So both the source and target reside on the NAS box. I ran "rsync -Pva" command, through both putty (remote from laptop) and also via the shell option in the freeNAS GUI. Both had similar results, basically the process starts, creates several folders, copies several files, but within a couple of minutes, the process stops (meaning I don't see any more logs scrolling on the screen). I was copying a folder containing photos from my wife's iPhone, so mostly containing small files and a few videos from the camera (~500mb for biggest files, but most are 3-7mb). When the process would stop, (after waiting a couple of minutes and seeing no more progress) I would "Ctrl+C" and then I would get a Broken Pipe (32) message, but I'm guessing that's a result of me, terminating the request.
Both the source and target are CIFS shares, so I was able to use windows explorer to copy the data, but I'm trying to understand what could have happened.
I'm really new to this, so if you could guide me where to look for additional error details.

thanks,
-Phil
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
Before killing it, did you look at the Display System Processes tab, to see if it was crashed or just busy?
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
rsync is a quirky beast... I ran into problems with the 'p' component of the 'a' option you're using (-a is equivalent to -rlptgoD). I had to switch to using the explicit set of options, leaving off the 'p'. Gory details at the bug report here (I'm Keith N.):

https://bugs.freenas.org/issues/7713#change-52758

FWIW, here is a script I wrote to hide the rsync implementation details, it's a worker script I use in higher-level scripts:

"rsync-push-to-host.sh"
Code:
#!/bin/bash

# Push local volume/dataset to destination on remote host
#
# Command-line parameters:
#  1: Remote user ID  R_USERID  (remote system) root
#  2: Remote host  R_HOST  (remote system) bertrand
#  3: Source volume  R_SRC  (local system)  /mnt/tank/sharename/
#  4: Destination volume R_DEST  (local system)  /volume1/sharename
#  5: Log file  R_LOGFILE (local system)  /mnt/tank/sysadmin/log/push-log.log
#
# Example usage (note trailing slash on source volume name):
#
# rsync-push-to-host.sh root bertrand /mnt/tank/devtools/ /volume1/devtools /mnt/tank/sysadmin/log/push-to-bertrand.log

if [ $# -ne 5 ]
then
  echo "Error: not enough arguments!"
  echo "Usage is: $0 r_userid r_host r_src r_dest r_logfile"
  exit 2
fi

R_USERID=$1
R_HOST=$2
R_SRC=$3
R_DEST=$4
R_LOGFILE=$5

# Options:

R_OPTIONS="-rltgoDhv --delete-during --inplace --log-file="${R_LOGFILE}

# Files to exclude:

R_EXCLUDE="--exclude .windows --exclude vmware.log --exclude vmware-*.log --exclude @eaDir/ --exclude @eaDir --exclude Thumbs.db"

echo "$(date) Push" ${R_SRC} "to" ${R_DEST} "on host $R_HOST" >> ${R_LOGFILE}
rsync ${R_OPTIONS} ${R_EXCLUDE} "-e ssh -T -c arcfour -o Compression=no -x" ${R_SRC} ${R_USERID}@${R_HOST}:${R_DEST}
echo "$(date) Push completed" >> ${R_LOGFILE}
exit


For local copying, you could strip out the R_USERID and R_HOST stuff, and beware of the "--delete-during" option, as it deletes any files on the target that don't exist on the source.
 

PhilZJ81

Explorer
Joined
Mar 29, 2016
Messages
99
Before killing it, did you look at the Display System Processes tab, to see if it was crashed or just busy?
I didn't think of that, I'll try again tonight to another target and see
Also, anything in /var/log/messages?
that thing just matches what the system log at the bottom of the screen shows right? If so, nothing there.
rsync is a quirky beast... I ran into problems with the 'p' component of the 'a' option you're using (-a is equivalent to -rlptgoD). I had to switch to using the explicit set of options, leaving off the 'p'. Gory details at the bug report here (I'm Keith N.):

https://bugs.freenas.org/issues/7713#change-52758

FWIW, here is a script I wrote to hide the rsync implementation details, it's a worker script I use in higher-level scripts:

"rsync-push-to-host.sh"
Code:
#!/bin/bash

# Push local volume/dataset to destination on remote host
#
# Command-line parameters:
#  1: Remote user ID  R_USERID  (remote system) root
#  2: Remote host  R_HOST  (remote system) bertrand
#  3: Source volume  R_SRC  (local system)  /mnt/tank/sharename/
#  4: Destination volume R_DEST  (local system)  /volume1/sharename
#  5: Log file  R_LOGFILE (local system)  /mnt/tank/sysadmin/log/push-log.log
#
# Example usage (note trailing slash on source volume name):
#
# rsync-push-to-host.sh root bertrand /mnt/tank/devtools/ /volume1/devtools /mnt/tank/sysadmin/log/push-to-bertrand.log

if [ $# -ne 5 ]
then
  echo "Error: not enough arguments!"
  echo "Usage is: $0 r_userid r_host r_src r_dest r_logfile"
  exit 2
fi

R_USERID=$1
R_HOST=$2
R_SRC=$3
R_DEST=$4
R_LOGFILE=$5

# Options:

R_OPTIONS="-rltgoDhv --delete-during --inplace --log-file="${R_LOGFILE}

# Files to exclude:

R_EXCLUDE="--exclude .windows --exclude vmware.log --exclude vmware-*.log --exclude @eaDir/ --exclude @eaDir --exclude Thumbs.db"

echo "$(date) Push" ${R_SRC} "to" ${R_DEST} "on host $R_HOST" >> ${R_LOGFILE}
rsync ${R_OPTIONS} ${R_EXCLUDE} "-e ssh -T -c arcfour -o Compression=no -x" ${R_SRC} ${R_USERID}@${R_HOST}:${R_DEST}
echo "$(date) Push completed" >> ${R_LOGFILE}
exit


For local copying, you could strip out the R_USERID and R_HOST stuff, and beware of the "--delete-during" option, as it deletes any files on the target that don't exist on the source.

Ok, thanks I'll have to look at the option flags you sent there. The delete option was not an issue, it was a brand new set of photos that I wanted to copy to my ZFS array into a new folder created just for it.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
rsync is very powerful, but it also requires you to keep your hands on it at all times. Gotta slap it around with the proper parameters or things go really sideways, and often without any obvious error message of what you've done wrong. Generally, I avoid using rsync unless I have a serious need to do it. In your case I'd have done exactly what you did (move the data from one share to another over a desktop). I did that with 20TB of data once because rsync was just a b*tch.
 

kappclark

Explorer
Joined
Oct 16, 2019
Messages
99
rsync is very powerful, but it also requires you to keep your hands on it at all times. Gotta slap it around with the proper parameters or things go really sideways, and often without any obvious error message of what you've done wrong. Generally, I avoid using rsync unless I have a serious need to do it. In your case I'd have done exactly what you did (move the data from one share to another over a desktop). I did that with 20TB of data once because rsync was just a b*tch.
I have started using rsync to backup my music library to a Debian Samba box. The music library being hosted in a NFS share on Freenas..(Love the performance of the freenas box)

I start the rsync from the CLI in the freenas, and I find that rsync screams out of the gate, then, peridically stops for a minute or more, then picks up fo another 20 or so files....something tells me this is a samba issue, but thought I would reach out to the group...
Is rsync'ing from NFS to NFS faster than Samba ?

Is rsync doing a file check of some kind ?? This is the first full rsync, and the folder is about 650G -- I know this will take some time, but just want to be sure this is normal (?)

---------------------------------------
UPDATE

I added the -W option to the rsymnc command, and not the transfer does not hang ... it seems to go through all the files with no noticeable delays ...

--------------------------
 
Last edited:
Top