Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

Note

This article is workable, but not up to par in quality to be considered complete.

...

  • Off-site (from where the servers are located) backup for small businesses. 
  • Double as a centralized storage area for a small or home office
  • Provide media functionality for a small home (which also doubles as an additional backup site)

Solution

Synology which has an easily hackable system and one of the best software platforms we have seen.

Hardware

  • DS212j using the Marvel Kirkwood mv6281 ARM chipset with 16-bit@DDR2, 256MB of RAM
  • Two 3 Terabyte Drives

Synology DS212j Setup

Perform the following Update

  • update firmware
  • sync the time server
  • disabling cache management (when UPS N/A)

Setup the Volumes

  • S.M.A.R.T. test
  • enable the home directory for SSH

Install ipkg

Introduction

ipkg is the packaging system for the lightweight debian based linux system provided by Synology.

...

  • Download and run a script which the community calls a bootstrap file specific to the NAS processor hardware
  • Modify .profile to include ipkg in the path

Steps

The following procedure was successful with DSM 4.0-2233.

...

The ipkg update dialog will show the repository being used. In the above example, load a browser and go to http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/ to see the list of software available for installation on their site.

Install Packages

Installing packages with ipkg is similar to using apt-get with Debian or Ubuntu. Synology keeps a manual online for reference. You should though be able to get by with the following common commands,

...

Code Block
ipkg install rsync # installs rsync for making backups
ipkg install htop # nice monitoring of system
ipkg install mlocate # easily find files

Common Errors Installing Packages

Code Block
languagebash
 ipkg_conf_init: Failed to create temporary directory `(null)': Permission denied

The reason for this error is that you are not logged in as root.

Setup Remote Backup User

Rather than using root to pull down data from other system we will use remotebackup.

...

Add the private keys to remotebackup required to log into other systems to transfer backups.

Creating the Backup Destination

The backup destination will only have r/w access by remotebackup

...

Scripting

Note that the ash is the default shell. Synergy selected ash because it is a lightweight version of bash and generally compatible.

...

Code Block
languagebash
sh script.sh

Adding the Cronjob

To add the script to cron edit the crontab located in /etc/crontab make sure you are root.

...

To view the logs to see if your cronjob was run is located in /var/log/messages

Connecting with Clients

Mac OS X Auto Mount

Open Finder and click DiskStation on the left tab.

Look to top right and click button "Connect As..."

Mac OS X Hidden Mount with GUI

To mount a hidden share as a specific user perform the following steps. It is assumed that in DiskStation Mac file service has been enabled.

Connect to Server

Use the key combination command-k or choose Go > Connect to Server from the menu bar.

...

Now this network share will not show up in the SHARED listing in the file manager. Instead look for the share in the /Volumes folder. In this example, /Volumes/myshare.private/.

Mac OS X Mount Hidden Share with CLI

The advantage of the CLI (Command Line Interface) is that is it not obvious to another casual user that you had mounted the hidden share and (I got to research this) you can delete the history entries quickly and remove all traces of the private share.

...

Note

Isn't there a way to not have to manually make the directory before mounting?

...

Mac OS X Unmount Hidden Share with GUI

Do not know how to do this yet. Please share if you do.

Mac OS X Unmount Hidden Share with CLI

To be extra secure, unmount your hidden share when you have finished using it. Go to the command line and use the umount command. In this example it would be,

...

How to clear history of last command - http://thoughtsbyclayg.blogspot.ca/2008/02/how-to-delete-last-command-from-bash.html

Linux Mount with CLI

Specifically tried with Lubuntu,

Code Block
languagebash
sudo apt-get install nfs-common
showmount -e 192.168.0.190 # List available shares
sudo mkdir /mnt/myshare.hidden
sudo mount 192.168.0.190:/volum1/myshare.hidden /mnt/myshare.hidden/
# Success as the actual user, not sure what happens if I don't create the actual user or how to use a different name yet.

 

Improving the Automatic Backup

  • Progress log
  • Start and stop process times
  • Time span
  • File integrity - CRC checks
  • Emergency Alerts
  • Security restricting terminal access and permissions to remotebackup 
  • Scalability - backup files that get too large

It turns out we can not create our own users with specific UIDs under 1024... so that makes backing up and restoring with proper UIDs a bit more challenging. Maybe storing and then restoring UIDs during and after backup.

Transfer speed fix test

http://forum.synology.com/enu/viewtopic.php?f=14&t=44749&start=30

References

VNC Autostart - http://blog.johngoulah.com/2013/01/ditching-vino-for-x11vnc/

...