Copyright 2009-2020 by djg. All Rights Reserved.

Wonky Gibbon Ramblings

Configuring the D-Link DNS-320 NAS as an SVN Subversion server and connecting with VisualStudio 2010 4

Posted on November 23, 2012 by danny


I recently found myself wanting to work on a programming project at home, using C# and VisualStudio 2010, and like any good developer realised I needed source control. Yes of course I could use Microsoft Sourcesafe, it does integrate nicely with VisualStudio. But lets be honest, it is a pile of crap, I’m used to TFS at work, I can’t be doing with Sourcesafe. Running my own TFS server is probably a bit over the top, I’m not sure I have the spare change in my back pocket for the licencing.

At the same time I was aware I wanted to move my RAID’ed storage / backup solution out of the media system under the telly where it currently lives, to a dedicated NAS device.

Two birds? One stone?

Being a tight arse I went over to Ebuyer and looked up the cheapest unit that supported RAID1 (mirroring) and gigabit transfer rates and found the D-Link DNS320 for £53 inc VAT without disks, it can take up to two 2TB drives. Thinking of my old Linksys router and remembering appliances often run linux under the hood, I had a bit of a google and found this page. Someone had got subversion running on it. Very cool!!

So I ordered one, waited a few days and once it arrived shoved a drive in it. Getting the device up and running was the job of a few minutes work. Getting subversion working – rather longer. Nevertheless – success was ultimately had. For reference, I am not a linux expert – in fact it would be fair to say, I know to next to nothing about it. But I like a challenge…

What will I end up with?

Whilst the DNS-320 ships with its own version of Linux in the firmware, we aren’t going to be able to bolt directly onto that. However there is an undocumented hook (called ‘fun_plug’ which I guess stands for functionality plugin) that is checked on startup and can be used to add additional functionality stored on the hard drive.

To get subversion running on the DNS-320 you need a linux installation that runs alongside the one in the firmware, in this case DebianSqueeze. Installing this does not affect the rest of the NAS and you wont see any impact on the web interface. Once you have DebianSqueeze installed and running, you install and configure the subversion package and away you go.

So what you end up with, is a NAS running linux, that runs DebianSqueeze linux as a plugin that hosts subversion.


Unfortunately it’s not that simple. To configure DebianSqueeze requires Telnet to be running on the NAS and unfortunately out of the box, this is not the case. Luckily there is a (convoluted) way to get a very thin linux install (ffp) with Telnet onto the box first and then use that to configure DebianSqueeze. Once that is done, the ffp install is not used any further.

This exceptionally well written blog post describes how to install ffp, the “Fonz fun_plug 0.5 for CH3SNAS, CH3MNAS, DNS-323”
Follow it all the way down to the section headed “Logging in using SSH”, but don’t disable Telnet in the last step, as you’re going to need it.

Next, download DebianSqueeze from here
Open the zip file. Inside is a “how to” and two other files. Follow the instructions in the file from Step 2 (you have in effect already done Step 1).
The very last step of renaming fun_plug.debian to fun_plug effectively discards ffp that we installed earlier, it having served it’s purpose.

Now that you have DebianSqueeze running you can install subversion.
This blog post here provides a step by step guide to do this.
Half way down he mentions the command:
# svnadmin create /var/svn/projectalpha
‘projectalpha’ should be replaced by whatever you want to call your repository.
Other than that, follow the blog exactly, all the way down to the point where it starts talking about running an ssh server on a custom port. You probably don’t need to do that so can stop there.

You now have subversion running on your NAS. Excellent!!

Connecting VisualStudio 2010

Although subversion is usually used with an Apache web server this is not actually necessary. The author of the previous post has avoided doing this opting to instead use the ssh server and communication protocol already installed with DebianSqueeze. This makes it more lightweight and conserves the limited RAM available on the box.

To get VisualStudio 2010 to work with subversion you need a plugin. A popular one is AnkhSVN which can be downloaded for free.

Once installed, assuming you don’t have the Tortoise SVN client installed then you need to help the plugin understand the ssh protocol before you can use it in VisualStudio.
This blog post describes how.
NB: The configuration file mentioned in the post is described as being in your My Documents\Application Data\subversion directory, this is in XP. In Windows 7, this folder now maps to here: c:\Users\<USERNAME>\AppData\Roaming\Subversion. You may need to set the Windows Explorer “Folder and Search Options” to “Show hidden files, folders, and drives” to be able to see the AppData folder.

Now restart VisualStudio.

First you need to enable Subversion as the source control plugin for VisualStudio. Go to “Tools->Options” and in the dialog go to the subsection “Source Control” and edit the “Plug-in Selection” to be AnkhSVN.

Now, you can connect to your Subversion repository using “File->Subversion->Open From Subversion.

In the dialog that pops up enter the URL of the subversion repository on your NAS box, which will look like this: svn+ssh://<NASBOX>/var/svn/<SvnRepositoryYouCreatedEarlier>
and you’re in!!!

So now you’ve got it all working. The only thing is this irritating “Plink.exe” window that keeps popping up. It has to go – it just has to.

Download TortoiseSVN from here, install it, find the file tortoiseplink.exe, rename it to plink.exe and replace your plink.exe with it. You can then uninstall TortoiseSVN again.

Hope this has been of help.

Now some thanks and references:
First and foremost Murzal Arsya who made it clear that this project could be done on the DNS-320, outlined the need for DebianSqueeze and provided the step by step instructions for setting up subversion on the NAS.
Next which is a great resource for people wanting to use their NAS for more than just NAS and provided the amazing ffp stuff.
Then Shaunc for guidance on svn+ssh, cheers geeza!!
Finally Hao Chen for for the tip to get rid of the plink pop-up window

Getting a SiliconImage Sil3114 SATA RAID card to work in Windows 7 13

Posted on October 29, 2010 by danny

I recently had the experience of moving a pair of RAID1 storage disks from one server to another. It was not without difficulty.
Both server’s had the OS on a third non RAIDed drive, so i didn’t have to worry about being able to boot from them (thank god!)

The server they came from, an old MSI AMD motherboard had a Promise RAID controller built in. The Gigabyte board I was moving to did not, so I had to add an additional RAID controller on a PCI card.
The board chosen used a chipset from SilconImage – the Sil3114. This is an inexpensive card offering RAID0,1,5,10 & JBOD.

The card as delivered plugged into an empty PCI slot easy enough. However the motherboard recognised this only some of the time. (This was subsequently either resolved by a BIOS update to the card – more on this later – or pushing down hard on the card to ensure it was fully in – not sure which).

The Sil3114 card can be used in one of two configurations. As a RAID controller for up to 4 SATA drives. This requires a SATA RAID bios to be installed on the card (the default) and some SATARAID5 manager software to be installed in Windows.
OR – it can be used as a straight disk controller for up to 4 SATA drives (no RAID) – this is called “SATA Link” and requires SATA Link software in Windows. You can also install a SATA Link “base” BIOS to the card as well, instead of the RAID one, but since the SATARAID BIOS has a pass thru mode which allows the use of drives in a non RAID configuration, it makes you wonder why you’d bother.

The job then was to plug the drives in, set them up as a RAID group without losing the data already on them and then get them visible and useable in Windows.

After plugging the drives in, I went into the Silicon Image SATA RAID BIOS utility. Here I was able to create a RAID1 group containing the two drives. I allowed it to re-mirror the data from one drive to the other as part of this. The mirroring process took several hours for my Samsung Spinpoint 500GB drives.

After booting into Windows, Windows 7 automatically downloaded a bunch of driver software which it seemed to think would work. It also added an item to the Windows Control Panel called “Silicon Logic SATA RAID”. Despite clicking on this item many times – it never did anything.
In addition to this you need to install the SATARAID5 manager software which allows you to configure the disks in windows. This can be downloaded from the SiliconImage website here:
Make sure you have at least version of this.

These downloads inexplicably include an old copy of the Java virtual machine runtime environment. Ironically this doesn’t actually work with the SATARAID5 manager software it comes with. Genius! Although it will allow you to view the status of your disks – it won’t allow you to actually do anything with them, all the menu items just do nothing (I subsequently managed to run the manager in a console mode and found that all the menu items were throwing exceptions – ie: broken).
However if you install the latest version of the Java runtime from Sun (available here) – the manager software does work properly.

So now I was able to examine my disks using the SATARAID5 manager. They were marked as a Legacy RAID Group and painted red. In the Windows “Disk Management” window (right click on “Computer” in Windows Explorer, select “Manage” and then clicking “Disk Storage”) they were not visible at all.

So – problem! My disks are there, presumably with data and I can’t read them. And what the hell is a legacy RAID group?

After much reading of the siliconimage website, I downloaded updated versions of the Sil3114 BIOS
Specifically BIOS version: available from here.
The combination of BIOS and SATARAID5 Manager was the one I settled on that finally worked.

The BIOS can be updated by opening Windows “Device Manager”, finding the Sil3114 under “Storage Controlers”, right clicking and selecting “Properties”. One of the tabs has a button for updating the BIOS here – it’s straightforward.

One option offered by the SATARAID5 manager software was to “Convert the Legacy RAID group” to a “New RAID group” – I wasn’t quite sure what this would do but as far as I could tell a Legacy group can be read natively by the card, whereas the New group uses the manager software / drivers instead.
Hardware vs Software RAID then? Not sure. But I’m pretty certain that a New RAID group would be much tougher to setup as a boot drive. So legacy would seem better – if only it could be made to be seen in the Windows “Disk Management” window.

So – I took one of the two drives out and let the system boot. Still couldn’t see it.
Deleted the RAID group in the BIOS and let the system boot. Now we could see the drive. SATARAID5 recognised it as a normal non-RAID disk, went into PASSTHRU mode and allowed it’s use. (It is this PASSTHRU mode that makes the alternative SATA Link BIOS software pretty pointless in my view as it acheives the same result),
NB: Whilst deleting a RAID group only seems to delete the RAID metadata from the hard drives with the Sil3114, leaving the data intact, the same might not be the case with other RAID controllers. Beware!
I now reinstalled the other disk, delete the RAID group from that as well and let the system boot.
The system could now see both drives in PASSTHRU mode, the partitions were intact, but the “Disk Management” window informed me that it couldn’t mount the second drive as it had the same identifier as the first. Which of course it would – so that seemed reasonable.

SO – rebooted again – went back into the RAID BIOS and recreated the RAID group, I didn’t bother to make it copy the data again as it was clearly going to be the same, and then let the system boot.

This time success. The drives were still recognised as a Legacy RAID group, but this time were painted green in the SATARAID5 manager software and were visible and useable in Windows 7. A check in “Disk Management” showed that a single drive was being recognised (ie: the two disks are successfully operating as a RAID1 mirror pair).

I have no idea why they were painted red the first time and green the second, other than that maybe the RAID BIOS was very old when I created the first pair and the metadata was a bit rubbish.

Anyway – all well in the end.

So yes – it is possible to get the Sil3114 to drive a pair of RAID1 disks in Windows 7. (Phew!)

↑ Top