Setting up the Buffalo Linkstation Quad Pro LS-QVL/R5 NAS (Part 2)

This is part 2 of the series on setting up the Buffalo Linkstation Quad Pro LS-QVL/R5 NAS.

This article will concentrate mainly on gaining root access into the NAS box as well as installing some useful addon software that will compliment the functionality of the NAS. Note that I am no expert and I am just documenting whatever I learned from others.

The Buffalo NAS is essentially a linux box and being a linux appliance, the unit is extremely customizable and expandable. But why would anyone want to “gain root access” into the NAS? Personally, I do it for several reasons:

  1. I want to be able to install a hard drive temperature daemon that will log/monitor the temperature of all the hard drives and present the information in the form of a temperature graph.
  2. I want to be able to install a file manager (console based and/or web based) so that I can copy/move files quickly within the NAS without incurring unnecessary network traffic from the NAS to the router (and back again). It is such a time waster in my opinion.
  3. I want to be able to install the Network UPS Tools (also affectionately known as NUT). This may come in handy for the support of other UPS apart from APC (which is natively supported by the NAS via the web admin).

Gaining Root Access into the NAS

It is important to acknowledge herewith that the steps outlined here present a certain risk as there is a possibility that the NAS may be bricked during this process. Please do not blame me if there are mistakes in the following section.

Credit is given to the following articles/sources where I obtained most of the information from:

Credit and sincere thanks in particular is given to the author of http://www.ipvvi.net/ who assisted me throughout this course and helped me to overcome the problems I encountered.

These are the steps that will eventually (hopefully) lead to a successful root login:

Step 1: Download ACP_Commander.

ACP_Commander is a java application which will allow us to telnet into the NAS to “hack” some backend configuration so that we can proceed to login as root. This can be downloaded here.

Before this is downloaded, first check if java support is available on the local PC. To do this, start up a console window (using cmd.exe) and type the command “java -version”.

If java support is available, the system will return the following messages (or something similar):

C:\>java -version
java version “1.6.0_24”
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing)

If java support is missing, then this have to be rectified first before proceeding further.

Once ACP_commander is downloaded, save it to a temporary folder. I put mine in d:\temp.

Step 2: Verify that the current administration password actually works

If you login into the NAS box with the password 123456, then this is your administration password. I will use this as the example in the screenshot below. Please note that the IP address of my NAS is 192.168.1.3. You should use whatever IP address assigned to your NAS.

First we want to make sure that ACP_commander can actually use the administration password and login into the NAS to execute a fairly simple command (such as “ls /l”)

This is the first baby step. The command we are interested is:

java -jar acp_commander.jar -t 192.168.1.3 -ip 192.168.1.3 -pw 123456 -c “ls /”

The screen should return something similar to the following:

I have obscured the name of my NAS and associated MAC address to protect the innocent 🙂

If the command returns the directory names found in the root directory of the NAS, then the administration password used is correct, i.e. 123456 is indeed the administration password in this case. We should give ourselves a cookie for getting this first baby step right.

Note – I am not sure why the command is always giving me an ACP_STATE_PASSWORD_ERROR but the whole process appears to work fine otherwise so I did not bother myself to answer this question.

Step 3: Change Root Password

The command to execute is:

java -jar acp_commander.jar -t 192.168.1.3 -ip 192.168.1.3 -pw 123456 -c “(echo ABCDEF;echo ABCDEF)|passwd”

This is assuming that the root password we wanted to change is ABCDEF. Use a sensible password here.

The screen should return something like this:

Again, the same ACP_STATE_PASSWORD_ERROR message returns. I just ignore this.

Step 4: Allow Root Login

This step is a bit tricky as it appears that I need to execute both commands to get the whole thing working. I am not sure what gives, but here it is anyway. Your mileage may vary here.

Execute this command first:

java -jar acp_commander.jar -t 192.168.1.3 -ip 192.168.1.3 -pw 123456 -c “sed -i ‘s/UsePAM yes/UsePAM no/g’ /etc/sshd_config”

And then follow with this command:

java -jar acp_commander.jar -t 192.168.1.3 -ip 192.168.1.3 -pw 123456 -c “sed -i ‘s/PermitRootLogin no/PermitRootLogin yes/g’ /etc/sshd_config”

The screen should return something like this:

Step 5: Check that the sshd_config file is actually what we wanted.

Execute this command:

java -jar acp_commander.jar -t 192.168.1.3 -ip 192.168.1.3 -pw 123456 -c “cat /etc/sshd_config”

The screen should return something like this:

The line that we are interested in is marked above. Make sure that PermitRootLogin parameter is set to yes.

Step 6 – Restart SSH service

The last step is to restart the SSH service.

Execute this command:

java -jar acp_commander.jar -t 192.168.1.3 -ip 192.168.1.3 -pw 123456 -c “/etc/init.d/sshd.sh restart”

The screen should look like this:

Step 7 – Start to SSH into the NAS

In order to SSH into the NAS, we will need a SSH client. First download the mighty SSH client called putty. Get this here. It is freeware and the executable file is extremely small in size (and portable too).

Load up putty and the screen should look like this: Enter the IP address of the NAS and make sure the SSH connection type is selected.

A console window will open.

When the “login as” prompt appears, type root.

When the “root@192.168.1.3’s password:” prompt appears, type in the new root password previously entered. In this example, it will be ABCDEF.

If everything is working, you will be able to login into the NAS. Otherwise you will get the ACCESS DENIED message which will simply indicate that something you are doing is wrong.

Type “cd /” at the prompt. Then type “ls”.

The screen should return something like this:

If you see this, it means the whole process is successful. Time to give ourselves another cookie!

Step 8 – Getting to know our NAS

Now that we are at the prompt, we can play around a bit to find out more about our NAS.

Here is some typical screenshots:

CPU info

This seem to indicate that the NAS has a 1.6GHz ARM v5 processor.

Linux Version

Firmware Version

S.M.A.R.T. Support

Now the most important thing about a NAS is the hard drives. Let’s see if we can some basic info:

Now this is a surprise for me as it says that my 2TB Seagate drives do not support SMART!!

I wasn’t too impressed and I wanted to find out more about this drive as I believe this is just software error. The first thing I observed is that this particular drive (and I would assume this is the same as the other 3 drives as I bought them in one batch) has a firmware version called CC32. A quick google reveals that this is actually a newer firmware as the earlier CC31 version appears to have some issues with some Bios not detecting the drive. Okay so I have drives loaded with the latest firmware but I am still not happy that SMART is not supported. I still believe this is just the error of the software that comes with the NAS.

Another google search reveals that the Seagate drives are actually SMART supported….so I will just need to figure how to do this on my NAS.

Step 9 – Install IPKG

Some useful information here:

Overview of the ipkg package management system

IPKG on the Linkstation (for end-users)

Transmission on Linkstation Pro Quad

# mkdir /mnt/array1/tmp

# cd /mnt/array1/tmp

# wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/ls-mvkw-bootstrap_1.2-7_arm.xsh

# sh ls-mvkw-bootstrap_1.2-7_arm.xsh

For whatever reason, this generate an error like this:

It seems that the bootstrap file need to access my /mnt/disk1 directory which obviously does not exist in my system (I only have array1 and disk4).

So I look into the /mnt/array1/tmp directory and observed that there is another sub-directory called bootstrap. I cd into this directory and further noted that there is this file called bootstrap.sh.

a “cat bootstrap.sh” command show the following (screenshot is incomplete as the file is pretty long):

I am not an expert but a quick inspection of this file seem to suggest that the bootstrap file is hard coded to use /mnt/disk1 (refer to the first red rectangle). And the second red rectangle seem to suggest that if /mnt/disk1 cannot be found, then the program will exit.

I wonder what if I change the first line from /mnt/disk1/.optware to /mnt/array/.optware.

first I create a backup file in case I screwed up anything.

# cp bootstrap.sh bootstrap.sh.backup

# vi bootstrap.sh

So I fired up the vi editor. I just hate to work with vi, as I always use the joe editor in the past. But anyway, this is how I go about it. If you need help about using vi, here is a good page to start.

Okay. Now that this is done. execute the following lines while inside the /mnt/array1/tmp/bootstrap directory.

This is what I get on my screen.

It appears that the ipkg installation might be successful.

According to the article “IPKG for the Linkstation (for end-users)“, the bootstrap process will effect the following:

  1. /mnt/disk1/opt or /mnt/array1/.optware is created….and it gets mounted to /opt from now on.
  2. in /opt several folders are created
  3. ipkg gets installed to /opt/bin/ipkg and the config with the selected feeds gets created at /opt/etc/ipkg.conf
  4. “PATH=/opt/bin:/opt/sbin:$PATH” gets added at last line in /etc/profile….which means you can use the binaries installed via ipkg as if they were normally installed.
  5. “[ -x /etc/init.d/rc.optware ] && /etc/init.d/rc.optware start” is added to /etc/init.d/rcS at the end…which has the effect that everything in /opt/etc/init.d gets started on bootup.

A quick check on my NAS confirmed the following:

  1. An “/opt” directory was created. Inside this directory there are a further 7 folders, notably bin, etc, lib, man, share, tmp and var.
  2. ipkg is found in the directory /opt/bin directory and the ipkg.conf is also available at /opt/etc directory.
  3. “cat /etc/profile” reveals the following last line in the file: PATH=/opt/bin:/opt/sbin:$PATH. Side note – Note that the session will only update the $PATH variable when you exit this session and ssh into the NAS again.

I would say IPKG is installed successfully.

Exit the SSH session and SSH into the box again.

Step 10: Update IPKG.

cd into /opt/bin directory.

# ./ipkg update

Then

# ./ipkg list

will return a long list of supported apps.

Posted on April 16, 2011, in Buffalo Quad Pro NAS. Bookmark the permalink. 14 Comments.

  1. wonder if you can help me…. i cant get ssh to work.

    i tried your steps and it worked fine but when i tried to ssh with putty it says access denied.

    so i tried http://buffalo.nas-central.org/wiki/Open_Stock_Firmware_LS-VL
    and that didnt work either

    now i seem to have deleted my sshd_config file as the cat command doesn’t turn up anything.

    how can i salvage this… i’m running 1.42 maybe thats the problem.

  2. Hi Zed,

    This is quite unusual as the steps should have worked fine. If u tried to SSH and it says access denied, chances are that you have not completely rooted the box. Perhaps try to repeat steps 2 onwards and see if that solve the problem? Apart from that I can’t think of anything else. I am not familiar with the other firmware version however, so the best is to put your questions in places like nas-central where the experts are. Sorry I am of not much help here.

  3. Hi, thanks for the help.

    i solved it, it was a problem with 1.42 firmware
    after i forced 1.40 firmware update, then ur steps ran without a hitch.

    now on to my next project.. trying to get transmission/clutch/sickbeard to run on it.
    i hope it works!

  4. Hi Mate,
    Good stuff on the BB Quad, I have a 4TB BB Quad & after playing for a week I decided to erase & set up anew, WOW it takes 342minutes to write 0’s then another 342 minutes to write 1’s to EACH drive!! then it restarts & you need to set up the array etc & then the amber led will flash 17 & everything will slow down for I am not sure how long but I expect hours while it checks the array. So expect that a 8TB box would take about 80 hours from start to finish if you erase.
    I have firmware 1.53 which I installed & I see there is a 1.54 also.
    My next adventure is to get webaccess & a USB drive running.
    I’ll leave the amber flashing & go to Koh Chang for the weekend to enjoy some Seafood & beaches.
    Regards,
    Ed
    Chanthaburi Thailand

  5. Hi Ed,

    Thanks for visiting and I am glad you like the articles. Come back often 🙂

    Cheers
    Joseph

  6. Many thanks for this step-by-step, Joseph.
    Worked like a charm on my LS-QV2.0 that I just bought.

  7. Thanks, this was really helpful.. It worked on my Linkstation LS-VL with 1.56 firmware.

  8. We are using Buffalo NAS LS-QVL.
    To get a console access we need to modify /etc/pam.d/sshd
    Just execute this command in one line:
    java -jar acp_commander.jar -t 192.168.1.3 -ip 192.168.1.3 -pw 123456 -c “echo -ne \”account required pam_unix.so\nsession required pam_unix.so\nauth required pam_permit.so\n\” > /etc/pam.d/sshd”

  9. Hello, in the fisrt step why do you change the password of root if it is working ?

  10. hi joseph, can you help me on my issue? I used to connect my LS-WVL thru SSH (Using putty), but very often always disconnect session after login as root, and when I want to connect again need to wait for a few mins. Do you have any idea whats wrong with this??
    Many thanks in advance

  11. Hi Cyberjan. I don’t quite know what is happening either. Did you try setting the connection timeout setting on your putty SSH client? Maybe try a different SSH client and see if you are experiencing the same issue. Google also if others are experiencing the same issue may also help.

  12. Will this work for LS-WVL/R1 ?

  13. No idea mate. Give it a try.

  14. A little typo I’m sure but when you edit the bootstrap.sh make sure it points to the same location i.e. /mnt/array1/.optware

Leave a comment