Skip to content

Installing rsync and Unison on the Buffalo TeraStation Live

July 24, 2008

TeraStation Live 2Tb

TeraStation Live 2Tb


just bought a 2TB Buffalo TeraStation NAS and I love the thing. It is silent, fast and highly configurable/hackable whichever you prefer.

There is a good reference community about hacking the TeraStation, and most of the information presented here is just a compilation of several different articles, and forum posts found around the site. So I wish to acknowledge all the people that have contributed to uncover the mysteries of the Buffalo NAS units.

Getting Telnet and SSH

The first step is to get the telnet daemon running. The factory firmware includes a telnet daemon so we do not need to change it. Just download the acp_commander tool and run

java -jar acp_commander -t <ip address> -o

In my case the IP address of my TeraStation is 192.168.1.20 so I ran:

java -jar acp_commander -t 192.168.1.20 -o

You should then see something like

ACP_commander out of the linkstationwiki.net project.
Used to send ACP-commands to Buffalo linkstation(R) LS-PRO.

WARNING: This is experimental software that might brick your linkstation!

Using random connID value = 07CAA8F945F3
Using target: raid/192.168.1.9
Authenticate: OK (ACP_STATE_FAILURE)
Installing addons.tar …
creating directory… OK
Didn’t find locally, looking at
http://downloads.linkstationwiki.net/Uploads/LSPro/Binaries/
java.io.FileNotFoundException: /192.168.1.9/share/acp_commander/addons.tar (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:179)
at java.io.FileOutputStream.(FileOutputStream.java:70)
at acpcommander.FileSystem.copyFile(FileSystem.java:44)
at acpcommander.acp_commander.main(acp_commander.java:862)
start telnetd… OK (ACP_STATE_OK)
Reset root pwd… Password changed.

after which you can telnet to your box with user root and no password by doing

telnet 192.168.1.20

Once you’re please run passwd to set the root password. Now you should enable SSH so you can safely connect to the TeraStation. To do so follow the complete instructions on enabling SSH. Although my firmware is verson 2.14 I used the “1.11-1a Firmware” scripts and they worked perfectly.

Even though it is not an absolute necessity you should add the SSH daemon to the Daemonwatch as shown towards the end of the instruction document.

At this point you should have a running SSH daemon in your TeraStation so it is time to start the heavier lifting.

Enable  Key Based SSH  Authentication

On the computer you which to initiate your SSH connections to the TeraStation run

ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.1.20

This will enable key based authentication for user root in your TeraStation. If you want to enable the same type of authentication for other TeraStation users you need to repeat the ssh-copy-id command for each one. Then you must disable StrictMode on the TeraStation’s SSH daemon (StrictMode no in /etc/sshd_conf) due to the permissions on the TeraStation’s  /home directory. Then restart your TeraStation SSH daemon with

/etc/init.d/sshd.sh restart

If you generate your RSA keys with no password you will not need to type a password to login to your TeraStation via SSH from the authorized users/host.

Accessing your file Shares from SSH

All you configured shares are accessible from command line in the /mnt/array1/<sharename>, you can use them to copy any needed files during the hacking process.

RSYNC

The stock firmware also includes rsync so all you really need to do is enable it.

One thing to keep in mind is that the TeraStation recreates some of its files after booting so you need to change one script to make changes permanent, one option is listed in the FAQ, but I ended up not using it.

I ended up changing the file /usr/local/bin/mkrsconf.pl in order for it to create the proper /etc/rsync.conf as well as the /etc/hosts.allow. So download my version of the mkrscon.pl script and copy it to one of your TeraStation shares, then via ssh run the following

cp /usr/local/bin/mkrsconf.pl /usr/local/bin/mkrsconf.pl.bak
cp /mnt/array1/<share>/mkrsconf.pl /usr/local/bin
/usr/local/bin/mkrsconf.pl

to make sure it worked check if the file /etc/hosts.allow exists.

Now you should be able to use rsync to your TeraStation.

Some great rsync backup scripts can be found here and here.

Unison

Rsync is a great backup utility but it is a one way tool, it will not do bi-directional sync so I opted to install Unisson, which is a fast and stable sync tool.

I have several computers that I use daily and I need to have them synced all the time. To make things a bit harder they all have different OSes. I use an iMac with Leopard, a PC with Windows XP and a laptop with Ubuntu. All my documents are synced up to the TeraStation and down to each machine flawlessly using unison and some scripts.

The challenge in getting Unison on the TeraStation is that you’ll need to compile it, and that was not as easy as it seemed at first.

Follow the instructions on to install PKGSRC Arm tools so you can compile natively in the TeraStation Live.

Now Download Unison source and the OCAML compiler’s source.

At the time of this writing the OCAML stable version was 3.10.2, but I ran into compilation problems that I could not resolve so I tried version 3.09.3 and it compiled just fine after creating the opnames.ml file as explained bellow.

Compiling OCAML

cd /mnt/array1/<share>
tar zxf ocaml-3.09.3.tar.gz
cd ocaml-3.09.3
./configure
gmake world
gmake install
gmake clean

While compiling the ocamtools I got an error while compiling, specifically: Unbound Value “name_of_insrtuctions” : Error 2

This has to do with an error in the make file in the tools directory to generate the opnames.ml ocaml-3.09.3. A sed command in the TeraStation is giving an error so the file is not generated appropriately and stays empty.

For simplicity you can download the correct version of the opnames.ml, and place it in you ocaml-3.09.3/tools directory, then rerun “gmake world”.

Compiling Unison

Now all you need to do is to compile your unison sources by doing

cd /mnt/array1/<share>
tar zxf unison-2.27.57.tar.gz
cd unison-2.27.57
gmake UISTYLE=text NATIVE=false

Even if you get an error about etags not being found during compilation your unision bunary should have been generated. To check run

./unison -version

which should produce

unison version 2.27.57

Or whatever version you compiled. Now all you need to do is to copy unison to /usr/local/bin and you are set.
cp unison /usr/local/bin
Now test if you can reach your unison remotely via SSH by running the following on your PC
ssh root@192.168.1.20 unison -version
You should see the same message as above “unison version 2.27.57” after you type your root’s password.
Before you can use unison to sync up all your computers you need to of course install it in every machine, but please pay attention that all of them need to be on the same version.

You can find some great tutorials on Unison here, and you can also check out the full manual so have fun.

Pre built unison binary for version 2.27.57 compiled on my TeraStation Live by following the out lined procedure. If you want to save yourself some of the pain just download it…

I hope this document helps you out and that by writing it I am giving a little bit back to the community.

From → TeraStation

63 Comments
  1. Lyn permalink

    Hi,

    I wanted to try your unison binary on my Maxtor MSII but when I try to unpack the file I get an error from WinRAR. I copied the .gz file over to the MSII and gunzip says “bad magic.” Maybe you can give me some guidance here? I only show one file, named unison, in the archive but I believe I need the ocaml interpretor as well as the unison binary.

    The MSII and the Terastation both use the Marvell Orion chipset. The MSII runs:

    2.6.12.6-arm1 #1 Tue Aug 22 15:55:07 PDT 2006
    I don’t know if this is the exact version your box runs but it may be close enough.

    The MSII optware library provides the following:
    ocaml – 3.10.2-3 – Objective Caml system

    I don’t know if this ocaml release is compatible with your unison binary. I have installed it and it runs in interpretor mode.

  2. AlberTUX permalink

    do you happen to have the unison binary hosted somewhere else? the link seems to be broken.

    thanks!

  3. AlberTUX permalink

    nevermind! i downloaded it but the tar package seems to be broken:

    tar: Unexpected EOF in archive
    tar: Unexpected EOF in archive
    tar: Error is not recoverable: exiting now

  4. Fixed the URL to the Unison Binary it should work now. Try the download again.

  5. Hey – great document. So helpful – I’ve got just the same sort of mixed set up as you – and unison was what I needed 🙂

    Maybe you got some suggestions on another issue… I want to make some video files available t users of our little TV Station – and as they are in an archive of OSX bundles – and I didn;t want to duplicate them I tried symlinks to another share – but nada. I think I need to add “follow symlinks = yes to the /etc/samba/smb.conf file – but it’s read only – and I don’t know enough to mess with it in a way in which the web admin will still work?

  6. David have you tried hard links?
    Hard links would not break the web interface and all the other issues would work as well

  7. niebie permalink

    Awesome! Thanks for providing the unison binary.
    I bought a Linkstation today and had to find out that it was a heavily stripped down version of the LS Pro with only 16MB of RAM (model LS-LGL). So compiling on it is not really an option and I spent the whole day trying to get rsync or unison to work. 😦
    Now I’m so glad that I finally found this article. Your binary for the TS Live works great on this one too. Brings the device to it’s limit though (memory-wise)…

  8. This takes up a lot of space in the rootfs. Unfortunately, I have some other apps installed that I also need. I rad out of space because the rootfs partition is too small. Any suggestions?

  9. chc permalink

    Could you please fix the link to the pre-built unison binary again? I tried to download it but seems link is broken again. Thanks a lot.

  10. Drock permalink

    Pls fix the unison binary link, thanks.

  11. Till permalink

    Hey! Could you fix the link to the binary! Would save me some pain!

    • They keep deleting the binary version from there file upload sites. Do you know of a free site where I they wont delete it? Unfortunately I cannot upload it to wordpress.com

      • I might have the versions from above. If so, am willing to put on my server. Will check later. You might have to remind me.

      • I can send them to you, if you give me your email.

  12. Kris permalink

    I’m trying to get this working on the TeraStations here at the office, but I’m running into the out of space problem on the root partition when trying to install ocaml.

    Would appreciate it very much if someone can send me the binary version of unison.

    My mail address: kris dot gaethofs at westcanadahomes dot com

    Thx!

  13. Hi Bigdiver

    Your tutorial is really awesome and it worked perfectly upto enabling rsync and ssh.

    I want to do rsync from one TS to another TS.
    When I do it with DeltaCopy, it works fine.
    TS1==>”XP Machine with DeltaCopy”==>TS2, it works great.

    But when I try TS1==>TS2 or TS2==>TS1, it does not work, it just hangs and is disconnected automatically after about 15 min. This happens even for a single file.

    rsync on TS1 and TS2 is 2.6.7
    I tried 2.6.8, but I get error:
    sh: /usr/bin/rsync: cannot execute binary file
    and rsync on XP Machine is 3.something.

    Could you please help me what to do.

  14. Hi Bigdiver

    Incidentally I was looking for NFS option for backups along with rsync when I came across Jumbo Frames discussions. Someone had suggested to use MTU 1492 bytes. We were using Jumbo frames, so MTU was of size 7404 Bytes. Just changed it to 1500 Bytes and all was set instantly. Now the problem is solved.

    Thanks.

  15. a4refillpad permalink

    Hi Bigdiver,
    i know this article was started some time ago but has anyone had any success compiling a later version of unison. So far i’ve not had any success and errors part way through compilation.

  16. Joe permalink

    After failing to get it to compile correctly, I am trying to locate an arm binary of the unison version 2.27.57 that you have listed, but all download links I come across are dead. Do you still have that file? Could you fix the upload link again or send it to me?
    Thanks!

  17. I used to be recommended this website by means of my cousin.
    I’m not positive whether this submit is written by him as no one else understand such designated approximately my trouble.

    You’re amazing! Thanks!

  18. It’s going to be ending of mine day, however before ending
    I am reading this enormous piece of writing to improve my experience.

  19. According to the Cirrus Owners and Pilots Association (COPA),
    there have been 36 known CAPS activations as of July 24, 2012.
    The fact that the operator has a non-owner coverage will not excuse the operator for not having coverage on the vehicle.
    Ethiopia levels serious charges Aviation law and compensation – Possible causes of ET409 crash – All ET409 victims recovered – How black boxes survive
    crashes – ET409 pilot had premonition – Second plane in ET409 crash – Mystery deepens in ET409 crash – ET409 black box recovered
    – Lebanon and Cameroon crash similar – Black box eludes
    Beirut searchers – Ethiopian Airlines black boxes
    found – Fast turn by Ethiopian 737 pilot – Boeing and NTSB probe 737 crash.

  20. Good day! I know this is kinda off topic however , I’d figured I’d ask.
    Would you be interested in trading links or maybe
    guest authoring a blog post or vice-versa? My website discusses a lot of the same subjects as yours and I feel we could greatly
    benefit from each other. If you happen to be interested feel free to send me an email.
    I look forward to hearing from you! Terrific blog by the way!

  21. Hi just wanted to give you a brief heads up and let you know a
    few of the pictures aren’t loading correctly. I’m not sure why but I think
    its a linking issue. I’ve tried it in two different browsers
    and both show the same outcome.

  22. Hello Dear, are you in fact visiting this website regularly, if so after that you
    will without doubt obtain nice knowledge.

  23. Hello to every body, it’s my first pay a visit of this weblog; this web
    site contains amazing and actually fine material for readers.

  24. Hey! This is my first comment here so I just wanted to give
    a quick shout out and say I truly enjoy reading your posts.

    Can you recommend any other blogs/websites/forums that deal with the same subjects?
    Thanks for your time!

  25. Valuable info. Lucky me I found your web site unintentionally, and I’m surprised why this twist of fate didn’t happened in advance!
    I bookmarked it.

  26. Thanks for sharing such a fastidious idea, piece of writing is fastidious, thats why i have read it completely

  27. ‘ Thatch types when there excess water generating brown, dead natural substance between the soil and grass.
    It is stated that a single has to wait for the lawn to dry for at least
    3 to 5 days ahead of spraying on the fertilizers.
    Water early in the day or late at night which will
    allow more water to reach the root zone.

  28. If you are stressed from having a tough and
    busy day or week at work, you should be able to de-stress with the help of massage.
    Some of the top searches on Yahoo are “what is a massage like”, “what happens during a massage”,
    and “what is a deep tissue massage. For a professional massage therapist who visits clients for out calls, his massage table also needs to be light enough to carry.

  29. Also the deductibles, co-pays and caps on coverage will vary widely.

    Other benefits of buying final expense insurance leads.
    It may not always offer the best medical services and the
    prices could be a lot higher.

  30. Most people look in the directory listing when they require any
    services. Finding an earth friendly shop may be as easy
    as taking a stroll down the street for those who live in densely populated metro areas, but those in more rural areas may have a harder time.

    This is why they look for auto repair companies to take care of their valuable possession.

  31. If you are facing a charge of drunk driving then you should consult with a qualified lawyer that help to you in reduced the charge or going out.
    Working the system may sound unethical to some, but the system was put into place in order to protect our rights.
    If this label is presented to you, the counselor may advise you take
    part in a minimal range of counseling periods or that you enroll into a lengthier therapy program, lasting six to 12 months.

  32. I seldom discuss these items, but I thought this on deserved
    a thumb up

  33. Very interesting short article

  34. Extremely interesting article

  35. Hi, brilliant recommendation and an interesting post, it’s going to be exciting if this
    is still the situation in a few years time

  36. Well I searched for the article title and discovered this, great read

  37. I very rarely comment on these posts, but I thought this on deserved a big thankyou

  38. Exceptionally exciting piece

  39. Brilliant critique, I enjoyed the digital clock gadget bit

  40. Well I searched for the article title and discovered this, great read

  41. hi!,I love your writing so a lot! share we
    communicate extra approximately your post on AOL?
    I require an expert on this house to solve my problem.
    May be that is you! Taking a look ahead to look you.

  42. There is a lot of paperwork involved in filing a work injury claim.
    Keeping in view this unavoidablility, a person needs to just be ready for the trouble.
    Some personal injury lawyers will charge an hourly fee, which can be an indication that the lawyer is not certain that the client will
    be able to win the case, but is willing to look into the
    situation even further.

  43. I very rarely discuss these articles, but I assumed this
    on deserved a thumb up

  44. I hardly ever comment on these posts, but I thought this on deserved a big thankyou

  45. Extremely exciting short article

  46. Hurrah! At last I got a web site from where I know how to in fact get useful data
    regarding my study and knowledge.

  47. Wonderful blog! I found it while searching on Yahoo News.
    Do you have any tips on how to get listed in Yahoo News?
    I’ve been trying for a while but I never seem to get there!
    Cheers

  48. I am regular reader, how are you everybody? This paragraph
    posted at this website is truly pleasant.

  49. If you are within the family method, then you might end
    up being reeling under the pressure associated with preparing
    for your baby”s introduction.

  50. Incredible story there. What happened after? Good
    luck!

  51. I used to be recommended this blog via my cousin. I’m now not positive whether this publish is written by means
    of him as no one else realize such exact about my difficulty.

    You are wonderful! Thank you!

  52. When thinking about buying yourself jewelry with precious stones in it, please take them
    into consideration. Ask a successful and wealthy person for a handful of soil (e.

    The gold recovery should be guaranteed and at the same time, the cyanide consumption should be reduced as low as possible.

  53. I like the valuable info you provide in your articles. I will bookmark your weblog and check again here
    regularly. I am quite certain I will learn many new stuff right here!
    Good luck for the next!

  54. What’s up, its pleasant article on the topic of media print, we
    all be familiar with media is a impressive source of information.

  55. A truly happy person is one who can enjoy the scenery on a detour.see more

  56. Spot on with this write-up, I truly feel this website needs a great deal more attention. I’ll probably be back again to see
    more, thanks for the advice!

  57. Yes! Finally someone writes ahout skiing
    resort in france.

Trackbacks & Pingbacks

  1. Recover from PCast Disaster in my TeraStation Live « BigDiver
  2. Installing the Debian Package Management in the Buffalo TeraStation « BigDiver
  3. Mit acp_commander root Zugriff auf Buffalo TeraStation Pro | repats blog

Leave a comment