By Steve Ramage
Jid: sjr (a.t) sjrx.net
Dirvish is a fast, disk based, and rotating network backup system. It is Linux based and a very good backup solution. If you are reading this you are probably already sold on Dirvish, so I will spare you the marketing mumbo jumbo. The fact is that if you are reading this, you use Windows, either by choice or not.
Let me get one thing straight, you can NOT run Dirvish on Windows, for a few reasons. I know its ironic having a Windows HOWTO, only to say that you cannot run it. But that is not the purpose of this guide. This guide is to assist you in setting up a Windows machine to be a client to a Dirvish server.
Setting up Linux as a client, is very easy and straight forward. There is no reason that it should not be as straightforward on Windows. The problem arises that finding working versions of the software is/was a pain. That said, the following can be said about this guide. This is a guide on how to setup Dirvish on Linux, in essence, as it is the same procedure.
If you are having a problem, and everything is set up, you should probably refer to the Linux as it is more comprehensive. All that aside this guide will show you how to setup Rsync properly for windows, and an SSH Server.
This was the biggest crux for me, in terms of getting Dirvish to work. It was hard to find a good binary for it, but once found it simplified it, and made Dirvish ``set it and forget it''.
The rsync binaries are available on sourceforge http://prdownloads.sourceforge.net/sereds/cwRsync_1.2.9_Installer.zip?download They are released by ITEF!X (http://www.itefix.no), a Norwegian company. These are rsync compiled with cygwin, and a few windows niceties. The actual meat of the program is GPL (Specifically it is the Rsync and cygwin license). The additional stuff that ITEF!X provides is equivalent to the MIT License, but you do not need the extra stuff.
1) Download and Run the Installer.
2) After running the installer, you will see this screen. Make sure that you have the cwRsync Server selected, it should be the default.
3) You will see the following screen, it tells you some very important information, we will cover everything needed so do not worry. If you notice the current password, H4X0R will be your computer name, there is a long story over why my machine is named this...
4) The installer will finish, and there will be a new entry in your start menu. You will want to click on the rsyncd.conf entry.
5) The file will open in notepad, as such. The format is the EXACT same as a standard rsyncd.conf file, you can use the exact same options as with Rsync and do the exact same things, because it IS Rsync. The file shown here, is there example. The one thing to remember is cygwin naming conventions, that is c:\work becomes /cygwin/c/work.
6) Spaces are acceptable in paths, for instance on my notebook I use the following configuration file. (This is insecure and should only be used as is on a LAN, if at all. Part II of this will come back here to configure SSH).
use chroot = false gid = users strict modes = false hosts allow = 192.168.0.1 log format = %h %o %f %l %b log file = rsyncd.log pid file = rsyncd.pid # Module definitions # Remember cygwin naming conventions : c:\work becomes /cygwin/c/work # [notebookdocs] path = /cygdrive/c/documents and settings/SJr/My Documents/ read only = true transfer logging = yes
I will explain the significant options one by one:
hosts allow = 192.168.0.1
This specifies which machines will be allowed to connect.
This is the share name that you will access from the Dirvish server.
path = /cygdrive/c/documents and settings/SJr/My Documents/
This is where the notebookdocs folder will point to, that is the root directory of the notebookdocs share.
read only = true
First off this configuration, has NO security, other than the IP. Theoretically if someone could spoof that IP Address, they would be able to access the data on there, and this at least stops them from deleting the data. Secondly, I know nothing should be writing to them, so I will set this to read only. That is basically it for the configuration of Rsync, we do need to setup one other thing though and that is the service.
7) Open Administrative tools, and look for the RsyncServer Service, we need to make some changes.
8) Firstly, you need to change the startup type to automatic, then hit start, unless you want to reboot.
9) Out of the Box, there is a separate user installed. Depending on what you are backing up, this is not really adequate. You can either add that user to the Administrator group, or just set the service, run as a Local System Account. (Do not check allow service to interact with desktop, as it will simply show a black box when running). If you do set it to Local System Account, delete the cwRsync user, or if you are keeping that user, change the password.
That is it...
Q: Where can I get help?
A: Well as your basically running the Linux versions of software, so the Linux documentation is very handy. It's available on the Dirvish website at:
If this does not answer your question, try asking on the mailing list, and we should be able to help you out. To join the mailing list, follow the instructions here:
You can also contact me via Jabber at sjr a.t sjrx.net. But I'd only be good at helping you with the contents of this guide, the mailinglist is probably your best bet if you're stuck.
Q: Why do I have to use the CwRsync, can't I just get any Rsync binary and set that up?
A: If you can tell me. Cygwin is a nice tool, but the fact of the matter it is an emulator, and is not perfect. All the other ports of Rsync I have found, seem to have been ported for client functionality, most of them would just not work in daemon mode. I did find one that ``sorta'' worked however. Basically, if you installed the full cygwin installation, then started up a bash shell and ran Rsync from there, it would start, otherwise it would exit without an error. As silly as it sounds, you DID need a full cygwin installation, and you DID need to run it from bash, you couldn't just run the binary directly. This was annoying and I would forget a lot of the time, after rebooting to start it, and would not get anything backed up.
Q: What are the limitations of Windows as a Client?
A: Yes there are a few. The first is that I do not believe but haven't tested, I don't think Rsync supports ADS (Alternate Data Streams). In windows you can have ``two'' files with the same file name, it was a little known feature until recently. I don't know of any software that really makes use of these legitimately anyway. Spyware has started to hide data in ADS files, and that is why it has become better known.
Secondly, you cannot restore a Windows installation. Unlike Linux where everything is stored in nice modular files, a Windows installation is 'cryptic', and has a lot of hidden data on the FS, and a lot of virtual folders, not to mention the registry. Even if you had a copy of all your files, it is unlikely that you would be able to put them back in such a way that windows would be useable. That being said Dirvish is still very useful in backing up documents and the like.
Thirdly, NT File Permissions are lost when you use Rsync. However I already know the how to do it.
Q: How do I restore my files?
A: You could in theory setup Rsync to allow write access then push them back. I personally have a Samba share setup, that gives me read only access to my bank. It is very handy. In the event of failure you could just drag and drop the files back.
Q: How can I test that it is working?
A: Try running Rsync rsync://ipaddress. You should see your share there, if you'd like you can also try Rsync rsync://ipaddress/sharename. That will display your files.
Q: Any problems?
A: The only bug I ever noticed, was one where there would be redundant sets of data after switching Rsync builds. However the reason for this is because I'm an idiot, and everytime I switched rsync builds I basically re-initialized the set.
I have been using Dirvish for well over 8 months now, and have had no problems with the integrity of my data. That being said, Rsync is being run under an emulator and you might want to test it and make sure that it is backing up properly.
Q: Could Dirvish be run from Windows?
A: Not as is, though in ``theory'' it could be done but would require some major overhaul. One problem would be the lack of hard linking files. While it is true that you can hard link files (on NTFS anyway), it's not quite as simple as ln, and I don't know of any utilities that could replace it. Although if one were made, I imagine with some heavy coding you could do it.
Q: I noticed that this page was made in Frontpage...
A: Yes it was, I know you are all retching, but I have the web-designing capacity of an ant, which is ironic since I'm also a PHP developer. Long story short yes it was made in frontpage.
Q: You can hard link on NTFS volumes? Don't you mean crosslink?
A: No I don't mean crosslink, it's a little known feature that Microsoft added, but yes you can. There are some utilities available that do it. See this page for more information:
Q: What is the long story behind H4X0R?
A: Well it's not very long, I was reading a book about security and wanted to do some tests from a ``spare'' machines on my network. So I installed an old copy of Windows 2000 in VMWare, and named it that.
Q: Have you done anything else?
Lol, obligatory plug. I'm also very much active in the Jabber Community, mainly on the mailing lists but recently I've undertaken writing a PHP Library for Jabber, called XMPP4. Homepage is here. I also wrote the RSync Tunneling Via SSH TCP Forwarding Guide, don't have a link though since as the latest version of this guide changed it.
Special Thanks To:
Version 0.01: Completed Windows Installation
Version 0.90: Added SSH Installation, and a few grammatical corrections
Version 0.91: Finished the SSH Installation (STILL NEED TO ADD RSYNC AUTHENTICATION)
Version 0.92: Removed SSH Installation (Moved to a new article)