Recently I was forced to format my QNAP TS-109 and reinstall the firmware. For some reason the file partition holding all the data became so corrupt that the QNAP firmware would refuse to even mount the drive. No amount of partition fixing or recovering would enable it to mount. Eventually I gave up and restarted from scratch.
Lucky I had all the QNAP data stored on a secondary, dumb USB hard drive so no data was lost. This is something I would recommend to everyone do, even those with NAS devices which run with multiple drives.
One of the problems though was trying to work out an easy away to transfer the 750 GB of data from the USB device over to the NAS server without using the QNAP Backup feature. In the past I have found it unreliable and I also preferred the manual control of using the Linux command line.
Fortunately the QNAP server comes with the handy command known as rsync. This utility covered all my needs quite well and so below I will explain how to use it with an external USB device and a QNAP NAS server.
Part I, Telnet
- Turn on your QNAS server and wait for it to boot.
- Plug in your external USB device into a USB socket at the back of the QNAS server and turn the USB device on (if needed).
- Web browse to your QNAP administration page, by default it is at http://169.254.100.100:8080. Login using your administrator (admin) account.
- Go to External Device and then select USB Disk.
- If everything is okay your USB disk should be shown in the web form.
- Now we are going to turn on the Telnet remote log-in of the QNAP server. If you already are familiar with using Telnet or SSH to connect to your QNAP server you can skip this and go to Part II of this article.
- In the QNAP administrator webpage select Network Services > Remote Login.
- On the Remote Login make sure the Telnet connection is selected.
- Now we will need to connect to your QNAP server using a Telnet client. I recommend the very popular client known as Putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/). So if you don’t have a client, download Putty and install it. From now on I will assume that is what you are using.
- In Putty setup your Putty Configuration to look like this, but obviously replace the IP address with that of your QNAP server. Once you have setup Putty, open the session.
- Once connected you should be prompted for a login in a screen that is not unlike the Windows Command Prompt. Login using your QNAP ‘admin‘ account, as this is the only account accepted by QNAP under Telnet.
Part II Rsync
Rsync is a Linux tool that allows you to synchronise directories together. Your QNAP device keeps symbolic links to all the folders within the /share/ directory. The external USB device will be located in the /share/USBDisk1/ directory.
Rsync comes with a number of option attributes but we will only list the ones of interest to our task.
Command: rsync [OPTIONS…] SOURCE… [DESTINATION]
-v verbose output – displays syncing information
-vv verbose output with additional information
-r recursive scanning and copying – scans and copies all sub-directories
-h human readable output – recommended
–size-only – recommended otherwise rsync will use dates to check for file differences. If you have to abort and later resume your synchronisation, this option will enable you to skip the files that have already been copied to your QNAP server.
–progress displays live transfer details such as the percentage copied and the speed of the transfer
-n dry run – simulates the copy without actually transferring any files. This is good if you wish to play around with the options.
If you wished for example to copy the backed up /MyMedia/ folder onto your QNAP server under the /Qmultimedia/ folder you would run the following command. Remember Linux is caps sensitive.
rsync –v –r –h –size-only –progress /share/USBDisk1/MyMedia/ /share/Qmultimedia/
With this information you should be able to copy large amounts of data from external USB devices onto your QNAP server without any troubles. If you need to cancel your session during mid-transfer, simply abort the synchronisation using the Ctrl-C key combination or exit Putty. When you are ready to resume, reconnect using Putty and run the same command again and rsync will resume from the last copied file saving you valuable time and duplication.
Once you have completed all the file transfers you need to conduct, make sure you disable Telnet access from your QNAP administration.