Turn your computer into network storage. An overview of the key points when creating a NAS. Windows Server is the worst solution for a home NAS

Turn your computer into network storage.  An overview of the key points when creating a NAS.  Windows Server is the worst solution for a home NAS
Turn your computer into network storage. An overview of the key points when creating a NAS. Windows Server is the worst solution for a home NAS

This is another article about assembling another NAS for home use. What prompted me to write it? Starting to assemble a NAS for myself, I re-read all the articles I googled in which people told how they chose and assembled storage for themselves. Thanks to these articles, I avoided some mistakes when choosing hardware and software. The first time I assembled a configuration that completely suits me to this day. Therefore, I am sure that my article may be useful to someone.

True, I must say that by profession I am a system administrator and this imposed certain requirements on the configuration, and on the article - details are in the descriptions with illustrations for ~2 MB. So yes, I assembled the NAS myself. But without fanaticism. In the article I did not limit myself to describing the hardware, but also told how I use the resulting machine. Anyone interested is welcome to the cat!

There comes a time in the life of every IT specialist when the case runs out of space for disks.

Before running to the store, I tried to decide what I wanted to get from the device. Now, and what I might want Then.

  1. Storing large amounts of data. It is obvious.
    But there was a small nuance in that I had a certain number of hard drives. Let's just say, nasysadmin. These are exactly what I was going to use. All disks are of different sizes, manufacturers and operating time. In total they gave a volume of 2-3 terabytes that was quite sufficient for me.
  2. Torrents.
    The device must have a sane client for these purposes.
  3. Flexible settings and additional features.
    This is a vague criterion, just for the future, for the possibility of using additional services, for example, cloud storage or a media server.
  4. Low power consumption.
  5. Low or no noise level.
  6. Minimum price.

Ready NAS

By that time, I had experience communicating at work with Synology DiskStation DS411 and D-Link DNS-320. I was in love with the Synology OS! Stable, convenient, understandable, its own repository with applications, useful updates - that's all about it. The hardware itself also pleased with its uptime and silence. The only thing I wasn’t happy with was the price (late 2014). I wasn’t ready to pay 20,000 rubles. for simply storing movies with music there. Naturally, there were cheaper models with two disks, but four disks are an honor for storage, and a desktop computer has two.

Using the DNS-320 as an example, I saw that if I choose the cheapest one, then I will get a more than modest device. Actually, distributing files locally is the only thing this box can do more or less normally.
At this stage, it became clear that the NAS would have to be assembled from computer components.

HDD issue
While researching prices for branded storage, I was simultaneously thinking about the configuration of disks in the system. RAID? JBOD? Separate volumes? On the one hand, storing films with music on a raid is wasteful. If lost, they can be downloaded again. On the other hand, there are a couple of folders that need to be kept safe, preferably without developing special backup scripts (backups need to be monitored and checked). In addition, the disks I already have are of different sizes. Accordingly, after building any RAID, I will lose hundreds of gigabytes by “trimming” disks for the smallest and the whole disk for checksums (for example).

I can’t objectively evaluate the performance. It copes well with NAS tasks on Windows Server. I did not do synthetic tests.


A case with optimal price/quality ratio was quickly found. Cooler Master Elite 120.

I looked at more compact cases, but their prices were no longer so compact. The case turned out to be comfortable and of high quality. Three HDDs are inserted as standard.

The fourth is through a purchased adapter into the CD-ROM bay. (yes, yes, I had to buy an adapter from the collective farm; there was no other one in the stores)

The case comes with 2 fans. One 120 mm for the HDD and one 80 mm for the motherboard radiator (you already noticed it in the previous photos).

A nice touch included in the kit were two adapters from 3.5" to 2.5" HDD. A special bonus is that the adapters are suitable for any other case. The holes for the bolts are in a standard place, and the height of the structure with the installed disk does not exceed the height of a regular HDD.

There were no problems during the assembly process. All wires are long enough, installation and subsequent access to components is convenient (except for the obvious things). In general, a building for people!

I had all the other hardware, namely disks, power supply and RAM (SO-DIMM). In total I met the 5,085 rubles.

I note that two gigabytes of RAM is noticeably not enough. I keep the minimum possible set of programs on the servers. I don’t have any updates from Google and Adobe, any applications from drivers, etc. Minimum set, only what you need. With all this, in a quiet state, 800 megabytes of memory are occupied. It is clear that with a certain user activity, active use of the paging file begins with all that it entails. In general, take more memory.

Noise
He is. You can't put it next to the bed. The loudest fan blows on the heatsink on the motherboard. The fan in the power supply and on the hard drive cage cannot be heard above the sound of the drives themselves. It's a shame that the included case fans don't support PWM. Then their speed would be controlled by the motherboard:

And I would probably always keep it at a minimum. I am also inclined to believe that the heatsink on the processor does not require additional cooling provided in the case. Be that as it may, the issue noisily faded into the background. I installed the system unit where its noise does not interfere at all and forgot about it for now. When the time comes, either the fans will be replaced with ones that support PWM, or a controller for them will be purchased. Well, for example:

Software

To work with torrents, I first installed the classic μTorrent. It has a wonderful feature in its settings: you can specify a folder that μTorrent will constantly monitor for the presence of a torrent file. As soon as a new file is detected, the program begins downloading. And there is another checkbox “Delete torrent file when downloading starts.” What happens. I'm at my computer, downloading a torrent file and putting it in a special folder on the NAS. After 5-10 seconds it disappears. This means μTorrent “took” it and started downloading. Another checkbox called something like “Add a random extension to the file until it is completely downloaded” allows you to see in the download folder which files are still downloading and which have already been downloaded. According to this scheme, I didn’t need the μTorrent interface at all to download torrents.

I went even further and installed YandexDisk on my server, telling μTorrent to look for torrent files in the YaDisk folder. Now, sitting at work and choosing a movie for the evening, I put the torrent file on YaDisk and after 20-30 seconds it disappeared...

The HWMonitor program was very useful, displaying a nice window on the desktop with the temperature of the sensors and the speed of the fans (by the way, about the temperature in the case):

When you log in via RDP, you can immediately appreciate that everything is spinning and spinning and is not on fire.

Unfortunately, the author in new versions of the program divided it into paid and free. The free version only has minimal basic functionality. And all the goodies like the screen shown in the screenshot have apparently been transferred to the paid one. I have version 0.6.0 beta.

wake-on-lan

This scheme did not work for me for long. I thought about the fact that most of the time the server just sits there and wastes electricity. Of course, he distributes torrents, but those unfortunate couple of dozen of my favorite films that I keep for myself are not even a drop in the bucket. In general, the torrent network will not be poorer at all if I stop distributing.

So, I want the NAS to only work when I need it. And the rest of the time he slept. And wake him up via the network, not with a button. There is Wake-on-LAN technology for this. This feature must be supported by the motherboard and the network controller (if it is external). Fortunately, many models have this function, like mine. The computer is woken up using a “magic packet” sent to the network indicating the MAC address of the network card. There are specialized free programs for this, or, for example, my Asus router has such a function. But during operation it turned out that Windows itself sends this magic when accessing a network resource. Both when accessing via RDP and when accessing a network folder. This is both good and bad. The good thing is that no additional programs are needed. What’s bad is this if you connect the shared folder on the client as a network drive, or add it to favorites:

Then, when the client is turned on, a “magic package” will be automatically sent to the server and wake it up. I found this out when I was trying to understand why my NAS wakes up on its own. In the case of a network drive, the behavior is clear - the client tries to obtain information about the drive in order to display its status (size, availability). But I don’t understand why Windows checks links in favorites. Although this feature may, on the contrary, be useful to someone - they turned on their work machine, and the NAS automatically started with it.

The server can sleep restlessly not only because of Windows machines on the network. There were several days in a row when the NAS fell asleep and immediately woke up. I blame the router, but there is no evidence yet.

The server goes to sleep using its standard means if there is no network activity for a specified time.

μTorrent has been replaced by Free Download Manager. It has a checkbox “Close the program when the download is complete.” I start the download, check the box, disconnect from the remote desktop. Free Download Manager closes when the download is complete, and the NAS goes to sleep using an inactivity timer.

Naturally, YandexDisk also had to be removed from the server.

wi-fi

When I was thinking about where to put the NAS in the apartment, I decided to try Wi-Fi. Fashionable, comfortable, modern. TP-LINK TL-WN881ND was purchased:

Everything was connected via the Asus RT-N12 router. Everything was great until I sat down to watch the movie in good quality. Regular.mkv 1080p size ~20 GB. Halfway through the movie, the picture and sound began to cut out. Media Player Classic showed that all its buffers were empty and could barely pull up the next piece of video. This was the case with all “heavy” films. When simply copying a large amount of information, I also noticed that after a while the speed dropped significantly. A superficial search for information on this problem did not yield any results, and it was easier for me to connect a twisted pair cable to the server than to further deal with Wi-Fi.

In no case do I want to slander wi-fi and make loud statements about its readiness for long and high loads. But if you are going to connect your NAS through it, then be aware that there may be problems.

For example, banal data backups. If locally, then use the same Cobian Backup on a schedule in a special folder. If on the Internet, then BitTorrent Sync. In the case of Cobian, do not connect the backup folder as a network drive. In the case of BitTorrent Sync, use shadow copies on the server (what is it and how to configure it). Encryption viruses will no longer be so scary.

I often find a home server useful at work when I need to check access to work resources from a different IP from the Internet. All sorts of VPNs, OpenVPNs, etc.

Media server. In tandem with Smart TV, all multimedia functions can be completely transferred to them. If the TV has a normal browser and support for a keyboard and mouse, then you can even download content through the TV.

Video surveillance server in the door peephole. Or a video recording of a cat’s activity...

Part Two: Software

Spit in the eyes of anyone who says that you can embrace the immensity
Kozma Prutkov

To whom and why

Your home NAS should satisfy you; it is not a production system that must provide certain formalized indicators. There are two difficulties in describing such a thing. One is included in the epigraph, and the second is related to the acute shortage of telepaths. But I will still try to make some reasonable assumptions, and they will pass the IMHO category. To save space, I omit “IMHO” further. We believe that every sentence has this label. If it was not possible to see the light in your specific case, I apologize; perhaps another text will suit you.

This one is addressed to those who are assembling their first NAS, capable of installing Windows, but have never seen the FreeBSD Handbook or Oracle Solaris ZFS Administration Guide. NAS is also assembled by IT-advanced citizens; they usually deploy the full version of the selected operating system. It’s interesting that some newcomers get involved in the topic and eventually do the same.

Tasks

To avoid misunderstandings, let’s immediately determine why we need NAS.

The first task is secure storage. The data must survive a hardware problem, such as disk failure.

Second - give access to stored data. Support for SMB/CIFS for Windows is required; NFS (for media players), FTP (for downloading large amounts of data) and AFP (if you have a Macintosh at home) are highly desirable. DLNA is often mentioned, more on that separately.

Third - offline download documents from the network using various protocols.

Fourth - automate backup from computers on the local network. Family photos, videos, documents created by you are unique and irreplaceable, but at home it’s all well stored in one and a half copies: one on a laptop drive, half on some kind of USB drive where the photos were uploaded last fall. If (more precisely, when) such data is lost, and the NAS allows you to restore it, you will experience sincere pleasure from your foresight. Or vice versa.

Requirements

Moderately difficult initial setup. A person should receive a working version on the first day. Maybe not completely tuned, but giving a useful result. This, by the way, means that an experienced user should be able to handle the initial setup in a couple of hours.

Simple and sufficient current management, everything necessary must be done through the web interface. Including saving and, if necessary, restoring the configuration. For special, expert purposes, access via SSH or similar is desirable.

Transparent everyday use. Your better half with a liberal arts education should be able to handle it: watch a movie on TV, listen to music, backup from her laptop to the NAS should be done automatically, etc.

DLNA/UPnP

Understand, What exactly you need from a DLNA server, really only by testing. Most of the tasks of the average user, such as transferring media to a tablet, are solved by almost all UPnP servers. And regarding the use of DLNA for output to a TV, I will quote the developer of HMS, one of the best software UPnP/DLNA media servers: “For owners of TVs from most manufacturers, the use of this technology is a temporary stage that ends either with the purchase of a network media player (I think, the preferred option) or by connecting the TV as a monitor. If time and nerves are precious, then perhaps you should skip this stage.”. The capabilities of a player built into a TV and an inexpensive separate one, like Dune, Popcorn or WD, in terms of omnivorousness, picture quality, ease of use, etc., usually vary greatly. True, built-in players are progressing quickly, so it’s worth deciding on specific hardware.

Disk arrays and file systems

Why do we need an array?

The main issue when building a NAS is the organization of disk space. As we found out in part 1, there are a lot of disks, 4-6, sometimes 10 or more. They can, of course, be used separately. But combining into an array is convenient because the space is available in one piece. In an array without redundancy, when a disk dies, the data on it and, often, depending on the implementation, on the entire array are lost. You have the right, using the “nothing, I’ll pump it over” argument, to save on redundancy. Those for whom time is more valuable prefer arrays with redundancy. Important: no RAID can replace backup. RAID ensures data availability in the event of disk failure. Unrecoverable data must be backed up. Fortunately, there are usually very few of them.

The term redundant array is often confused with the term RAID. But more advanced technologies are also available. When choosing NAS software, you can use them or do without it. To understand what is best for you, let's think about the problems of RAID and file systems.

RAID 5 (6, etc.) is subject to a serious problem. When writing to an array, data and parity blocks must be written simultaneously. But writing to multiple disks is not an atomic operation. If a problem occurs during the writing process (power failure, disk failure, etc.), it is possible that the data and parity blocks will not match each other. If data is written incorrectly, in many cases it can be corrected or at least detected when servicing the file system located on top of the RAID (chkdsk, fsck...). But incorrect parity blocks, in the worst case, can go unnoticed until the moment when the array is reconstructed from them. And instead of data, garbage will be restored. Moreover, the garbage will be recorded without any warning. Additional information on the problem can be obtained.

Fig 1. RAID write hole. On the left - data and parity blocks are synchronized, recording is in progress. In the center there is a power failure. On the right are data and parity blocks Not are synchronized, but RAID doesn't know about it.

Industrial RAID controllers solve this problem by using a BBU, a “battery.” After a failure, even with the power off, the controller remembers what data should have been written. And when the opportunity arises, it writes this data to an array.

Reconstruction failure

Let us have a RAID 5 of five 3T disks, in which one of the disks has failed. The array must be rebuilt, and in this case you will have to read 4 disks × 3T = 12T = 1.2 10 13 bytes = 0.96 10 14 bits of information, regardless of the degree of filling of the array - after all, nothing is known about the files at the RAID level. Healthy user-class disks have the legal right to fail once every 1·10 14 bits on average (see, for example). That is, with a very high probability we will get a reconstruction failure simply due to the disk specification. Plus there is some possibility that the disk will actually break. The traditional recipe: use enterprise-class disks (with a probability of failure of 10-15), do not get carried away with high-capacity disks and use RAID 6. Unfortunately, all three tips for the price are not very suitable for home conditions.

Reliable file system

Let's move one level higher, to the file system. They expect a simple thing from it - the ability to write files and then read what is written. Paradoxically, most file systems do not guarantee this: they rely on the ideal operation of the equipment - the disk controller, the cable, the disk itself. A hardware failure doesn't just lead to data loss - it leads to unnoticed data loss by the user. You copy your photo archive - but in fact, some of the files are already rotten. You can find out about this by comparing checksums, which is what we do when downloading firmware and similar data that cannot fail. Why not compare checksums using FS?

Another “childish” wish for the FS - that it work and not break - is also not really fulfilled. A file system without journaling, such as FAT or ext2, can bury all its contents if it fails. Journaled file systems, such as NTFS or ext3, are much more reliable because... you can find the point of consistency and reproduce the log. Is it possible to create a FS that cannot get into a contradictory state at all? You can - via Copy-on-Write. We do not write the data on top of the old ones, but select a new block, write there, and if everything is in order, we replace the pointer from the old data to the new ones.

ZFS

ZFS combines the functionality of a file system and support for RAID-like arrays. Distributed under a free license (CDDL). Created by Sun Microsystems for Solaris. Ported to FreeBSD since version 7.0. Just recently, the ZOL (ZFS on Linux) project reached the release stage. We can expect the rapid spread of ZOL, the process has already begun. There is also a project for Mac OS X, ZEVO, see.


Figure 2. ZFS automatically compares checksums, detects errors, and recovers data if it is stored redundantly (Figure from eonnas.com).

Take a closer look at ZFS if you are interested in a file system with the following capabilities:

  • storing checksums and not allowing garbage to be read instead of data;
  • maintaining integrity to such an extent that there are simply no utilities like chkdsk or fsck for it;
  • equipped with a tool for checking the integrity of cold data and its automatic correction if the data is stored redundantly;
  • capable of instantly creating snapshots of your state and storing them for at least every minute of the month, mounting any set of snapshots, and rolling back to the snapshot.

Take a look at ZFS if you're interested in RAID:

  • software, i.e. does not require a hardware controller;
  • hardware-independent, there would be SATA ports;
  • without Hole by appointment;
  • capable of reconstructing a degraded array with partially unreadable disks with the loss of only those data for which there is no copy;
  • working when checking integrity and reconstruction only with payload data, and not with the entire array;
  • with support for analogues of RAID1 (mirror), RAID5 (redundancy in the size of one disk), RAID6 (two) and even “RAID7” (saving data if any three disks of the array fail), as well as more complex options like RAID50 or RAID60.

ZFS also has disadvantages, the main ones of which are:

  • You cannot expand a RAID-Z array onto one disk. You can replace all terabyte disks with triters - and increase the volume. You can assemble another RAID-Z from 3 (or more) disks and add it to the existing one, creating a single pool. But you can turn a RAID-Z1 of 5 disks into a RAID-Z1 of 6 only by leaking information somewhere, destroying the array and creating a new one.
  • The array cannot be reduced. You can only increase it - add disk groups, change disks to larger ones.
  • Resource intensity. ZFS constantly calculates checksums, which creates a load on the processor and uses memory for caches. At home I worked with an Atom 330 and 2 GB of memory. Although when using ZFS this Atom was not enough for me to fully utilize the gigabit network, 40-50 MB/s will suit many.

Yes, one more thing: if you destroy ZFS and create a new array from the same disks (that is, give a couple of commands and/or press buttons in the web interface, in both cases ignoring warnings), then the data from the destroyed FS will be securely buried - unlike , for example, NTFS, data from which is relatively easy to recover even after re-creating the partition table. Whether this is considered a disadvantage depends on your point of view.

According to the author, the goodies provided by ZFS are so tasty that they are worth paying for in additional hardware requirements. And you should only build a NAS with ZFS. But the reader has a fundamental right to free choice. This choice will be decisive when choosing software for the NAS, so it should be made consciously.

ReFS + Storage Spaces

In Windows Server 2012, Microsoft offered the ReFS file system and the Storage Spaces volume management system. The combination of ReFS and Storage Spaces can be considered to some extent an analogue of ZFS, with properties not implemented in the latter. The flexibility of removing and adding disks, thin provisioning, etc. is interesting. There are also disadvantages - this is a proprietary license, available only as part of Windows Server 2012 and Windows 8.1.

It’s bad that, judging by the reviews of those testing, the performance of the ReFS-Storage Spaces combination drops significantly, significantly, when using options with parity, that is, roughly, an analogue of RAID5 or ZFS RAID-Z. Even worse, the first reports of data loss due to ReFS failures appeared, and official support did not solve the problems. So it looks like an interesting solution needs to mature.

btrfs+mdadm

Officially, Btrfs for Linux has not yet received release status, although it has been in development since 2007. Like the vast majority of file systems (and unlike ZFS), it is a file system created on top of a block device. To get, roughly, an analogue of ZFS, you need to add, for example, a well-debugged mdadm, one of the capabilities of which is to rebuild the RAID when adding a disk without losing data.

Traditional FS

And, of course, the existence of advanced FS does not force you to choose one of them. Perhaps NTFS, ext4 or UFS is more suitable for your NAS - the native file system for the axis you choose. On relatively weak hardware, this choice may be the only one.

Software options


Fig 3. Approximate algorithm for choosing software for a home NAS

What and how to choose from

I would like to recommend downloading VirtualBox, installing several options you like there, and poking each one with a stick for several days. On a virtual machine it is cheaper, easier and faster than on real hardware. Seriously saves nerves. Especially if you don't like any of the options.

Three groups of software products can be used as self-assembled NAS software.

Firstly, you can install the full operating system. This could be Linux, UNIX or Windows depending on personal needs and preferences. Windows seems more familiar, *nix gives you more NAS for the same money, but configuring *nix from scratch is not a task for a beginner.

For such a beginner, option number two has been created - assemblies preconfigured specifically for NAS. They include a set of services and a web interface that allows a beginner to cope with setting up and using the product without a command line.

Finally, the third option is to install a full operating system, and on top of it some kind of web interface for configuration and management. The option is a compromise, an intermediate one. It makes it easier to use, but not to a level sufficient for an inexperienced amateur. And advanced citizens usually don’t like any kind of add-ons. We'll start with options for mere mortals.

Windows

In the profile thread, a survey was conducted about the operating systems used by forum members in self-assembled NAS systems, and Windows took third place with a result slightly below 20%. Of course, more advanced comrades also voted, but they were definitely not the majority.

A result that can surprise. Windows is the operating system most familiar to most. You can make a NAS based on it - after all, 20% of respondents did it. The reason for the modest figure is that using Windows as the NAS axis has not only advantages, but also disadvantages:

  • Windows is a paid software that competes with free software that is in many ways more functional for specific tasks.
  • Supports the existence of viruses, which requires constant loading of anti-virus databases.
  • Requires constant use of updates, and after them a reboot is often necessary. This is not to say that all *nix systems can work without intervention and reboot for years. But many can.
  • Windows is a graphical system and requires a monitor, keyboard and mouse to function naturally. NAS usually lacks them. But of course, there are remedies to solve the problem.
  • Windows is resource intensive.
  • Disk arrays and checksums at the file system level are not the strongest point of Windows, especially in desktop versions.

Disadvantages are not fatal; they can be overcome, bypassed, ignored, in the end. But enough to consider other options. And discover their virtues, and commit a lot of discoveries, sometimes without meaning to.

Giving an incomplete list of the advantages of Windows, in addition to familiarity, we can mention:

  • Native high-speed SMB implementation.
  • Hardware compatible. Drivers for Windows must be written.
  • Wide selection of software. That is, for NAS you usually don’t need much choice. But the more specific your requirements, the more likely it is that they can be solved with software for Windows.
  • A huge variety of instructions and solutions for all occasions, in your native language.

NAS on Windows is entirely possible. But the topic of setting up Windows is covered in many sources, which will allow the author to risk refraining from discussing it.

Ready *nix builds for NAS

The most popular in the profile branch are three assemblies - NAS4Free, OMV (=openmediavault) and FreeNAS 8.x. All are aimed at the average amateur and allow you to satisfy typical needs either out of the box or by downloading plugins.

There is a history of confusion surrounding the FreeNAS brand. The FreeNAS product evolved over many years and then split for a number of reasons. The well-known name, which is a trademark, became the property of iXsystems, which decided to completely rewrite the code and close the original development. This is how FreeNAS 8.x was born, based on FreeBSD 8.x. However, the original project, thanks to the efforts of enthusiasts, survived, was transferred to FreeBSD 9.x and is successfully developing under the name NAS4Free. As a result, upgrading from FreeNAS 0.7 is supported on NAS4Free, but not on FreeNAS 8.

A detailed, including Russian-language, description of the installation and configuration of assemblies can be found in the FAQ of the profile branch and, so we will save the text here.

We will summarize the official hardware requirements for these three products in a table, especially since they are not so easy to Google.

And, of course, you need disks to store data. It seems that the FreeNAS developers are not specifying the requirements for it to just start working, but for it to work productively. In any case, the instruction manual for installation on a virtual machine indicates a minimum RAM size of 512 MB.

NAS4Free

NAS4Free is distributed under the free BSD license. The project has a long history (comes from m0n0wall, FreeNAS 0.7, 0.6 and earlier), the major digit of the current version is 9. That is, the assembly is well polished, but continues to develop. Based on the latest release of FreeBSD 9.1.

NAS4Free is compiled in two versions, for 32- and 64-bit Intel x86-compatible processors. You can use NAS4Free in three ways: LiveCD/LiveUSB, full and embedded. The “live disk” mode is traditional for *nix distributions and is intended primarily for familiarization. In actual use, installation is usually done. The full option is a traditional installation, usually on a hard drive. For installation, a small partition is used, the size of which is set during installation, and a swap partition, and the rest of the disk is available for data. You can install full on a USB flash drive, but due to intensive recording, the flash drive will wear out in a few months.

The embedded installation option is intended for installation on a USB flash drive. When the system starts, a small disk is created in memory, where the system image is copied and immediately configured using parameters collected in a single XML configuration file. And then it loads from this disk into memory. This approach has merit. The system is very convenient to deploy - the system flash drive can be written to another machine. The system state is collected in one text file, so it is very easy to save and, if necessary, use to restore the system. The memory disk is very fast, and the system flash drive practically does not wear out.

The downside is that almost any changes made to the system other than through the web interface are lost after a reboot. The developers partially solved the problem by providing the ability to save many parameters in the web interface. The problem can be partially circumvented by using tricks such as combining disk folders in memory and folders on real media via unionfs and using automatically launched command scripts. More advanced users use virtualization to install anything, even a couple of Windows, in jails or separate virtual machines. TheBrig extension greatly simplifies the setup and use of jail for installing additional software. But this still requires knowledge comparable to that required to deploy a complete system. For a beginner, it would be more correct to assume that NAS4Free only has those services that are included initially, everything is configured via the web interface, and nothing can be added.

List of what's included out of the box:

  • WebGUI (management and configuration);
  • Disks and arrays: ZFS v28 (mirror, RAID-Z 1, 2, 3...), soft RAID 0, 1, 5 and mixture (1+0, 1+1, etc.), disk encryption (using hardware acceleration, if present), file systems ZFS, UFS, ext2/3, FAT, NTFS, iSCSI initiator;
  • Network protocols and services: SMB/CIFS (Samba) - for Windows machines, AFP (Netatalk) - for Mac OS, NFS - for *nix, FTP (ProFTPD), TFTP (tftp-hpa), Rsync (client/server) - a powerful tool, including backup, SCP (SSH), iSCSI target;
  • Services: UPnP server (FUPPES - admittedly, mediocre), Webserver (lighttpd), Network bandwitdh measure (Iperf), Bittorent client (Transmission);
  • Monitoring: S.M.A.R.T (smartmontools), E-mail alert, SNMP, Syslog, UPS (NUT).

You can see in the list almost everything you might need from a home NAS. But the most important advantage is the use of the ZFS file system. A relatively weak point of NAS4Free is the included UPnP/DLNA media server. From personal experience, it works quite well and will satisfy most needs, but if you need special goodies, you have to look for something else.

I wrote detailed, with pictures, instructions for setting up. Both basic setup and tricks are described, such as installing homemediaserver in a virtual Windows machine or TorrentMonitor in jail to automatically download TV series as updates are released.

FreeNAS 8

FreeNAS 8 is a build based on FreeBSD 8.3, created and developed by iXsystems. The company is also developing a paid version. For a long time, the free FreeNAS was artificially seriously limited. FreeNAS 8.3, released in October 2012, has been significantly improved and provides the functionality necessary for a home NAS. FreeNAS has excellent English documentation. The commercial roots of the product can be traced in both high hardware requirements (6+ GB RAM) and a focus on functionality used in business. Typically, home services such as bittorrent and UPnP/DLNA media server are implemented as additional modules, each in its own jail. Work with jail is carried out through the user interface and, like the entire project, is well documented.

UPD: FreeNAS 9. Most recently, on August 5, 2013, FreeNAS 9.1.0 was released, and on August 27, release 9.1.1 containing error corrections was released. The new version uses FreeBSD 9-Stable and, according to the developer, contains significant improvements in the field stability, extensibility, ease of use and performance. We plan to test performance in part 3 of the article. The hardware requirements of FreeNAS 9.x have not changed compared to FreeNAS 8.x.

FreeNAS 8 is installed on a flash drive with a capacity of at least 2 GB and occupies it entirely. A nanoBSD image is used, deployed into RAM, which protects the flash drive from wear and tear. Although there is a 32-bit version, it is intended more for evaluation purposes. For real-world use, the 64-bit version is recommended, in part due to memory requirements that are incompatible with 32-bit architecture.

Out of the box functionality is close to that of NAS4Free. The difference is the availability of two UPnP servers to choose from (FUPPES and miniDLNA) and the absence of a web server (the developers promise to add one over time).

ZFS disk pools created in NAS4Free can be imported into FreeNAS and vice versa, preserving the data. There are few FreeNAS 8 users in the profile thread, and some complain about problems (see FAQ thread). However, no software product has yet been created about which at least someone would not complain.

OMV

OMV (on the forum site) is based on Debian Linux, which provides rich functionality and extensibility. The product is created and maintained by Volker Theile, formerly one of the leading developers of FreeNAS. Distributed under the open GPL license.

There is no support for ZFS in the product, and, according to the developer, it is not planned, which seems to be its main drawback. You can find a hack online for installing zfsonlinux on OMV.

OMV is installed on a hard drive or USB flash drive, and takes up the entire media. This installation does not look optimal either for a disk or a flash drive. It's strange to use the entire hard drive for a system that only needs a gigabyte. It is scary to install a product on a flash drive that writes intensively to it. However, for both problems, enthusiasts have developed hacks that solve these problems: a special script brings write-intensive directories into memory, and simple editing of the distribution allows you to create a partition for data on the system disk.

There is no particular point in describing the functionality of OMV. Basic functionality similar to NAS4Free and FreeNAS, with the notable absence of ZFS, is available out of the box or as a set of add-on modules. But OMV is essentially Debian, a variant of Linux for which there are an incredible variety of applications. They can be installed in the standard Linux way.

An important advantage of OMV over the above-mentioned assemblies is the ability to utilize a gigabit channel on fairly weak hardware, such as an Intel Atom with a gigabyte of memory (cf. the padavan assembly in the first part of the article).

Other options

In addition to the three most popular assemblies, there are many others. The author practically did not consider paid options; their popularity is low. We can mention that it is free in the basic version, up to 3 discs, and not prohibitively expensive in the paid ones. This is not quite a NAS, but a solution that allows you to keep a home file dump on different-sized disks, including those formatted in NTFS, and also add disks to the system. Moreover, due to the presence of a parity disk, data survives the death of any one disk.

Many free builds are at an early stage of development, which does not allow them to be used by an amateur. A potentially interesting example can be given. This is a Linux (CentOS) project with zfsonlinux integration. If and when the author brings the product to release, it could become an interesting alternative.

Many NAS builds are rooted in corporate applications. For a home this can be a disadvantage. It’s not so bad that the emphasis is on functionality, which is of little interest at home. What’s worse is that what you need is missing from the box, and adding it is difficult. Most often, such assemblies lack a torrent client and a DLNA server. An example is , which also differs in the paid documentation.

If, like the author of these lines, the presence of ZFS seems like a must-have NAS functionality, then sooner or later attention turns to options that have roots in Solaris. All Solaris derivatives were marked by the strangulation of OpenSolaris by Oracle after the purchase of Sun. Most went through a difficult phase by switching to the Illumos codebase, some died out, but that's another topic. There are several options here, for example. Pros - performance with a slightly smaller appetite for hardware compared to options on FreeBSD and Linux. Disadvantages - a narrower list of hardware and software compatibility and relatively high requirements for the administrator. So high that it is usually much easier to deploy a system on a full OS.

A special feature is the use of modified software from purchased NAS on standard hardware. The author is not a lawyer to fully evaluate the details of the application of licenses, so just in case we will do without links. But for a non-lawyer, the picture looks very similar to the situation with OpenWRT. The original firmware was written by NAS manufacturers based on open source code with a GPL license. Under the same license, the result is published in the source code. Enthusiasts, again under the GPL license, take this code, modify it and publish the result. This result is a generally working Linux-based build that can be installed on bare metal, a virtual machine, or a suitable NAS from another manufacturer. The latter, by the way, has been practiced for many years and is still not covered up - probably precisely because of the absence of legal violations in such practice. The advantage of this option is price, but there are also disadvantages. Firstly, in addition to the GPL code, the purchased NAS also contains proprietary code, mainly for communication with hardware. Therefore, such assemblies have problems with switching to sleep mode, saving energy, regulating fan noise, etc. Secondly, a purchased NAS from a leading manufacturer also provides Internet services, intended, naturally, only for buyers, and not for everyone. So exactly the same thing does not happen as a result of installing such an assembly; rather, this is an option to try, including in a virtual machine.

Web interface for full OS

Members of the profile thread more or less actively use ZFSguru and napp-it. There are undoubtedly other products available, starting with . But they are less suitable (or not at all suitable) for the purposes discussed. And the author has not encountered them, see epigraph.

ZFSguru

Uses FreeBSD. The product today is a convenient FreeBSD installer that allows you to install a complete system on a ZFS pool, for example on a mirror, configure data pools and get a high-quality semi-finished NAS. Semi-finished product - because some of the basic functionality for NAS has not yet been implemented and is planned for the indefinite future. You will have to manually set up a connection to UPS, network access to files, etc. High-quality - because what has already been done is done well.

napp-it

The project looks like a rare exception in terms of its level of readiness. The product allows you to literally turn a clean installation of a Solaris-like operating system into a NAS with ZFS with just a few clicks of buttons. The current version recommends using OmniOs or OpenIndiana, supported with some limitations by Nexenta, Illumian and Oracle Solaris 11.1. The secret, apparently, is that the developers successfully commercialized the product. The basic functionality is free, and extensions for home use are also free, most notably the Mediatomb UPnP server. Extensions for purely corporate purposes are paid. Based on the results of short tests by the author on a virtual machine, the impressions were positive. But diesel fuel is diesel fuel. In the repositories, even the transmission is quite bearded, and a more or less modern one needs to be assembled, which the author did not have the curvature of his hands for. Comrade padavan somewhere on the forum described passes with a tambourine, which allowed him to solve the problem, but, as they say, what is allowed to Jupiter is not given to the bull. So, although napp-it greatly adds friendliness to Solaris-based NAS, without significant UNIX experience it is better not to jump into this cart.

Full *nix system

Here it is briefly. To teach a scientist is only to spoil him. A *nix server product from scratch at home is built either by people with professional experience or by advanced amateurs whose hobby no longer fits into the sandbox of a ready-made assembly (or box) with little frills sewn onto it. Judging by the profile thread, they work with a wide variety of software. Often combining, through virtualization, the strengths and/or advanced functionality of products running different OSes.

Virtualization on NAS

Using virtualization in NAS is a natural practice for an advanced user. Probably the simplest option is to install VirtualBox with a PHP web interface on the NAS and raise several virtual machines that do things that are difficult or impractical to do on the main axis. First of all, launch more or less exotic software. Special extensions have been written for NAS4Free and OMV that make virtualization feasible for an amateur. Of course, VirtualBox can be installed on almost any full axis. The task of controlling a virtual machine via the monitor, mouse and keyboard of a desktop computer is solved even easier, including using a VNC client. The downside of VirtualBox is the significant performance hit compared to bare metal systems.

The second option is soft virtualization via FreeBSD jails. Owners of full-axis systems more often use cells for their intended purpose, to isolate potentially dangerous processes, such as a web server, accessible from the outside. Assemblies use the cage mechanism to bypass restrictions on installing additional programs. In FreeNAS this is a boxed functionality; for NAS4Free an extension (TheBrig) has been written that integrates into the web interface.

Finally, a virtualization option that goes beyond the NAS, quite popular in the profile branch, is called “” at the suggestion of the developers. Briefly, ESXi is installed on the hardware, a virtual machine is raised in it, the only task of which is to create ZFS storage. To do this, a disk controller is forwarded inside it, and the disk space is exported via file and block protocols for other virtual and real machines. If you don’t understand why such perversions are needed, you definitely don’t need it.

Total

If you have at least read that many letters diagonally, then you will be 99.9% successful in creating a home NAS. There would be a desire. Good luck, and if anything happens, please contact the relevant thread.

I would like to express my gratitude to all participants in the profile thread on the forum.. Sh, TPAKTOP, iZEN and RU_Taurus for many useful comments.

Special thanks to the developers of free software: Olivier Cochard-Labbé, Daisuke Aoyama, Michael Zoon, Volker Theile and many others. They made the very existence of the DIY NAS theme possible.

First, a little explanation. NAS is an abbreviation originating from the English language. It means Network Attached Storage, or free network storage. You can save photo or video files on these disks, and any other information - it doesn’t matter. You can access it from any device, be it a phone, TV, game console or computer.

A few more words about the hardware we use to create our self-assembled NAS: WD Red 6 TB drives and a fairly simple Synology case.

Let's start assembling the NAS

Let's start the assembly. First, let's put the disks aside and look at the case. This is how you will bring it home.

The case can be opened from one side by simply sliding the panel to access the contents. SATA connectors for connecting drives are immediately visible. Only two drives can be built into this case.

In principle, we can start. We take one hard drive and carefully insert it into the slot. Then we put the second disk in place in the same way. Please note: the connectors must match.

Now it is very important to secure the hard drives by securing them with screws on both sides: four screws per drive. This is necessary so that vibration does not occur and the disks are firmly fixed in the slots.

So, we screwed the disks. Replace the housing cover and secure it.

We turn the case to its original position and secure it with screws on the back wall.
NAS is assembled. Now it needs to be connected to the network and to the power supply. To do this, we take a regular network cable and connect it to the desired connector, and then to the mains. Ideally, the NAS is connected directly to the router.

Now I will explain why access to the Internet is important.

Firstly, The NAS software will always be updated, which will provide you with greater security and a more functional interface.
Secondly, this is important for organizing user groups. You can create accounts, expand or limit their rights. For example, you can give the user both the rights to write information to the disk and only the ability to view the data. You can hide individual files or provide shared access to them, for example, access to music from a smartphone.

And now the question arises: why do you need a NAS at all and why can’t you get by with a regular external hard drive lying somewhere in the house. Our answer: due to the security of data storage. Of the 12 TB on disks, we effectively use only 6 TB, but we always have an up-to-date backup copy.

Conclusion: approximately 600 euros for such a system is quite a lot of money, but the investment pays off at least in the knowledge of the reliability of data storage.

Software question

How to soften your home storage? Of course, you can simply install FreeNAS, but you can also look for alternative solutions. If you are not looking for easy ways, our advice will definitely come in handy.

OpenMediaVault

An alternative to FreeNAS, OpenMediaVault, is based on Linux Debian. It is an open source NAS software that supports FTP, SFTP, SSH, AFS, SMB and CIFS standards.

Additions: you can install various additional protocols and standards to expand your NAS.

Application: OpenMedia Vault is especially suitable for home use.

Network features: WakeOnLAN, Link Aggregation, as well as the new IPv6 standard.

Monitoring: it can use syslog, watchdog, S.M.A.R.T., SNMP (v1/2c/3) or email notifications.

Maintenance: if your NAS runs on OpenMediaVault, then such a system will be serviced through the web interface.

NAS4free

NAS4free is also open source software. It is based on FreeBSD and can be virtualized on any hardware. NAS4free supports standard protocols FTP, SMB, NFS, TFTP and AFP.

Additions: you can set up a web server on your NAS and host websites there.

Application area: Thanks to the virtualization option, NAS4free is suitable for both large servers and home use. Its hardware support is truly unique.

Network features: NAS4free supports WakeOnLAN and IPv6.

Monitoring: you have the opportunity to specify the path where statistical data will be saved. You can also view real-time statistics through the interface.

Maintenance carried out through the interface.

UnRAID

UnRAID is software suitable for various applications. UnRAID is free for the first 30 days, after which you pay between $59 and $129. The cheap basic package (price: $59) allows the use of six connected storage devices, the middle package (price: $89) allows twelve devices. With the Pro package (price: $129), the number of storage devices is unlimited. Almost any 64-bit and 86-bit system is supported. UnRAID also offers virtualization capabilities.

Additions: UnRAID easily supports expansion with additional hard drives. It should also be noted that there is very good SSD support.

Application: UnRAID is more suitable for professional applications. It is capable of supporting very large servers with many hard drives.

Network features: UnRAID manages only memory, and network functions must be handled by the corresponding operating system.

Monitoring carried out via a web interface.
Maintenance also via the web interface.

A home user rarely encounters Network Attached Storage at home, so he often considers installing it in his apartment as an unnecessary, unreasonable and incomprehensible whim. Meanwhile, there are many scenarios for working with home electronics and household appliances, the use of NAS in which dramatically optimizes the process and provides it with a different level of security.

Home NAS: Five Main Use Cases

What are the telltale signs that adding online storage to your home will be a good thing? These signs are few, so we will list them all.

Firstly, and this is the main thing: NAS can be useful where people live who use several computers at once, connected to a local network and a smart home system. Speaking about “several computers”, it is important to note that now almost every family that uses smartphones, tablet computers, laptops, media players, game consoles and TVs with the Smart TV function fits this definition.

Network storage for home could be, for example, like this

Secondly, NAS greatly simplifies life for people who are passionate about cinema and collecting a library of films in the highest quality currently available. This also includes owners of home cinemas equipped with large 3D TVs, 3D projectors and multi-channel speaker systems.

Thirdly, professionals who work privately with video, photography and sound need network storage at home: camera operators, editors, directors, photographers, composers, DJs, producers with home recording studios...

Fourthly, NAS is ready to become an indispensable attribute of the home’s interior where the owners want to run their own torrent server, host a website, or help neighbors on the local home network with organizing a mail server.

Finally, fifthly, NAS will perform well in a home with a large area and extensive local area - receiving video streams from surveillance cameras.

Having briefly outlined promising areas for using network storage for home use scenarios, let’s move on to the details...

1: NAS as a home media server

A group of scenarios for home use of network storage for organizing access to data is in one way or another connected with the concept of “server”. Modern NAS are excellent for organizing servers of various types on their basis - both those used within a local home network, and those that have a communication channel with the Internet.

The most obvious and most popular scenario in this group is the use of network storage as a media server. This scenario involves cataloging video, audio and graphics files on a NAS for access by computers, televisions, network media centers, laptops, tablets and smartphones located in the house. In fact, this is an entertaining side of the work of the so-called “smart home”: a network infrastructure that connects all home gadgets into a single functional system.

Using a NAS as a media server, it can be useful to find out: what specific modern mobile devices it is compatible with, whether its software platform has built-in content cataloging mechanisms, how https://adm..gif is accessed and at what speed, is it possible to install storage settings access from the iTunes application (iTunes server)?

Having built a cinema at home, it would be stupid not to buy an additional NAS

The next most popular scenario for home use of NAS is organizing a so-called torrent server. The functions of the torrent server assume that the storage will operate with a 24-hour Internet connection to download new files through a peer-to-peer network and provide access to already downloaded content from other users. Running a torrent server on a home NAS requires the network storage software platform to have appropriate mechanisms. At a minimum, built-in utilities that duplicate the functions of torrent client programs.

2: NAS as an observation post

Finally, those people whose home has an area of ​​several hundred square meters and a yard measured in hectares can use NAS in conjunction with home surveillance cameras.

This home use scenario cannot be called too common, so we will briefly talk about some of its nuances.

Let's start with the fact that when choosing a NAS to organize a video surveillance server by studying its characteristics, you may be surprised that you will not find this item in the settings. As just mentioned, organizing a surveillance server is not the most popular function of network storage. Therefore, some NAS manufacturers make it software optional: to get the desired functionality, the user needs to download and install an extension utility.

Surveillance cameras are useful not only at military installations

Another nuance concerns the direct operation of network storage with surveillance cameras. Of course, it is not worth mentioning that we are talking about IP cameras, which differ from ordinary ones in that they use a wireless connection with a full IP address assigned to each device and encode the video stream with an optimal ratio of quality and data volume.

The performance of a NAS as a video surveillance server varies greatly from model to model and from manufacturer to manufacturer. The main parameter here is the number of allocated channels. This parameter can be either permanent or extensible. In the latter case, the manufacturer organizes the process through the sale of license codes, which open up the opportunity to attach new cameras to the server.

3: NAS as an audio and video archive

Unlike any other computer peripheral technology, which uses only functionally necessary electronic components, network storage is a specialized, but real computer. Therefore, it is obvious that working on a home PC paired with a NAS automatically implies the creation of a local network in the house.

Operating a home network requires the user to have minimal, but specific knowledge about its administration. It’s probably not worth acquiring such experience for the sake of connecting a NAS to one single computer in an apartment - therefore, purchasing a NAS and its integration is effective where a local home network with several devices and a router has already been set up.

At home, the NAS can become the center of the digital universe

In all scenarios for using network storage at home, the device is required to properly perform two main functions - to store large volumes of information with the highest possible level of security and to provide access to it according to a scheme defined by the administrator.

In order of priority, we will start with scenarios where the main function is storage.

Storing video files in the vast majority of cases when using a NAS at home means creating a personal film library. In modern conditions, when tariffs for unlimited Internet access are very low, and the connection speed allows you to watch movies in streaming mode, collecting video files on your local hard drive may seem archaic. However, two points force us to look at the issue from a different angle.

One of them concerns the quality of Internet access. It is not the same everywhere in our country - it is especially difficult here for rural residents and residents of small towns. What is the connection between villagers and NAS? Quite direct: now cottage villages and villages consisting of townhouses are appearing around many regional and district centers. Their inhabitants, for the most part, are quite capable of having not just a computer, but a whole fleet of electronic devices. However, Internet access for all these devices - regardless of their number and brand names - remains at the level of rural standards. So it turns out that using a NAS to store a film library is an absolutely viable scenario for residents of cottages, private houses and townhouses in rural areas.

Filmmaking is a very worthy occupation

The second point of creating a film library based on network storage concerns the volume of video files and special requirements for the speed of access to them. As mentioned above, in large cities the maximum speed of broadband Internet access allows you to stream movies in fairly good quality. However, the quality and requirements for access speed are constantly growing. The Full HD standard with five-channel sound has already become commonplace. 3D films are released as usual. Sales of Ultra HD TVs are gaining momentum - and with them it becomes possible to produce films with a resolution of 3840 by 2160 pixels. A keen film fan today is simply forced to assemble his collection on the basis of network storage if his priorities include image quality - and therefore the file size and its bitrate during playback.

Concluding the topic of access speed, we will make a couple of recommendations regarding the characteristics of various NAS models. Modern network storage systems for integration into the network use either a conventional wired connection via an Ethernet port, or it is paired with a wireless Wi-Fi module. The latter is certainly convenient - especially for mobile devices, but even if compatible with the 802.11n standard, it cannot provide data transfer rates higher than 600 megabits per second. A wired connection, coupled with a gigabit network adapter, allows you to feel confident even when watching movies and programs in Ultra HD resolution and 3D format from NAS hard drives.

Video recorded and stored on network storage disks is not the prerogative of only film lovers. Another scenario for using NAS at home is creating an archive when working as a private videographer, editor, director... It’s no secret that film production involves the accumulation of a large amount of video material, the volume of which continues to grow - thanks to the introduction of cameras that shoot in Ultra HD or “raw” RAW format.

Using network storage as a home archive of work materials can be extremely convenient for people who also individually engage in photography or music.

First, let's talk about photographers. It's no secret that the work of a professional photographer involves redundancy of material. For example, American masters specializing in wedding photography take up to 5,000 frames during one order. This is a colossal amount of information, taking into account the use of modern devices with multi-pixel matrices and the use of “raw” RAW. Domestic weddings have their own specifics - the photographer usually works the whole day at them. As a result, its personnel output is not too different from that of its American colleagues.

For professional photographers, their archives of work are growing very quickly.

A large amount of data in the form of thousands of frames is also generated by other photo specialists: those working in the genre of reportage, those engaged in shooting portraits, studio and subject photography, and travel photographers.

With a constant busy schedule, the volume of the archive becomes such that it becomes simply inconvenient to keep, catalog and process it on a computer. And installing network storage saves the situation.

The same words can be fully applied to people involved in music. These are composers, individual DJs, people who have a recording studio at home. Their need to have a large music library, maintain it in catalog order, and store multiple versions of their own (or other people's) production recordings is best met by network storage.

With the constant increase in information stored on a home NAS, the user needs to pay attention to the number of installation spaces for hard drives. Of course, most subconsciously assume that a network-attached storage device for the home hardly needs the ability to connect more than one or two drives. However, it seems to us that it is always better to simply buy a new HDD and insert it into the shaft than to think about purchasing a disk with a noticeably larger volume than it currently has and finding a way to copy existing information onto it. Finally, recall that a NAS with four or more seats can take full advantage of the system of merging disk space into a RAID array. However, more on this a little later.

4: NAS as a backup storage

Another, very important in its essence, scenario for home use of network storage is relevant where a fairly large family has a lot of modern equipment in its arsenal. Smartphones, tablets, laptops, desktops - they're all great for work and play... until something goes wrong inside. Sometimes the problem can be dealt with easily, sometimes you have to reinstall the system and go through a long and painful path to restore the software environment.

Network storage with recordings of software images of all computers and gadgets in the house helps greatly to simplify life as much as possible in this critical situation. Modern electronic devices and operating systems for the most part allow you to obtain files containing an exact image of the software environment, including all settings, all programs, all current documents, and so on. Returning the usual state of affairs after a system failure of a personal electronic assistant is elementary.

It should be noted that the software platform of high-quality NAS takes the issue of backup very seriously. Administrative storage settings allow you to configure regular updates of archived images - both manually and automatically.

If a home NAS stores images of software environments, even a hard drive failure in a work laptop will not be fatal

Using the mode of operation as a RAID array for disks installed in a home NAS helps to further protect your peace of mind. The RAID system has the following capabilities: combining the space of all disks with a multiple increase in access to it (RAID 0), full mirroring (full copying) of pairs of disks (RAID 1), combining space with the allocation of one of the disks for storing checksums (RAID 5, available for network storages with four or more HDD installation slots).

5: NAS as a post office, web hosting

Less common, but still relevant for home scenarios are the creation of a web server on their basis to launch a personal website (single blog, online store, startup...), a mail server or a server for servicing CCTV cameras on the World Wide Web.

Organizing a mail server at home can be useful if residents of an apartment building have organized their own local network.

As for the web server at home, here, it seems to us, we are approaching the line separating scenarios for private and corporate use of NAS. In this regard, the user is recommended to pay attention to the computing power of the network storage chosen for organizing a web server. First of all, it depends on the technical platform and processor architecture.

NAS motherboards on ARM and x86. The difference is obvious

Modern NAS on the market operate under the control of central processors of two architectures: ARM and x86. The latter is represented almost exclusively by Intel Atom processors. They are the ones that are preferable in scenarios that involve a large number of connections to the server with intensive information exchange. In addition, NAS on the x86 platform have a design that is more familiar to PC users and is more suitable for repairs and upgrades at home.

The advantages of network storage on the ARM platform are cost, minimal heat dissipation (which means a simple and silent cooling system), almost zero power consumption when the system is at rest and very modest when in operation.

As you guessed from the title, today we will build a home NAS server. For more than five years I have had a small old animal in the In Win BQ656 Black Mini-ITX 80W USB/Audio/Fan + External remote control case. It has the following processor inside: AMD Athlon(tm) Dual Core Processor 4050e, with a BogoMips reading of 4200. Although tiny, it eats little and can virtualize, which is important. Detailed specifications can be found anywhere :). By the way, after assembly I wanted to change it to a slightly cooler Athlon 64 X2 6000+. You can buy one on Avito for 500–700 rubles. We raised this whole thing on the Minix780G-SP128M motherboard.

Not a fountain, of course, - only four SATA and no RAID support, but low power consumption. The price today could not be determined, but at one time it cost $220. Ideally, of course, it would be better to have a mother with the ability to connect six drives and RAID support. But such pleasure will cost quite a bit. Let's try to estimate from what is on the used market. They offered a kit for Intel 7600 + Asus mother can be purchased for 1500–2000 rubles (let me remind you that this is used).

Before replacing the case, the system consisted of an Ubuntu server, balls on it - and, in fact, that’s all. Inside there were two 500 GB disks. A new case has now been purchased and a couple more hard drives have been installed. Total three HDDs of 500 GB and one of 1.5 GB.

Wishlist

Among the tasks that a media server must solve, we highlight the following:

  • of course, Samba, distribution of media content over the network, more on that below;
  • virtualization of various levels: a couple of virtual machines, inside there may be a 1C Linux server, Docker containers;
  • so that you don’t have to configure each home node for services, a small DNS with the something.local zone.

Hardware requirements:

  • noiselessness;
  • convenient installation/replacement of HDD;
  • compactness.

I repeat: I would really like to replace the motherboard with the processor, but this is not necessary. Perhaps in the future I will replace only the processor with the cooler. So, a new building, the search was long and difficult. After a week of Googling, the choice fell on Raijintek Metis. What suited me in terms of price/quality.

A couple of phrases about the building

Manufacturer and model: Raijintek Metis, with window
Material: aluminum, steel
Dimensions: 190 x 254 x 277 mm (W x H x D)
Form factor: Mini-ITX
Drive bays: 1 x 2.5/3.5" (internal), 2 x 2.5" (internal)
Fans: 1 x 120mm (rear, pre-installed)
Weight: about 2.8 kg

Cool design and color look great almost anywhere, and the price is very affordable. By the way, such a case cost me only 4,000 rubles. Purchased on Avito, delivery by mail. More details about the case can be found on the manufacturer’s website. I almost forgot about the memory! At the time of writing, 2 GB were installed (two 1 GB sticks). Now I’m already ordering two 2 GB dies.

Implementation of the software part

So, what is the most important thing you want from a server? So that it is easily scalable, keeps up with the times, pleasant and easy to use/administer. An attractive web face is desirable.

  • Option 1: install Ubuntu Server with the Ajenty 2 control panel and deliver everything you need by hand.
  • Option 2: install OpenMediaVault. The muzzle is available, there are many plugins/extensions to increase functionality, it is based on Debian, so there is always the opportunity to deliver or finish it manually.
  • Option 3: install FreeNAS. A little less goodies, but you can deliver everything by hand, though it’s a little more difficult. Based on FreeBSD.
  • Option 4: install XPEnology. A huge number of goodies, repositories with additions. Support for virtual machines and Docker.

After much torment, the choice fell on the fourth option. We will use it to raise the home server further. Why is this so? The first option is good in itself, but at the same time you want a minimum of effort and a maximum of opportunities without additional force. In addition, Ajenty does not allow you to access the server flexibly, so you just want to jump into the console and do everything manually from there. And then go to the panel and just admire :). Among the remaining options, XPEnology won. Provides maximum services with minimum settings.

Let's take off

So, first of all, go to the xpenology.me website in the downloads section and download the deployment kit.

XPEnoboot is a boot disk image for installing and booting/rebooting the server.

DSM is the system itself. Synology Assistant - optional, the program detects XPEnology/Synology servers, installed or ready-to-install nodes. I installed it via the web interface - as they say, all markers have different tastes and colors.

The ISO image needs to be unpacked onto a USB flash drive and used every time the server is restarted, which is not entirely convenient. Or donate a flash drive to the server and make it a priority when loading. There is a second way. In previous issues of Hacker magazine, I wrote about organizing a PXE server with various boot options. If there is such a service, then you can easily give it to him. Two files are responsible for loading into XPEnology (as in any Linux distribution): zImage and rd.gz. We place them in the PXE server directory and add the following to the menu:

Insert into pxelinux.cfg/default LABEL xpenolog kernel xpenology/zImage root=/dev/md0 ihd_num=0 netif_num=2 syno_hw_version=RS3612xs ac1=0010562E3E36 mac1=0051562E3E37 sn=B5JDN10005 initrd xpenology/rd.g z

The menu makes clear the location of the files in the xpenology subdirectory, relative to the root of the TFTP server. Information was found on xpenology.com. I recommend checking it out.

The first option didn't work. I'll try it differently. I unpack the ISO, take the menu file isolinux.cfg from there, copy the menu into my PXE menu, with the path to the zImage kernel file adjusted. I copy the zImage to the PXE server. This option worked as it should; after the installation began, even the operating system pat file was not required. The server itself downloaded it from synology.com, which makes me smile :). During the installation process, the server will ask you to enter administrator credentials. After installation, we get a completely ready-to-use Synology server on regular hardware. For those who are not familiar with this OS, I highly recommend it! Huge community. As a result, there is a large number of repositories that greatly expand the standard functionality.

Continuation is available only to members

Option 1. Join the “site” community to read all materials on the site

Membership in the community within the specified period will give you access to ALL Hacker materials, increase your personal cumulative discount and allow you to accumulate a professional Xakep Score rating!