User avatar
himesh
Posts: 3
Joined: Mon Sep 10, 2012 8:00 am
Location: Kandy
Contact: Website

Making a NAS with R.Pi

Mon Sep 10, 2012 8:08 am

I'm a student in Sri Lanka,
I'm making a NAS as one of my projects, Can you guide it to me, I'm willing to install FreeNAS on the R.Pi. Will it work. If not can you please give me some information about some good NAS os like FreeNAS and a starting point to my project.

Thank you.
Lahiru Himesh from Sri Lanka - Student

darkside40
Posts: 10
Joined: Mon Sep 03, 2012 2:28 pm

Re: Making a NAS with R.Pi

Mon Sep 10, 2012 1:14 pm

Using the Pi as a "real" NAS faces some problems.

First of all it only has fast ethernet. Second you can only connect storage via USB 2.0. HDD's are only connectable via an external hub.

But if you want to make some experiments, grab yourself a copy of Raspbian, install Samba on it and share a directory which is placed either on the SD or an attached Thumbdrive.
That would be a start, unfortunately you haven't told us what you really want to do with your NAS.

Btw. i dont think that there is a FreeNas Version for the Pi till now, althought some BSD distributions are already announced in the Wiki http://elinux.org/RPi_Distributions

User avatar
himesh
Posts: 3
Joined: Mon Sep 10, 2012 8:00 am
Location: Kandy
Contact: Website

Re: Making a NAS with R.Pi

Tue Sep 11, 2012 10:42 am

darkside40 wrote: That would be a start, unfortunately you haven't told us what you really want to do with your NAS.
As you asked I need to use this as a File Server, to download torrents, ftp server, and some other little things. I do no need much power from this server. That's why I choose R.Pi
Lahiru Himesh from Sri Lanka - Student

darkside40
Posts: 10
Joined: Mon Sep 03, 2012 2:28 pm

Re: Making a NAS with R.Pi

Tue Sep 11, 2012 11:08 am

The simple problem is that you wont be happy with the Transfer rates which the Pi is able to offer.

Reading through the forum people state that they experienc transfer rates of 200kb/s up to 2MB/s using FTP or Samba, which is in fact incredibly slow.
But there is no other way finding out than trying by yourself.

So grep yourself the Pi an active USB Hub to power an external HDD, pack Raspian onto the SDCard.
Than i would create a Swap File or a Swap Partition onto the HDD and use the rest for the data. It is also important which Filesystem you format the HDD with. On my Seagate Dockstar i had good experience with XFS Partitions.

After that install Transmission for Torrent downloads, and Samba or vsftpd for the file transfers and you are done.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Making a NAS with R.Pi

Tue Sep 11, 2012 12:10 pm

I'm sure I saw a post where someone with an ext4 formatted USB HDD was claiming transfer speeds of 7-8 Megs/second. He said that NTFS adds a lot of overhead.

Here's the thread

When I copied a file from SD card to USB HDD the other day, I logged in via ssh and "top" showed me that the NTFS process was using 40% cpu during the transfer.
Alex Eames RasPi.TV, RasP.iO

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Making a NAS with R.Pi

Tue Sep 11, 2012 12:46 pm

Here are instructions to create a Samba NAS
http://elinux.org/R-Pi_NAS

User avatar
himesh
Posts: 3
Joined: Mon Sep 10, 2012 8:00 am
Location: Kandy
Contact: Website

Re: Making a NAS with R.Pi

Tue Sep 11, 2012 3:50 pm

All of you are really helpful. I'm really happy. Also thank you very much for your help. I will try to build my NAS with 40gig first. Then It will be easy to reformat the HDD with many types to identify what is the best file format that works with R.pi and on my NAS. Thank you very much. I really appreciate your help. Also I'm sure I need more help in future. :)
Image
Lahiru Himesh from Sri Lanka - Student

mole125
Posts: 228
Joined: Tue Jan 10, 2012 2:01 pm

Re: Making a NAS with R.Pi

Tue Sep 11, 2012 4:15 pm

Don't forget to share your results once you've tried a range of file sytems!

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Making a NAS with R.Pi

Tue Sep 11, 2012 4:19 pm

Alex Eames RasPi.TV, RasP.iO

lewmur
Posts: 391
Joined: Sun Dec 25, 2011 3:20 pm
Contact: Website

Re: Making a NAS with R.Pi

Tue Sep 11, 2012 5:45 pm

alexeames wrote:I'm sure I saw a post where someone with an ext4 formatted USB HDD was claiming transfer speeds of 7-8 Megs/second. He said that NTFS adds a lot of overhead.

Here's the thread

When I copied a file from SD card to USB HDD the other day, I logged in via ssh and "top" showed me that the NTFS process was using 40% cpu during the transfer.
I read that post and re-formatted my 500gb USB drive from NTFS to EXT4 and can vouch that it works. Also, switching to the kernel_cutdown.im helps.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Making a NAS with R.Pi

Tue Sep 11, 2012 10:49 pm

lewmur wrote: I read that post and re-formatted my 500gb USB drive from NTFS to EXT4 and can vouch that it works. Also, switching to the kernel_cutdown.im helps.
Hmm, guess I'll have to try that. I've just liberated a 500 Gig USB drive from general backup duty after installing a 2tb media server. :lol:
Alex Eames RasPi.TV, RasP.iO

User avatar
Mr.Dave
Posts: 148
Joined: Sat Jun 30, 2012 6:59 pm

Re: Making a NAS with R.Pi

Tue Sep 11, 2012 10:57 pm

I have a WRT160NL router with USB2.0 port and 400MHz CPU

I have DD-WRT running on it, and an 80GB EXT4 Laptop drive connected via IDE > USB adapter

I get 10MB/s+ uploading from PC to HDD via 100mbps LAN (I am guessing it would be faster with a Gigabit LAN) and the same speed streaming from / download from router to PC

I use it every night to stream a film or two over Wireless G to my laptop upstairs

Now... if my 400MHz router can do all that, I don't see any reason why the Pi should be any worse at all

:)

ps. I tried FAT32 and NTFS and they both capped out around 2-6MB/s and also maxed out the routers little CPU, EXT4 is by far the best format

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Making a NAS with R.Pi

Wed Sep 12, 2012 8:24 am

A WRT router has a dedicated Ethernet port. The RPi uses USB to connect to Ethernet, so this causes some delays.

User avatar
Mr.Dave
Posts: 148
Joined: Sat Jun 30, 2012 6:59 pm

Re: Making a NAS with R.Pi

Wed Sep 12, 2012 8:40 am

bredman wrote:A WRT router has a dedicated Ethernet port. The RPi uses USB to connect to Ethernet, so this causes some delays.
I didn't know that, as in they both share the same resources/interface on the board ?

(Sorry not an electronics expert by any means)

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Making a NAS with R.Pi

Wed Sep 12, 2012 8:53 am

AFAIK the Pis Ethernet is a a USB device which is connected to a
USB hub. The Hub and USB NIC are combined into one chip.
The combined chip is connected via internal USB to the main SoC which
in this case acts as USB host. The USB parts of the SoC seem to heavily rely
on CPU power. This and the fact everything runs over USB is causing multiple issues.

This seems to be the combined chip family :
http://www.smsc.com/index.php?tid=300&pid=135

EDIT :
This looks like the USB Host of the SoC http://www.synopsys.com/dw/ipdir.php?ds ... 2_0_hs_otg

ghans

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Making a NAS with R.Pi

Wed Sep 12, 2012 9:12 pm

OK, so I reformatted my 500 Gb NTFS drive to Ext4. Just ran a test copying a file onto it from the NAS (on a gigabit connection, which I've seen go as high as 60 Megabytes/second).

I copied an mp4 which was 2230456191 bytes (2127 megabytes) from the NAS to the Ext4 USB HDD and it took 4 mins 15s. So 2127/4.25/60 = 8.34 megabytes per second DOWNLOAD. Pi is directly connected to gigabit ethernet (although the Pi port is max 100 Megabits/s = 12.5 Mb/s). NAS is connected via a gigabit switch to the gigabit router.

To copy the same file from the USB HDD back to the NAS location it was originally copied from took 5 min 15s. So 2127/5.25/60 = 6.75 Megabytes per second UPLOAD.

This is with no other changes to a normal Raspbian install. If you were to customise with cutdown kernels etc you might be able to squeeze more out of it.

Conclusion. Switching to EXT4 gives me at least double the throughput speed. I was getting about 2-3 Mb/sec on NTFS. 6-8 Megs per second is good enough for most things. :D
Alex Eames RasPi.TV, RasP.iO

User avatar
Mr.Dave
Posts: 148
Joined: Sat Jun 30, 2012 6:59 pm

Re: Making a NAS with R.Pi

Thu Sep 13, 2012 11:53 am

alexeames wrote:OK, so I reformatted my 500 Gb NTFS drive to Ext4. Just ran a test copying a file onto it from the NAS (on a gigabit connection, which I've seen go as high as 60 Megabytes/second).

I copied an mp4 which was 2230456191 bytes (2127 megabytes) from the NAS to the Ext4 USB HDD and it took 4 mins 15s. So 2127/4.25/60 = 8.34 megabytes per second DOWNLOAD. Pi is directly connected to gigabit ethernet (although the Pi port is max 100 Megabits/s = 12.5 Mb/s). NAS is connected via a gigabit switch to the gigabit router.

To copy the same file from the USB HDD back to the NAS location it was originally copied from took 5 min 15s. So 2127/5.25/60 = 6.75 Megabytes per second UPLOAD.

This is with no other changes to a normal Raspbian install. If you were to customise with cutdown kernels etc you might be able to squeeze more out of it.

Conclusion. Switching to EXT4 gives me at least double the throughput speed. I was getting about 2-3 Mb/sec on NTFS. 6-8 Megs per second is good enough for most things. :D

Similar experience to me, ext4 is definitely the better drive format :)

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Making a NAS with R.Pi

Thu Sep 13, 2012 12:33 pm

Mr.Dave wrote:Similar experience to me, ext4 is definitely the better drive format :)
...as long as you don't need to plug it into a Windows machine. :lol:
(although there are ways round that I think)

*This is my 777 th post. Does that mean I can read, write and execute now? Who shall I execute?
Alex Eames RasPi.TV, RasP.iO

User avatar
Thijxx
Posts: 86
Joined: Mon Oct 22, 2012 1:25 pm
Location: The Netherlands

Re: Making a NAS with R.Pi

Fri Dec 21, 2012 10:30 am

alexeames wrote:
Mr.Dave wrote:*This is my 777 th post. Does that mean I can read, write and execute now? Who shall I execute?
:lol:
Mimi: Where'd you come from?
Doyle: My mom and the authorities are still trying to figure that out.

stevhorn5
Posts: 116
Joined: Wed Jul 04, 2012 5:47 pm
Location: Ontario, Canada

Re: Making a NAS with R.Pi

Fri Dec 21, 2012 11:37 am

alexeames wrote:I'm sure I saw a post where someone with an ext4 formatted USB HDD was claiming transfer speeds of 7-8 Megs/second.
I have mine formatted as ext4 and the best I've achieved is 1.7, but it more typically transfers at 1.4.

beavuz66
Posts: 1
Joined: Mon Feb 25, 2013 4:59 pm

Re: Making a NAS with R.Pi

Mon Feb 25, 2013 5:37 pm

If you want speed in a RPi NAS solution consider this.

use ext3 instead of ext4. It's faster and less demanding.
use NFS instead of AFP or SMB as much as possible, I'm able to pull almost full 100 mbps (10-12 MB/s) with NFS.
Cons of this would be; that there is no native support either in OSX or Windows for NFS, as far as I know.

I'm using NFS to connect my Linux machines to the NAS over LAN.
And SSHFS to connect over the internet. As SSHFS it's far more secure.

My biggest issue is OSX. As AFP and SMB solutions seem way too slow to do anything close to productive. This is the main reason I'm looking for a new solution.

Setup:
RPi, Debian Squeeze, a class 10 8 GB SD and a 2 TB USB 3.0 hard drive.

NFS - 10-12MB/s
SSH - 2-4 MB/s

Return to “General discussion”