« Helpdesk Staff Wanted For Shit Work | Main | Pralines And Rain »

Hacking The ReadyNAS

As you may know, I use a Netgear ReadyNAS RND4410 for my internal network's mass storage. I'm very happy with the device, but it is a bit inflexible when it comes to back-ups.

The problem is that most forms of back-up that it provides for don't support the deletion of files that are no longer on the source. For example, if file A and B were backed up last night, but file A was deleted on the source by somebody this morning, tonight's backup should back up only file B (and even then, only if it has since changed) and delete file A from the back-up destination.

This level of control calls for the common free software program, rsync, to be used for back-ups. The ReadyNAS does support rsync, but Netgear's interface to it via the Web-based FrontView software is less than ideal. That's because it doesn't allow one to specify the use of rsync's many optional flags and parameters. In particular, it doesn't allow the essential --exclude flag to be used to omit certain directories from the back-up. I'm not being picky; I actually have a back-up job that will fail without the use of this flag.

Happily, though, the ReadyNAS is Linux-based and Netgear nowadays provide an EnableRootSSH patch, which will, oddly enough, allow you to ssh into your ReadyNAS as root.

I'd been resisting the temptation to do this for some time, because I had no good reason to do so. The ReadyNAS is sold as an appliance and one isn't really supposed to go prodding at its internals. The potential for rendering one's device non-functional is definitely there. Of course, I know what I'm doing (famous last words, I know), but I still have a healthy respect for devices supposed to operate as black-box appliances.

Nevertheless, I needed more flexible rsync functionality for my back-ups. An alternative to poking around on the Netgear would be to schedule the back-up jobs on the clients themselves, pushing the data to be backed up to the ReadyNAS instead of having the ReadyNAS run the back-up job and pull the data from the clients.

I wanted my back-ups centralised, however, so I installed the EnableRootSSH patch and went gently wandering across the file-system.

I found what I needed and was able to add the functionality I needed with 15 lines of Perl. Now, it's possible to define a set of extra options to be passed to an rsync back-up job when it's invoked.

I've posted details of how to do this to Netgear's ReadyNAS forum, so I won't repeat them here. I mention the hack here only to gain a bit of publicity for it, as I'm sure I'm not the only person who needs this extra functionality.

Of course, a much better solution would be for Netgear to integrate this into their FrontView Web-based interface. I'd much rather be able to use the supplied tools than have to resort to hacks like this.

Still, at one level, it is nice that Netgear have allowed this kind of thing to be done. It encourages experimentation, development and user community growth.

TrackBack

TrackBack URL for this entry:
http://www.caliban.org/cgi-bin/mt/mt-tb.cgi/679

Comments (1)

Thanks for your information and PERL script. I just implemented it on my client's readynas machine to have rsync operate on a different port and with a bandwidth limiter. This method (changing the backup perl script) works much better than my first attempt of just inserting a small shell script in in cron.daily.

http://carlhutzler.com/blog/

Post a comment


About

This page contains a single entry from the blog posted on Tuesday, 30 September 2008 at 18:05:27.

The previous post in this blog was Helpdesk Staff Wanted For Shit Work.

The next post in this blog is Pralines And Rain.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.34