Data migration from remote SMB share to TrueNAS

Hello community,
I am trying to migrate data from my old NAS to my new TrueNAS Scale.
My old NAS is a Zyxel model NSA325 v2, more than 10 years old. Its OS is based on BusyBox v1.17.2. It provides very basic commands and rsync is not in the list. SMB version on this NAS is v1.0. I have been using local mounts on my PC (Ubuntu) to interact with it for years and years. I mean that I usually mount the SMB share on my PC, then I use rsync to push/pull data to/from my NAS. I do everything from CLI and it has worked fine so far.

Now, I am trying to pull data from it to my TrueNAS Scale (25.04.1), as described in this reply. The pull process starts as usual, I can see some progress with transfer rates around 90MB/s, but TrueNAS is systematically hanging after a while and then reboots.

I also tried with the following command:

sudo rsync -auvv --progress --stats -h admin@192.168.x.y:/path/to/share /mnt/streaming-pool/Media

but I receive the following error message:

opening connection using: ssh -o Compression=no -l admin 192.168.x.y rsync --server --sender -vvulogDtpre.iLsfxCIvu . /path/to/share (12 args)
admin@192.168.x.y’s password:
sh: rsync: not found
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(231) [Receiver=3.2.7]

I suppose it is caused by the fact that rsync tries to estabilish an ssh connection, then tries to execute rsync on the other side.

I was able to pull data with scp:

sudo scp -o Compression=no -r admin@192.168.x.y:/path/to/share /mnt/streaming-pool/Media

But transfer rate is low (10MB/s) and I need to pull some TB. So, I still prefer the old way (mount & rsync) which is not working on TrueNAS for unknown reason.

Do anybody knows why my TrueNAS hangs and reboots? What’s wrong with mount&rsync from CLI?
Can anybody suggest me a working and fast strategy for data migration from a quite old NAS supporting only SMB v1.0 and NFS (never used) to my new TrueNAS Scale?

Many thanks

…
… As it was solved, I added a step by step guide for anybody else needing to migrate data from a Zyxel NSA325 v2 to TrueNAS Scale in the reply to @rockstream . It may save days of googling.

Regards

Since BusyBox does have rsync then remote rsync will not work as you figured out. As I mentioned in the initial thread when I tried SMBv1 shares in TrueNAS they leaked connections (and thus memory) like crazy–in my case leading to the kernel invoking the OOM killer and stopping a bunch of apps, which didn’t result in reboots, but did cause other havoc. I wasn’t able to fix this after days of tinkering with the different options so I gave up and switched to NFS instead.

To check whether this is happening, you can try checking, while the local rsync is occurring (and before your server reboots) the number of connections either via the GUI (under shares, then in the 3-dot dropdown next to the Add buttion of SMB shares select “SMB Sessions”) or alternatively from the shell:

ps -A | grep smbd | wc -l

which will count the processes (each connection spawns a new process). In my case, when connecting to SMB v1 shares this number grew to the thousands.

It was not an issue with NFS so that’s what I am using now for the one use case (older cameras) in which the clients do not support SMB versions greater than v1.

Many thanks, @rockstream .
I switched to NFS as suggested by you. Not so easy with my old NAS, but in the end I succeeded. Just for history and hoping that it may help somebody else i report the steps I needed to follow to get my existing SMB share working as NFS share as well.
In fact, web UI of my old NAS let me only create new shares as NFS ones. No way from there to make an already existing SMB share as NFS as well. So, I opened an ssh shell on it and run the following commands:

su -l root
cd /etc/
cp exports exports.bak
cat exports
echo "/path/to/share 192.168.x.0/24(rw,sync,no_subtree_check,wdelay,no_root_squash) #" >> exports
cat exports
exportfs -a
showmount -e
showmount --all

On a new trueNAS ssh shell I was able to mount&rsync as usual:

sudo mkdir -p /mnt/nfs_share
sudo mount -t nfs 192.168.x.y:path/to/share /mnt/nfs_share
df -h
sudo rsync -rtvv --progress --stats -h /mnt/nfs_share/ /mnt/streaming-pool/Media/video

Transfer rate is about 95MB/s, which is acceptable now. Tomorrow morning it will be finished at this transfer rate. Yes, I might create a cron job to let my PC be turned off and keep the job on the NAS itself, but it’s late and I have already learnt many things today :stuck_out_tongue_winking_eye:

Many thanks for your help, you saved me

Glad it worked out. I just realized that my prior comments about SMB were based on the opposite direction (clients connecting to SMB 1 shares on TueNAS) but perhaps similar issues are occurring in the opposite direction. In any case, sounds like SMB 1 is just not stable in TrueNAS at this point.

Another warning if you are considering ever creating SMB and NFS shares from the same dataset, that will prevent you from running time machine properly from any dataset.

1 Like