Wednesday, 1 January 2014

Netgear Stora 3TB or 4TB drives

I am reapeating this post from the Netgear Stora forums as a backup, the post is copied from http://forum1.netgear.com/showthread.php?t=72007&page=3 anf here it is:

Since i'm not getting posts from the forum and netgear isn't going to upgrade to support 3tb drives, i'm just going to post it here:

First, you need SSH access to your stora:

SSH Access to a Stora

First you need to get your Stora’s product key, it’s located behind the Stora, close to the ethernet port or may be on the bottom of the device, it’s in the form “XXXX-XXXX-XXXX-XXXX”.

Then you just need to SSH to your Stora with a particular user which is just one of the users created through the web interface (the user needs to have the administrator flag selected) concatenated by the string “_hipserv2_netgear_XXXX-XXXX-XXXX-XXXX” (where XXXX-XXXX-XXXX-XXXX is your product key, ALL CAPITAL LETTERS!), this time you’ll get a password prompt instead of the “connection to x:22 exited: remote closed the connection”, just enter the user password, which is the one you use to access your Stora through the web interface and you’ll get user access. Now to get root access you just need to write “sudo -s” and enter again the user password, every ADMINISTRATOR user is allowed to use the sudo command. You’ll probably get a: “audit_log_user_command(): Connection refused” but it doesn’t matter, you’ll get the root prompt!

Example: if you created a user named “stora”, flagging the “user is administrator” during the Stora setup or through the web interface and your Stora’s product key is “1234-5678-9999-9999? you just need to ssh to your Stora and use “stora_hipserv2_netgear_1234-5678-9999-9999? as user, either using Putty or your favorite SSH client and enter that user’s password, then “sudo -E -s” and you’ll get root access, that’s it!

There’s another way to login concatenating the username with the string “_axsync_” but it allows you to issue only “mkdir” and “rsync” commands.

Explanation:

Basically Netgear, or more probably Axentra, ships his software with a modified version of SSHD that disallows regular user access, except for “root” and “apache” users, what it does is basically changing the logging username by substituting the first character with a “0? so it doesn’t match with the list of allowed users inside the /etc/passwd.

The SSH Deamon leaves a “backdoor” open, which basically is: if your username is appended with the above string, this substitution doesn’t take place, and you can login normally.

p.s. the “hipserv2_netgear” part may be different for some users, although I suppose is the same for everybody, if you already hacked your Stora using other ways I’d ask you to check the “/etc/oe-release” and post here the DistName line and we’ll try to figure it out.

Now to setup your stora to support 3tb drives:

Requirements:

- Any SSH client
- Two 3TB or bigger drives
- Any USB stick inserted in the front of the stora

Log into your device via SSH

Copy every line step by step:

---Get root

sudo -E -s

---Navigate to sbin directory

cd /sbin

---Partition the first drive with GNU parted (to make a GPT file format so that 3TB+ drives work)

./parted /dev/sda
mklabel gpt
yes
[Press Enter]
unit TB
mkpart primary 0.00TB 3.00TB (4.00TB for 4tb but I haven't tried it).
print
quit

---Partition the second drive with GNU parted

./parted /dev/sdb
mklabel gpt
yes
[Press Enter]
unit TB
mkpart primary 0.00TB 3.00TB
print
quit

---Make the raid0 array with a blocksize of 128 (the blocksize is defaulted to 64, but 128 might be more desireable)

./mdadm --create /dev/md0 --level=0 --chunk=128 --raid-devices=2 /dev/sda1 /dev/sdb1

y

or

---Make the raid1 array

./mdadm --create /dev/md0 --level=1 --chunk=128 --raid-devices=2 /dev/sda1 /dev/sdb1

y

--- Wait for sync (also shows in web interface)

watch cat /proc/mdstat

*** Takes Long Time *** Mine took 4 1/2 hours.

---Make the USB Stick a swap partition and mount it as swap drive

./mkswap /dev/sdc
./swapon /dev/sdc

---Then we partition the drives to XFS filesystem

./mkfs.xfs /dev/md0

---Then we are going to text edit the fstab system (this system mounts the drive at startup)

vi /etc/fstab

Remove the # in front of

/dev/md0 /home xfs defaults,bsdgroups,noatime,nodiratime 0 0

Then as a finishing very important touch we make sure that the raid0 array is remembered at startup

./mdadm -Q --detail --brief /dev/md0 > /etc/mdadm.conf

Then reboot the device

./reboot

Wait a few minutes, you should see the device boot. The HDD leds will go from green to orange for a few seconds, don't worry they will become green again and you should hear the HDD's working. This is probably the stora finalizing the partition so that it's ready for use.

18 comments:

  1. I have used Putty to login into to the Netgear Stora drive. As described above, you must create an account with Admin rights that you will use to login into the NAS drive and perform the updates.

    ReplyDelete
  2. After a couple of days of doing the same thing I finally learned about the vi, which is a the default editor that comes with the UNIX operating system. Use the editor to open the fstab file using this command:

    vi /etc/fstab

    then once the file opens, move to the end of the file using this command:

    :$

    type 'o' to create a new line in the file. Thereafter paste this entry into the file:

    /dev/md0 /home xfs defaults,bsdgroups,noatime,nodiratime 0 0

    In my case this entry did not exist and its purpose is to mount the drives as the NAS starts up. Press 'Esc' on your keyboard to exit the edit mode for the file and enter the command mode for the vi tool. To exit the file and save changes use the following command:

    :x

    Now my NAS has 2 x 2.7TB drives in RAID1 mode. The loading begins . . . :)

    ReplyDelete
  3. For more on the UNIX vi text editor commands and functionality please visit the following pages:

    VI Cheat Sheet: http://www.lagmonster.org/docs/vi.html
    Basic VI Commands: http://www.cs.colostate.edu/helpdocs/vi.html

    ReplyDelete
  4. Hey! Thanks for the guide!
    For some reason I had to manually add the"/etc/mdadm.conf"
    http://www.linuceum.com/Server/srvRAIDAuto.php

    ReplyDelete
  5. Is it possible to install two 3 tb hdd in JBOD mode?

    ReplyDelete
  6. Can it be done without using a thumb drive for swap? If so, how would you do it?

    ReplyDelete
  7. Thanks for this great guide - I can confirm this works with 4TB drives. Building a RAID1 array took a good 9 hours.
    In case anyone wonders, the thumb drive is needed for the mkfs command, the Stora memory isn't big enough to run the format - the thumb drive can be removed after that's done.

    ReplyDelete
  8. Works only once. After creating the array, I remove one drive and put an old one. Mounted it and copied the data. Put a new drive back. The array doesn't assemble back anymore... "/dev/sdb1 is too small to be added".

    ReplyDelete
  9. Thanks so much for this; I'd never have got my 4TB drives working on the Stora without this guide, as I've no Linux experience at all.

    The only thing I'd like to add is that you should exit the Watch command using Ctrl+C once mdadm has finished with the RAID array, as I spent some time wondering why the console seemed to have hung (n00b, I know).

    You also might need to skip the 'watch cat /proc/mdstat' line, or just Ctrl+C it early, as creating the RAID array took over 12 hours for me, by which time something seemed to have gone wrong as I couldn't run any more commands. You can continue on with the setup through to the very end while the array is created in the background, up to the point where you reboot. Then you can just run 'watch cat /proc/mdstat' again to see the process finish, after which you can reboot.

    Oh, and I also had to manually add the line '/dev/md0 /home xfs defaults,bsdgroups,noatime,nodiratime 0 0', presumably because mdadm hadn't finished running when I did it, but that wasn't a problem after I looked up how to use the 'vi' editor.

    All very obvious for experienced Linux users, I'm sure, but I figured mentioning this might save someone else the headaches I've had over the past few days!

    ReplyDelete
  10. I had no problem partitioning the XFS filesystem without the thumb drive. I'm using 2 3TB WD green drives.
    And, as other said, the entry in /etc/fstab was missing too, I had to enter it manually.
    The guide works perfect, I have 2.7 TB RAID 1.
    The resync took 7 hours.

    ReplyDelete
  11. Thanks! I've now got 8TB in my ancient Netgear Stora just as I was butting heads up against the capacity of the twin 2TB drives. Computer thinks the restore will take about a week!

    ReplyDelete
  12. I did all this and it worked with my 2 4TB drives. But I am puzzled...there is only one green HDD light on for the top light and I can't seem to access it via LAN \\stora or \\192.168.1.xxx
    is there something I'm missing?

    I can access it via the website and remotely via the website and via FTP but I can't seem to access the network share. I did check and the configuration through the website shows that it is setup for network sharing on WORKGROUP

    ReplyDelete
  13. OK I figured this out!

    Everything was working just fine the issue is that Stora uses SMB1 and my windows 10 laptop did not have SMB1 installed. I installed it in the Control Panel> Programs and Features>Turn Windows Features on or off>SMB 1.0/CIFS File Sharing Support

    Check the box and click ok. Then everything worked great!!! Thank you!

    ReplyDelete
  14. Your blog was really helfull to us and you give me such a nice information about Netgear. For any kind of support for Netgear Call 0800-090-3220 Netgear Customer Service Number UK

    ReplyDelete
  15. Hi All,

    I managed to get a single 4TB WD RED disk to work in a RAID 1 array using the below MISSING change

    ./mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 missing /dev/sda1

    also had to add below using the vi editor stated above

    /dev/md0 /home xfs defaults,bsdgroups,noatime,nodiratime 0 0

    Hope this helps some people

    ReplyDelete
  16. Quoting from the end of your post:

    "Then as a finishing very important touch we make sure that the raid0 array is remembered at startup

    ./mdadm -Q --detail --brief /dev/md0 > /etc/mdadm.conf"

    What if we are setting up both drives in RAID1 instead of RAID0? Do we use the same command, or is there a different command we need to use in this step?

    ReplyDelete
  17. Can you do all his on a different machine? ... I have a dual bay usb 3.0 device for HDDs... and then pop the disks right back in stora?

    ReplyDelete
  18. Hello, thanks for sharing this guide, Can this be done with just one 3tb drive now, and then add another 3tb at a later stage? I'm about to upgrade my stora MS2110 after all these years.

    ReplyDelete