HOWTO Stora WITHOUT a RAID; 2 ext3 drives as samba shares

Hacking and customizing the Netgear Stora NAS. With stock OS.
PostPosted: Tue Oct 19, 2010 10:08 am
So i've been searching around and seeing people wanting to get rid of the RAID. I for one want to do this, because i have bad experiences with raids and dataloss. RAID 1 is no option for me, since i need more storage, and RAID0 is no option for me because they're a pain to recover (afaik)

As i am changing the device completely, i'm assuming you're not using any of the webinterface or have the need for multiple users, shared folders or any other "feature" that comes with the stora other then just windows shares. I might fix the FTP later, although it might even still work.

This is a little guide to completely bypass the (to me useless) RAID in the stora. I'm also editing the default shares of the stora, effectively rendering the current web interface useless. I recommend to not use this interface at all anymore after you've done this. It loves to put default settings back.

WARNING! YOU WILL LOOSE ALL DATA DOING THIS!
WARNING2: This does not take multiple users into account. It's possible to do, but i have no need for multiple users or shared folders etc. So this will assume you have only 1 user that should be able to access everything. It might still work by playing with folder ownerships.
WARNING3: This removes the hotswapping ability. You will have to manually unmount the drive before you can remove it.
WARNING4: Don't just copy paste stuff, but READ. You might need to replace your username in some commands.

Code: Select all
vi /etc/fstab

comment the line with /dev/md0 with a #
reboot the device (unmounting doesn't seem to always work, it will mark the device as busy)

after reboot:
Code: Select all
fdisk /dev/sda
d
l

Now you should see no partitions
Code: Select all
n
p
1

keep pressing enter here untill the partition is made. Optionally you can make more partitions if you like.
Code: Select all
l

Now you should see 1 partition with the type "Linux". Something like:

Code: Select all
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1      121601   976760032   83  Linux


Repeat the same process for /dev/sdb

Now you can make the ext2 or ext3 filesystem on the disks. I picked ext3.

Code: Select all
mkfs.ext3 /dev/sda1
mkfs.ext3 /dev/sdb1


Now lets test if we can mount these 2 drives.
Code: Select all
cd /home/yourusername
mkdir storage1
mkdir storage2

mount /dev/sda1 storage1
mount /dev/sdb1 storage2

cd storage1
ls

You should see a lost+found folder now. If so, it means that worked.

Now lets edit fstab to mount on boot.
Add the following 2 lines:
Code: Select all
/dev/sda1 /home/yourusername/storage1 ext3 defaults    0   0
/dev/sdb1 /home/yourusername/storage2 ext3 defaults    0   0


Reboot the stora.
You should now be able to see the 2 drives mounted inside your username's home.

Now you have to change ownership to your own username rather then root, so that you have write permissions:

Code: Select all
chown -R yourusername:www /home/yourusername/storage1
chown -R yourusername:www /home/yourusername/storage2


After this is done, we can edit the samba config.
Code: Select all
vi /etc/samba/smb.conf


Here you can choose to change your workgroup and netbios name if you wish, since the default web interface will break your settings.

Remove all shares that say [MyFiles] [MyComputers] etc. Just comment them out.

I added the following:

Code: Select all
[Storage1]
comment = Storage 1
browseable = yes
writable = yes
valid users = %U
create mode = 0664
directory mode = 0775
force create mode = 0664
force directory mode = 0775
force security mode = 0775
force directory security mode = 0775
force group = www
path = /home/yourusername/storage2
guest ok = no

[Storage2]
comment = Storage 2
browseable = yes
writable = yes
valid users = %U
create mode = 0664
directory mode = 0775
force create mode = 0664
force directory mode = 0775
force security mode = 0775
force directory security mode = 0775
force group = www
path = /home/yourusername/storage3
guest ok = no


Restart Samba:
Code: Select all
/etc/init.d/smb restart


Now you should be able to visit your stora with the netbios name you set. I called mine CastleHall. In windows i went there with \\CastleHall\. There i now see 2 shares named Storage1 and Storage2. Both have 1TB of free space.
User avatar
Administrator
Administrator
Posts: 326
Joined: Mon Dec 21, 2009 3:41 am
PostPosted: Tue Oct 19, 2010 10:59 pm
Nice little how-to. Might want to consider posting on the wiki.

Jr. Member
Jr. Member
Posts: 68
Joined: Sat Oct 30, 2010 5:17 pm
PostPosted: Sun Oct 31, 2010 7:01 am
Hi, i am looking into getting the stora and this option would be great. I also don't trust raids.
I would like to know if it is possible to use this option and have the webinterface work also.

" I recommend to not use this interface at all anymore after you've done this. It loves to put default settings back."
Does it undo your 2 ext3 drives as samba shares hack?

Thank you
User avatar
Global Moderator
Global Moderator
Posts: 1426
Joined: Mon Apr 05, 2010 2:45 pm
Location: Italy
PostPosted: Sun Oct 31, 2010 8:13 am
are you aware that now Stora supports JBOD natively? it means both your hard drives will form a virtual drive made of the sum of the two, this is not raid and it will work with the web interface, only drawback is if a drive fails, you'll lose everything on that drive of course, but this will happen also with this configuration.
--pippone
PostPosted: Sun Oct 31, 2010 9:02 am
micha3l19 wrote:Hi, i am looking into getting the stora and this option would be great. I also don't trust raids.
I would like to know if it is possible to use this option and have the webinterface work also.

" I recommend to not use this interface at all anymore after you've done this. It loves to put default settings back."
Does it undo your 2 ext3 drives as samba shares hack?

Thank you


I dont know i don't use the webinterface. For me its really a just backup server. I dislike the default webinterface.. its sluggish, it puts thumbnail jpg's all over my drive, by default it wants to log in through some netgear website, and it really doesnt do what i'd like it to do. I might start looking into alternatives, but for now i just have httpd disabled on there.

Jr. Member
Jr. Member
Posts: 68
Joined: Sat Oct 30, 2010 5:17 pm
PostPosted: Sun Oct 31, 2010 9:57 am
pippone wrote:are you aware that now Stora supports JBOD natively? it means both your hard drives will form a virtual drive made of the sum of the two, this is not raid and it will work with the web interface, only drawback is if a drive fails, you'll lose everything on that drive of course, but this will happen also with this configuration.


yes i know it does JBOD but with that option files are put of both hard drives randomly. I would like to have separate drives so that when you copy files you chose to write to only one drive only. Don't know if you can do this with this option.

Jr. Member
Jr. Member
Posts: 68
Joined: Sat Oct 30, 2010 5:17 pm
PostPosted: Sun Oct 31, 2010 10:07 am
robindegen wrote:
micha3l19 wrote:Hi, i am looking into getting the stora and this option would be great. I also don't trust raids.
I would like to know if it is possible to use this option and have the webinterface work also.

" I recommend to not use this interface at all anymore after you've done this. It loves to put default settings back."
Does it undo your 2 ext3 drives as samba shares hack?

Thank you


I dont know i don't use the webinterface. For me its really a just backup server. I dislike the default webinterface.. its sluggish, it puts thumbnail jpg's all over my drive, by default it wants to log in through some netgear website, and it really doesnt do what i'd like it to do. I might start looking into alternatives, but for now i just have httpd disabled on there.


The only reason i would like to use the webinterface is so that i can use the internal player to stream on a mobile phone that doesnt have the codecs for the movie.
Don't know if i am seeing this the right way please correct me if i am wrong.

So the reasons why i want to use this option is:

- have two hard drives separately so that if one fails the other one is still safe and that it doesn't write files randomly on both drives.
- access stora from a mobile phone and stream movies using the internal player of stora instead of the mobile phone codes witch in most cases dont support the codec format.

Can you help me to direct me to the proper configuration for this or if i am saying things that are impossible to do.
Help a newbie!!!

Thanks!

ps: i know you need root first before you can do anything like this...
PostPosted: Sun Oct 31, 2010 10:10 am
For me it had trouble playing a lot of the stuff on my normal PC as it is
User avatar
Global Moderator
Global Moderator
Posts: 1426
Joined: Mon Apr 05, 2010 2:45 pm
Location: Italy
PostPosted: Mon Nov 01, 2010 7:57 am
I see your point of having two different mountpoint and I don't think the web interface will restore the original smb.conf but you'll need a particular config in order to use the web interface to access both mountpoints, probably the best way to achieve this is to mount one drive inside the other drive mount point, keeping the original structure intact since I'm not sure you can easily modify the web interface config.
I agree with robindegen, I wasn't able to play anything through the web interface except some 3gp or flv video, I think the supported codec are just a few.
--pippone
PostPosted: Mon Nov 01, 2010 8:08 am
The thing is, it seems to use 2 players. If you're on firefox/chrome it uses a very limited flash player, if you're on Internet Explorer it uses the mediaplayer ocx plugin to play the videos... So really.. its useless, because if you're on windows you have media player anyway (if you'd even wanted to use this at all), and on other platforms where you'd want to stream to, the flash player doesnt work.

I've been looking at ways to do this, and the best way i found was to use ffmpeg to convert your videos to flv, and then using a flash flv player. You can automate this process, but it wont work on-the-fly, and it will also use more diskspace (you basicly have your real video and an flv encoded version). Also some videos (especially ones that have faulty keyframes) can't be converted with normal settings either. It's something i've been looking at for a while now.

About the webinterface and smb.conf:
It will restore it if you touch any of the samba related settings on the webinterface, even if you just change the netbios name it will put the whole original config back.

Jr. Member
Jr. Member
Posts: 68
Joined: Sat Oct 30, 2010 5:17 pm
PostPosted: Mon Nov 01, 2010 11:04 am
thanks for the replies.
since you both say that the web interface is useless, then no use in using it.
I would like to stream to Samsung galaxy s phone(android). I know it isnt compatible with the android but i wont be using the web interface but some type of ftp app. As long as the android phone has the right codec for the movie i want to stream everything should be ok hey?

I also read that someone said that they couldn´t stream a movie on the fly and had to wait for it to fully download?

One more question, Can i mount 1 drive now as ext3 drive as samba share then when that one gets full mount the second drive in bay 2 as ext3 drive as samba share and that wouldn´t affect my first drive information?
It might sound as a stupid question but better ask then no ask.

THANKS FOR THE HELP.
PostPosted: Mon Nov 01, 2010 2:24 pm
If you have enough bandwidth sure. Keep in mind that most movies you'd download have a pretty high bitrate. You could however re-encode them to a lower bitrate and maybe also a better suitable format for streaming, for example flv, but there are more formats to do this ofcourse.

As your second question, i'm pretty sure its possible. I can't give you an exact answer on how to do it, but i imagine you'd be able to run some kind of disk quota that, when the quotum is reached runs a script that modifies the samba settings and then restarts smbd. That would do what you want really, but i think you'd have to script that yourself

Jr. Member
Jr. Member
Posts: 68
Joined: Sat Oct 30, 2010 5:17 pm
PostPosted: Mon Nov 01, 2010 4:06 pm
THANK ALL for the help.
I have just ordered a netgear stora and will get back to you guys when i try out this conf.
User avatar
Global Moderator
Global Moderator
Posts: 1426
Joined: Mon Apr 05, 2010 2:45 pm
Location: Italy
PostPosted: Tue Nov 02, 2010 5:31 am
micha3l19 wrote:thanks for the replies.
since you both say that the web interface is useless, then no use in using it.
I would like to stream to Samsung galaxy s phone(android). I know it isnt compatible with the android but i wont be using the web interface but some type of ftp app. As long as the android phone has the right codec for the movie i want to stream everything should be ok hey?

I also read that someone said that they couldn´t stream a movie on the fly and had to wait for it to fully download?

I'm a proud owner of a rooted HTC Desire (android 2.2), after trying several ways to do what you're trying to do, I found out the best option is to root your phone and install the cifs kernel module and the "CIFS Manager" app (or use a cooked rom that already have these) that will allow you to mount a SAMBA share directly on your phone, then use RockPlayer to play any movie with any codec, it's free and also support multiple audio tracks and subtitles. I don't have enough bandwidth to use this setup via internet so I tried it only on my LAN, but if you have enough bandwidth, you may be able to setup an OpenVPN (rooted android supports it) to safely access your LAN from internet and happily mount your Stora on your android device.
micha3l19 wrote:One more question, Can i mount 1 drive now as ext3 drive as samba share then when that one gets full mount the second drive in bay 2 as ext3 drive as samba share and that wouldn´t affect my first drive information?
It might sound as a stupid question but better ask then no ask.

THANKS FOR THE HELP.

The only problem I see with this is that, unless you manually disable some scripts, as soon as you plug a second hdd on the Stora, by default it add that disk as a second device of your Raid1 configuration, or as a second device for the JBOD config, which are the two option you have on the Stora, disabling this can be done, but it has to be inspected.
--pippone

Full Member
Full Member
Posts: 143
Joined: Mon Sep 27, 2010 5:18 am
PostPosted: Tue Nov 02, 2010 7:03 am
pippone wrote:The only problem I see with this is that, unless you manually disable some scripts, as soon as you plug a second hdd on the Stora, by default it add that disk as a second device of your Raid1 configuration, or as a second device for the JBOD config, which are the two option you have on the Stora, disabling this can be done, but it has to be inspected.


My intent was to have setup the same as mich3l19 is aiming for. My first drive is filling up rapidly. I have a second WD10EARS that will need to be plugged in within the next 7 days. Expect the dumb questions soon :)

Cheers, Brenton
Next

Return to Netgear Stora Stock

Who is online

Users browsing this forum: No registered users and 2 guests

cron