HP Data Protector installation on qnap TS-X69U

From Urandom
Jump to navigation Jump to search

WARNING: HP Data Protector does not support Qnap as a backup destination. Follow this guide at your own risk!

So i wanted to make backups onto qnap and i managed to get HP Data Protector 6.2 Disk and Media agent running on qnap. Don't know if this works with other devices, but it should work on all intel atom based qnaps with similar firmware.

Qnap: TS-469U Firmware: 3.8.3 Build 20130426

You will have to enable ipkg and then install some dependencies. Go to Administration->Applications->QPKG Center->Available->More. Look up "Optware IPKG" and click "install". Then Log in with SSH and install the following.

ipkg install bash boost-filesystem boost-iostreams bzip2 coreutils glib grep libstdc++ lzo ncurses pcre psmisc readline sudo unzip xinetd zlib

You need to install dataprotector media and disk agents onto a 64bit linux client with a recent kernel. I used Centos 6. Now you have to get the required files from that machine.

mkdir -p DP_QNAP/dp_etc
mkdir -p DP_QNAP/dp_var
mkdir -p DP_QNAP/dp_misc
mkdir -p DP_QNAP/etc/xinetd.d
rsync -av root@LINUX_HOST:/opt/omni DP_QNAP/
rsync -av root@LINUX_HOST:/etc/xinetd.d/omni DP_QNAP/etc/xinetd.d/
rsync -av root@LINUX_HOST:/var/opt DP_QNAP/dp_var/
rsync -av root@LINUX_HOST:/etc/services DP_QNAP/dp_misc/
rsync -av root@LINUX_HOST:/etc/opt DP_QNAP/dp_etc/
scp root@LINUX_HOST:/etc/redhat-release DP_QNAP/dp_misc/redhat-release

Modify DP_QNAP/omni/lbin/.util file, replace the second PATH export with the following


Create a startup script for qnap DP_QNAP/dp_misc/start.sh

export PATH

if [ ! -s "/etc/opt" ]
  echo "Linking /etc/opt to /opt/dp_etc/opt"
  ln -s /opt/dp_etc/opt /etc/opt

if [ ! -s "/var/opt" ]
echo "Linking /var/opt to /opt/dp_var/opt"
ln -s /opt/dp_var/opt /var/opt

if [ ! -f /etc/redhat-release ]
echo "I am redhat, true story"
cp /opt/dp_misc/redhat-release /etc/redhat-release

cat /etc/mtab  | grep -q "tmpfs / tmpfs"
if [ $? -ne 0 ]
echo "Adding nicer mountpoint of root to mtab"
echo "tmpfs / tmpfs rw  0 0" >> /etc/mtab

cat /etc/services  | grep -q "5555"
if [ $? -ne 0 ]
echo "Adding OMNI to /etc/services"
echo "omni             5555/tcp    # DATA-PROTECTOR" >> /etc/services

while [ 1 -gt 0 ]
  if [ -x /share/MD0_DATA/.qpkg/Optware/sbin/xinetd ]
  sleep 5

Add executable flag:

chmod +x DP_QNAP/dp_misc/start.sh

Edit DP_QNAP/etc/xinetd.d/omni

service omni
    socket_type         = stream
    protocol            = tcp
    wait                = no
    user                = admin
    server              = /opt/omni/lbin/inet
    server_args         = inet -log /var/opt/omni/log/inet.log
    disable             = no
    instances           = UNLIMITED
    per_source          = UNLIMITED

Synchronize all required files to qnap

rsync -av DP_QNAP/* admin@QNAP_HOST:/opt/

Fix file ownership if needed

ssh admin@QNAP_HOST
chown -R admin:administrators /opt/omni /opt/dp_*

(OPTIONAL) Create a backup destination

ssh admin@QNAP_HOST

Start the xinet daemon with custom script

ssh admin@QNAP_HOST

If it starts try to Import the client into dataprotector.

Then you can follow this guide to make it run on boot. wiki.qnap.com...

My autorun.sh installation is like the following:

echo "[autorun]
Name = autorun
Version = 0.1
Author = neomilium
Date = 2013-05-06
Shell = /share/MD0_DATA/.qpkg/autorun/autorun.sh
Install_Path = /share/MD0_DATA/.qpkg/autorun
Enable = TRUE" >> /etc/config/qpkg.conf


echo "`date` Startup" >> /opt/dp_misc/start.log
nohup /opt/dp_misc/start.sh >> /opt/dp_misc/start.log 2>&1 &

chmod +x /share/MD0_DATA/.qpkg/autorun/autorun.sh