http://www.perlmonks.org?node_id=1008145

nperrins has asked for the wisdom of the Perl Monks concerning the following question:

WE recently came across the fact that Buffalo NAS units have MySQL, apache, PHP and Perl installed. Since our database is in MySQL and we have been using Perl front end for years, we thought this was a pretty neat opportunity to put the whole lot on a NAS. The bad news is that although Perl works, the DBI modules are not installed, so there is no data connection for Perl. (the CGI directory, with DBI.pm is there, but even "pushing" a path into @INC will not get it to work). It has taken me 2 days to hack the OS (a cut down linux). When I came to install with perl -MCPAN, it could not find "make" and I'm pretty sure there's no gcc. Any easy suggestions would be gratefully received.

Replies are listed 'Best First'.
Re: DBI on NAS
by davido (Cardinal) on Dec 10, 2012 at 19:19 UTC

    I've had three different Buffalo NAS's over the years, and have occasionally followed the user groups that hack them. You're right that they run a paired-down Linux OS. And people in the nas-central user group have managed to install other, more complete, distributions. But it's always one of those things that seems to be fraught with peril. After retiring my old 100baseT 160GB unit years ago, I attempted to follow the online instructions for jail-breaking it and installing a more open Linux dist I ended up bricking the thing. It was no great loss; I just pulled out the drive and gave it some other use. Later, my retired Gigabit, 320GB unit was successfully jail-broken, but the results were never all that useful. I don't intend to mess around with the 2TB unit I'm using now. I certainly wouldn't suggest diving too deep into the unknown on a unit that I'm still using for anything serious. Data loss is a high probability if something goes wrong.

    My suggestion is to get your hands on a Raspberry Pi if you want to tinker like this. Also, the Synology NAS's seem to be designed more for hackers.

    BTW: I too noticed that current firmwares for the Buffalo products have Perl available, but if I recall, it's a 5.8.x version, and the last thing I would do on a NAS that has important data on it is mess with upgrading the system Perl.


    Dave

      Dave,

      The advice is sound. I know it. However, I'm so close. I have no intention of taking serious risks with the array and if nobody can offer a simple fix, I'm out of here.

      It was all the NAS-Central posts that helped me hack into it in the first place (acp_commander.jar)

      Thanks for the post showing that it is very probably Debian - the unit is a Terastation III.

      After push-ing the correct path for DBI.pm, the simple DBI module script is pretty damning:

      `can't locate object method "connect" via package "DBI" (perhaps you forgot to load "DBI")`

      Not me mate, that would be BuffaloTech

Re: DBI on NAS
by blue_cowdawg (Monsignor) on Dec 10, 2012 at 18:27 UTC

    None of what you are saying surprises me much... NAS units don't typically come with any compilers installed. Is there an underlying OS (windbloze, *nix, ?) that you can possibly do a cross compile for? Or in the case of *nix compile on one machine and copy over?


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

      FYI: Buffalo

      Best regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

      Nothing to do with the big W. Underlying OS? Well I'd just assumed that being a NAS, it was simply a cut-down Ubuntu or Debian, but uname -a has been edited. It doesn't look dissimilar to an old Red Hat, but I just can't tell. The problem is, that the unit is holding 2.7Tb pf backup. Not something I want to cross compile. I might have to buy (God forbid) another unit to sort this all out. (I'd be happier installing gcc/DBI.pm if I knew how to do it.) Weird thing is that DBI.pm is there under a sub-directory (why copy it across in a cut down OS and not use it?). Nothing I do tells me that it is installed - but it is there. Is there a way of "activating" it rather than a full install? All the other modules work. (It doesn't run from the command line, I tried a one off perl script using "use DBI;" and "$dbh = DBI->connect(...." )
Re: DBI on NAS
by thundergnat (Deacon) on Dec 10, 2012 at 19:05 UTC