How to: Configure a DNS-323 (ALT-F firmware) as an Rsync Target

The last firmware released for the DNS323 was back in 2013. That was quite a while ago, and it wasn’t great. It lacked SMB2, ssh out of the box, and no development of popular applications. I tried Alt-F on a spare DNS323 as a test to see if I could get rsync up and running.

This isn’t meant to be an expansive entry of the pro’s and con’s of this firmware. This is supposed to be a straight forward approach of configuring the DNS323 as a rsync target for backups compatible with synology dsm 6.3.

Let’s not kid ourselves, this device is pretty old. The last time it was sold any where was around 2007. As of this writing that was 14 years ago. The processor is 500MHz, it’s got 64MB of RAM, the max data transfer possible is 10MBps. I do NOT recommend putting any sort of production or super-important data onto this. I’m using this because I love to tinker, and I have an over-abundance of spare harddrives. So please, as interesting as this entry is, if you want something with performance look at a modern NAS and drives with warranty and up to date specifications!

Moving along…

The coles notes version of alt-f installation:

  1. Download the latest alt-f firmware
  2. Log into your DNS323 and apply the alt-f firmware

*I take no responsibility past this point. These instructions are recommendations, and should not be taken verbatim. This is not an official support channel. Take all the necessary precautions to backup your data beforehand.

3. Create a login password, this will also act as your ‘root’ password too.

4. Format your disks. EXT2/EXT3/EXT4 and few others are available.

It’s your choice to stick with a RAID 1/0 or JBOD. I’m using older disks and this is strictly backup for my purposes.

Create the Rsync User

Let’s create an rsync user first.

Setup -> Users

Note the full name is the “windows name”, where the nic name is the “linux login” name. Take particular note of the linux name, this is what the synology needs to initiate a backup.

Create a folder and Share

Now we’ll need to create a share to mount the backup.

Setup -> Folders

Note the mounted drives. I configured mine independently.

  • Sda2 – 500GB drive
  • Sdb2 – 1000GB drive

I gave mine a share name of “backup_share”. Then hit ‘create’.

Once created, change permissions accordingly.

With the drive folder and permissions set, now configure the share.

Services -> Network -> smb -> Configure

Create a share based on the folder you created ealier

As a test, make sure you can browse the share from windows explorer

Ie. (\\DNS323\backup_share)

Use the username and password you created above. Make sure you can create files and folders. Notice you can enable SMB1, and SMB2 from this panel. I tried to disable SMB1, but that just made the share disappear from my Windows 10 explorer. Could be a bug they’re working out.

Side Quest – SAMBA module

There’s also an ‘Advanced’ button in Samba Setup. Use the same root password to see the contents.

This panel is a bit more graphical in presentation. And gives a good representation with the ‘view’ icon of the current shares published. Spend a little time looking around, there could be some tweaks you could find useful in this section.

Rsync Service Setup

Let’s setup this DNS as the rsync target.

Services -> Network -> inetdS

Hit ‘configure’ on the rsync service

Configure a new folder based on the path and user you created above.

  1. It’s easier to use the built-in browser to get to your folder. Otherwise if you know it already you can enter it here. Remember, this is linux, all the directory slashes are ‘/’
  2. The module name is the viewable share name in Windows
  3. Add your comments as necessary
  4. Set permissions for the rsync account created above

Now, let’s validate the folder created above (ie. /mnt/sdb2/backup_share) exists in the rsync configuration folder. We’ll use an SSH client for this. Just regular connection with root@DNS323 works. Goto \etc and more on rsyncd.conf.

The top line should give the location of rsyncd.secrets – a password encrypted file that only rsync users should have access to.

And the bottom portion should provide the recently created directory with permissions for your rsync user.

PS C:\> ssh root@dns323-2
root@dns323-2's password:
[root@DNS323-2]# cd etc
[root@DNS323-2]# more rsyncd.conf
#Sample contents
secrets file = /etc/rsyncd.secrets
use chroot = yes
read only = yes
dont compress = *
list = yes
...

[rsynrsyn]
        comment = rsync backup directory
        path = /mnt/sdb2/backup_share
        auth users = rsynrsyn
        uid = rsynrsyn
        gid = users
        read only = no

You can tweak this to do things like host allow within a certain subnet. For this, I’m just focusing on getting rsync running.

While you’re in here, have a look at your rsyncd.secrets file. Ideally, this should only give one rsync user with password. Something like

rsynryn:password

DSM – Setup HyperBackup

Now we can create a backup job and target the DNS323 (with alt-f firmware). Create a new backup job, choose rsync as the file server type.

Settings should be similar to below.

For the backup settings, configure the Server type as ‘rsync-compatible server’, enter in the pertinent details of your DNS323. It should look similar to the screenshot below. For port, just keep the default 873. The Backup module, make sure to use the exact same “Path” from the rsyncd.conf file.

ie. path = /mnt/sdb2/Backup_share

Backup module = /mnt/sdb2/Backup_share

Directory = Backup_directory

And this creates a new directory of whatever name you want.

After this you should be able to select items to backup. Set your items, schedule them and make use of the rotational backups (very handy).

Be aware of the speeds, even if you have SMBv2 enabled, the backup jobs are still pretty slow over rsync. Still hovers around 1.2MB/s. So time your backups accordingly, and be aware that DSM Hyperbackup cannot do simultaneous backups.

-Dexter

How to: turn a DLink DNS-323 into a Rsync backup location

*Updated Jan 21, 2021*

After purchasing a Synology DS-413J to replace my DNS-323 device, I wanted to repurpose the old NAS into a backup server.  In my mind, I pictured using a Richcopy or Robocopy scheduled task from a Windows machine to talk to the 2 devices.  As it turns out, both the NAS’s can speak the same language (linux) and there’s a handy little tool that takes a couple steps to do, but is well worth the effort if you want re-purpose a DNS-323.

DNS-323 instructions: You need Funplug!

1. Funplug instructions have been around for a while, NAS-TWEAKS has an excellent blog style article you can follow.  Here’s the cole’s notes version:

-After reformatting your DNS-323 device, download the fun_plug file and fun_plug.tgz and place them on the ‘volume_1’ share of your DNS-323.

reboot the DNS-323

connect via telnet to port 23 (no password required at this point)

-install the extra packages onto your DNS-323 (particularly, RSYNC) which is included:

rsync -av inreto.de::dns323/fun-plug/0.5/packages .
funpkg -i *.tgz

-enable root, and set a password

pwconv
passwd
login
store-passwd.sh

-enable and auto restart ssh services

cd/mnt/HD_a2/ffp/start
sh sshd.sh start
chmod a+x sshd.sh

Issue this command so you’re not just stuck with the busybox-only prompt:

usermod -s /ffp/bin/sh root
Change the default directory in ssh to something more familiar:
usermod -d /mnt/HD_a2/ root

That’s the most condensed version of Funplug I can give you guys, there’s lots of more minute details, but for now that will do to get what’s necessary: RSYNC and SSH services on the DNS-323.

2. Configuration of RSYNC requires some small knowledge of text editor vim or ‘vi’ as the busy box package has. First, SSH in with the root account, and create a new file named rsyncd.conf in the /mnt/HD_a2/ffp/etc directory:

login as: root
root@DNS323's password:
root@DNS323:/mnt/HD_a2# cd/ffp/start
root@DNS323:/mnt/HD_a2/ffp/start# sh rsyncd.sh status
rsync not running
root@DNS323:/mnt/HD_a2/ffp/start# cd ..
root@DNS323:/mnt/HD_a2/ffp# cd etc
root@DNS323:/mnt/HD_a2/ffp/etc# vi rsyncd.conf

The contents of rsyncd.conf should look like the below:

# /ffp/etc/rsyncd.conf configuration file
max connections = 2
secrets file = /ffp/etc/rsyncd.secret

use chroot = false
read only = no
list = false
strict modes = false
hosts deny = *
timeout = 600
dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz 
*.mkv *.avi *.mpg *.jpg *.rar
pid file = /var/run/rsyncd.pid

[File Backups]
hosts allow = 192.168.0.1/24 #your local network IP range
read only = false
gid = backup
uid = backup
auth users = backup_user 
path = /mnt/HD_a2/Backup_directory #Path of Backup on DNS unit

I’ve highlighted the lines you’ll need to change:

hosts allow
= This is the IP Address range of your local network, the above example is for a standard Class C network, make the appropriate changes to yours. The /24 denotes the type of subnet mask you’re using. /24 pertains to a standard 255.255.255.0, this typically will fit your home network. Otherwise, here’s a cheat sheet on subnets.

auth users
= This user has to be created through the DNS-323 web server. You can stick with the standard ‘Admin’ account if you want, but for security purposes it’s a good idea to have a separate one for backup jobs.

path
= is the path on your DNS-323 of where you’re going to backup your data.

3. After saving rsyncd.conf, you’ll have to create a new file, rsyncd.secret:

root@DNS323:/mnt/HD_a2/ffp/etc# vi rsyncd.secret

Contents of rsyncd.secrets is very short as it contains the username and password of your backup user authenticated from rsynd.conf:

 #One line per user; a User ID:(colon)then password 
backup_user:password

The command is just one line, username:password. This is where you fill in the username and password created in the web interfaced of your DNS-323, and specified rsyncd.conf.

root@DNS323:/mnt/HD_a2/ffp/etc# sh /mnt/HD_a2/ffp/start/
rsyncd.sh status
rsync not running
root@DNS323:/mnt/HD_a2/ffp/etc# sh /mnt/HD_a2/ffp/start/
rsyncd.sh start
Starting /ffp/bin/rsync --daemon --config=/ffp/etc/
rsyncd.conf

you can also run

sh rsyncd.sh status

To see if the Rsync service has been started properly. I would also recommend making sure that Rsync starts up with the DNS323 on each reboot or power off

root@DNS323:/mnt/HD_a2/ffp/start# chmod a+x rsyncd.sh

Now we configure the Synology to backup to RSYNC services on the DNS323

*New Screenshots compatible with DSM 6.2.3 added Jan 21, 2021*

4. After logging into DSM, goto Hyperbackup, open the backup wizard to open a new job. Choose ‘Data backup task’

For the Backup Destination type, choose RSYNC

For the backup settings, configure the Server type as ‘rsync-compatible server’, enter in the pertinent details of your DNS323. It should look similar to the screenshot below. For port, just keep the default 873. The Backup module, make sure to use the exact same “Path” from the rsyncd.conf file.

ie. path = /mnt/HD_a2/Backup_directory

Backup module = /mnt/HD_a2

Directory = Backup_directory

After you hit, next DSM will test the connection for you. As long as you’ve configured the RSYNC on the DNS-323 and started the service, DSM should pick it up. After you choose your backup selections, make a schedule; set it and forget it.

Items to keep in mind
*Rsync is not hailed for speed!. On average RSYNC only travels at around 1.5-4MBps.

*Synology Hyperbackup cannot run simultaneous jobs. This means if you’re backing up a lot of data, it will take a while! Plan Accordingly, take offline backups to USB, whatever your use case scenario might be.

-Dexter