Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
As one of my external disks died recently, costing me half a TByte of personal data, I decided it is high time to get myself a NAS. Now, if I only wanted network storage, I could just purchase a commercial device, but seein how I'm currently running several servers on my desktop machine, I see this as an opportinity to take some weight of its shoulders.
However, I am not quite sure how to proceed. I have read about FreeNAS, and the project sounds amazing, but people usually say it's not meant for running servers. On the other hand, I would easily be able to build a small-scale server, but I'm not at all sure if I could build a secure NAS on my own. FreeNAS' concept with all the ZFS features, the high efficiency, jailed applications etc. sounds rather complicated. Also, I have never played with RAID.
As I don't want to run two (or rather three, including desktop) computers at all time: What would you recommend to do?
Final system would be something like this:
- 4x 3 TByte HDD in RAID 10
- ZFS with all features that make sense to me (will have to read into it)
- NFS, SFTP, SMB
- HTTP and SQL server for selfmade applications (just for testing and the like, nothing heavy)
- Getmail-SpamAssassin-ClamAV-Procmail-Sendmail-Dovecot chain to collect my mail to IMAP
- OpenCloud with WebDAV, CalDAV, CardDAV
- Torrent and Spotify client and download manager
- Media server with DLNA-like streaming
- Everything encrypted, if performance allows
- Would, of course, be attached to the web, so I'd have to be able to harden the system with little knowledge to boot
... and likely some more things along those line which I can't think of right now, but nothing really demanding. Everything except the file and media server will probably have to be available to up to ten users. Those would all be students, so I guess there won't be thousands of mails per person or any equivalent workload.
Would it be at all advisable to run that on a FreeNAS system, or would it make more sense to do a complete installation of Linux / *BSD (OpenBSD?) / whatever and try to do the same as FreeNAS does?
And for either case, I know this is tricky: What hardware would you recommend? I have long been unable to purchase anything that would be able to even connect the disks in question, so I really don't have any foothold from where to start looking. Are the specs the FreeNAS project recommends enough to run the servers I mentioned on the same PC?
Uh, well, I figured I wouldn't need a backup medium in RAID 10? OK, assuming both disks of a RAID 1 fail at the same time, I'm screwed, but that's very unlikely, provided I have a good PSU... and backing up 6 TByte is kinda hard. But if backups are not even considered optional in ihis situation, I guess there isn't much of an option except attaching a third disk to both RAID 1 from time to time, have it mirrored onto there, and then unmount it again.
Ed.: Bah. Just read that RAID 1 only works in pairs... would it be possible to turn off the system, take out one disk from each RAID 1, and replace it with an empty one? In this case, I'd have a copy of the RAID 1 when it went down on the disks I took out, and the new disk would be mirrored from the existing RAID 1 disk at boot, right? And if my house burns down and I keep the two backup disks, put them into a RAID 1 controller and build a system around them, would they still work as if nothing had happened?
You might want to consider a RAID5 or if your controller supports it RAID6 and always use a hardware RAID over a software pseudo-RAID.
Just having a RAID does not mitigate the need for regular off-site backups. Unless of course you're going to jump back in to your burning house to save your NAS.
Hm... as I said, I have no real experience with RAID. Is RAID 5 really worth it?
The controller alone costs more than the disks. Also, I did not want to buy everything at the same time. So, with RAID 10 in mind, I would have to buy a cheap controller and two disks for a RAID 1 now, and expand them later on by adding another RAID 1 and combining them to a RAID 0. If I want to start with a RAID 5, I'll have to buy an expensive controller, plus three disks to boot. Granted, I'd have more storage space, but at a lower reliability. The added speed isn't really much of a plus, as I don't have 10GbE infrastructure. Also, if what I described above is possible (changing disks to backup without much fuss), RAID 10 would be much easier to take backups from. Last, if one of the RAID 5 disks fails, my NAS is down - if one of the disks from a RAID 10 fails, I can just keep it running and plug in the new disk as soon as it arrives. (Hoping the other part of the RAID 1 doesn't die in the meantime, of course...)
Or did I miss any major points, and RAID 5 is indeed better suited for a NAS? I know Netgear has X-RAID, that sound perfect (basically, just put any more than 0 disks into a machine, and it automatically switches RAID level between JBOD, 1 and 5 and changes the size), but I don't think there are any controllers for that outside Netgear boxes.
Also, what do you mean with "use hardware over software RAID"? (Sorry, not a native speaker...) Combine them, or use hardware RAID rather than software? (Was planning on doing the latter, anyways. FreeNAS supports hardware RAID as well.)
Hm... as I said, I have no real experience with RAID. Is RAID 5 really worth it?
In reality a RAID1+0 will only support a double disk failure if they are on the same mirror pair, so realistically it'll only support a single failed disk. With RAID5 you'll also be able to survive a single disk but it won't eat as much disk space. 4 3Tb drives in a RAID1+0 will give you approx 6Tb usable space, the same in a RAID5 will give you over 8Tb.
Quote:
Originally Posted by Vinter
The controller alone costs more than the disks.
Depends on the controller, I've seen/used IDE and SATA controllers that supported RAID5 that were not expensive.
Quote:
Originally Posted by Vinter
If I want to start with a RAID 5, I'll have to buy an expensive controller, plus three disks to boot. Granted, I'd have more storage space, but at a lower reliability.
Lower reliability? What makes you think that?
Quote:
Originally Posted by Vinter
if one of the RAID 5 disks fails, my NAS is down
Your NAS is not "down", your disk is down until you replace it, the RAID will keep serving data just fine. I've had disk problems before with servers and just pulled the disk from the RAID while the server just kept on running. End users didn't notice a thing, and this was a server doing several hundred millions of Euro worth of transactions a year.
Quote:
Originally Posted by Vinter
Also, what do you mean with "use hardware over software RAID"?
> Depends on the controller, I've seen/used IDE and SATA controllers that supported RAID5 that were not expensive.
Huh. Everywhere I checked, people recommended controllers for more than 250 Euros to get RAID 5, while lower RAID levels are available much cheaper. Have RAID 5 controllers become so much cheaper recently? If so, which one could be recommended for up to 4 disks, keeping in mind that maximum speed is not an issue in this scenario?
> Lower reliability? What makes you think that?
What you mentioned above, that each of the mirror pairs can miss a disk. OK, realistically speaking, that may not be much of a difference...
> Your NAS is not "down", your disk is down until you replace it, the RAID will keep serving data just fine.
Oh, OK. So, if one disk goes missing from a 3-disk RAID 5, the other two will overwrite the parity stripes with reconstructed data (making them kind of a RAID 0?), and restore them when a third disk is reattached?
But how to backup a RAID 5? If I use 3 TByte disks, not all of the data will fit onto one medium. Would I have to shut down the NAS, take out each disk individually, and dd them to another one of the same size? Or is there some trick to it, like sequentially swapping out the disks in the RAID 5?
Have RAID 5 controllers become so much cheaper recently? If so, which one could be recommended for up to 4 disks, keeping in mind that maximum speed is not an issue in this scenario?
What you mentioned above, that each of the mirror pairs can miss a disk. OK, realistically speaking, that may not be much of a difference...
Realistically if you lose 1 disk off each pair you'll lose data.
Quote:
Originally Posted by Vinter
Oh, OK. So, if one disk goes missing from a 3-disk RAID 5, the other two will overwrite the parity stripes with reconstructed data (making them kind of a RAID 0?), and restore them when a third disk is reattached?
I'd recommend 4 disks.
Quote:
Originally Posted by Vinter
But how to backup a RAID 5? If I use 3 TByte disks, not all of the data will fit onto one medium. Would I have to shut down the NAS, take out each disk individually, and dd them to another one of the same size? Or is there some trick to it, like sequentially swapping out the disks in the RAID 5?
Your backup thould be taken to a different medium rather than relying on pulling disks out of a RAID.
Why not create a NAS with 4 disks in a RAID5 so that you end up with 6Tb in total. Then use three 2Tb external drives to back this data up with rsync once a week and then store the external drives off-site or somewhere else secure. The durability of the external drives is less important in this case as you're only using them once a week for the backups and for restoration if something really bad happens.
OK, judging from the 250+ Euros I had read I assumed those cheap controlelrs were just too crappy to be used.
Well, things look a lot clearer to me now Thank you very much for your help! I'll see how I'm going to achieve what I want now, excactly, but you have me convinced that RAID 5 is the way to go.
You can also run RAID 5 in software. There may be a performance hit depending on the system CPU's capability but if it's juts a storage server in may be unnoticeable.
BTW, all NAS (network Attached Storage) is a fancy name for a file server. The main difference being that most modern NAS units are also designed to function as streaming media servers as well. FreeNAS is nice. You might also liek to look at OpenFiler which is a bit more complex.
Raid is not a backup option !!
If you accidentally delete your data partition, you delete at the same time your backup. If your computer gets on fire struck by lightning etc. Your data and backup is gone. Raid is to easily recover from a failed drive. Which all drives will do at some point in time. Performance of raid 10 is much better as raid 5. Sure it wastes more space but hdd space is cheap these days. Advice get a extra 3 TB disk make a back-up of the important data. Put it in a computer out of your house. And do ones a week a incremental back-up over the internet for your important data. Often a lot of data is nice to have but no loss when gone so no need to back-up that part.
If you use a raid controller and your raid controller goes bananas. You often need the same controller which may be difficult to get after a few years. When you use software raid aka mdraid and you mainboard dies you can just put your drives on a new board and easily rebuild your raid array without loss of data.
I think this is not a real hardware raid controller but a controller in which the driver uses the processor to do the hard work.
So you can save your money and use software raid directly.
I would really NOT go for this banana controller "addonics" as I suspect (like whizje) it's not real HW RAID controller.
You can go for some 3ware controller for as low as 30 € (often named as "industry standard RAID controller") which doesn't give as much transfer speed as successor 9550sx (which supports SATA 2 / 300mbps)
and some of the Enterprise drives (let's say 3 pieces) for around 110 € / piece
That would give 2TB of space in RAID 5 (if you want RAID 10 then you need 4 drives).
Then you can buy (configure yourself if you want) a reasonable "low-end" computer to put it all together into one case (just make sure you have enough internal mount places for hard drives 3.5" - that would be 4)
with almost any kind of CPU and 2GB of RAM
then you can put /install almost any Linux distro and configure HTTP, FTP.. SAMBA for sharing files and/or XBMC for playing video contents (there is a XBMCbuntu already made to install and use - I haven't tried or used any)
here is a list of DLNA open source software.
Sum that up you end with a nice "home server" for around 700 € (taking into account a computer for around 350 € and 3 hard drives + RAID controller)
well, all in one you could buy this NAS adapter or newer version for quite a reasonable price, but then you still need to attach a USB external drive to it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.