Home / Instructions / Homemade network storage. Is it worth building a mini-server or NAS with your own hands or choose a ready-made one? Comparison of self-assembly Mini-ITX and I-Stor IS607. How the configuration works

Homemade network storage. Is it worth building a mini-server or NAS with your own hands or choose a ready-made one? Comparison of self-assembly Mini-ITX and I-Stor IS607. How the configuration works

As you may have guessed from the title, today we will be building a home NAS server. For more than five years I have been living with a small old animal in the In Win BQ656 Black Mini-ITX 80W USB/Audio/Fan + External remote control case. Inside it has such a processor: AMD Athlon (tm) Dual Core Processor 4050e, with a BogoMips reading of 4200. Although a baby, it eats little and knows how to virtualize, which is important. Detailed specifications can be seen 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 has not been determined to date, but it once cost $220. Ideally, of course, it would be better to have a mother with the ability to connect six disks and support for RAID. But such pleasure will cost a certain amount. Let's try to figure out what is on the used market. They offered a kit for Intel 7600 + Asus mother can be purchased for 1500-2000 rubles (I remind you that this is used).

Before the case was replaced, the system consisted of an Ubuntu server, balls on it - and, in fact, everything. Inside there were two disks of 500 GB. Now a new case has been purchased, a couple more hard drives have been installed. A total of three HDDs of 500 GB each and one of 1.5 GB.

Wishlist

Among the tasks that the media server should 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 can be a 1C Linux server, Docker containers;
  • so that you don't have to configure each home node for services, a small DNS with a zone something.local.

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 a cooler. So, the new building, the search was long and difficult. After a week of googling, the choice fell on Raijintek Metis. The one that suits me for the price / quality.

A couple of phrases about the body

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" (inside), 2 x 2.5" (inside)
Fans: 1 x 120mm (rear, pre-installed)
Weight: about 2.8kg

Cool design and color look great almost everywhere, and the cost is very democratic. By the way, such a case cost me only 4000 rubles. Purchased on Avito, mail delivery. More information about the case can be found on the manufacturer's website. Almost forgot about memory! At the time of this writing, 2 GB were installed (two 1 GB sticks). I'm already ordering two 2 GB sticks.

Implementation of the software part

So, what is the most important thing you want from the server? To be easily scalable, in step with the times, pleasant and easy to use / administer. Preferably an attractive web muzzle.

  • Option 1: install Ubuntu Server with Ajenty 2 control panel and deliver everything you need by hand.
  • Option 2: install OpenMediaVault. The muzzle is available, there are many plug-ins / extensions to increase functionality, Debian is the basis, respectively, there is always the opportunity to deliver or finish it by hand.
  • Option 3: install FreeNAS. A little less buns, but you can deliver everything by hand, though - 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. On it we will raise the home server further. Why exactly? 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 assault. In addition, Ajenty does not allow you to flexibly access the server, and you just want to get 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 a minimum of settings.

We take off

So, first of all, we 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 - Optionally, the program detects XPEnology/Synology servers, installed or ready-to-install nodes. I installed 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 very 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 in XPEnology (as in any Linux distribution): zImage and rd.gz. We place them in the PXE server directory, add 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.gz

From the menu, the location of the files in the xpenology subdirectory is clear, relative to the root of the TFTP server. The information was found on xpenology.com. I recommend to take a look.

The first option didn't work. I try differently. I unpack the ISO, take the isolinux.cfg menu file from there, copy the menu to my PXE menu, correcting the path to the zImage kernel file. I copy zImage to PXE server. This option worked as it should, after starting the installation, even the pat-file of the operating system was not required. The server itself downloaded it from the site synology.com, which cannot help but 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, a large number of repositories that significantly expand the standard functionality.

Continued available to members only

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

Membership in the community during 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!

This small tutorial will help you build a complete NAS server from an old computer. If you are ready to buy new parts and make your file storage compact and more modern look and functionality, then the article is more suitable for you, Well, for lovers of ready-made solutions, I prepared this material:. Now let's go back to the old PC and evaluate its capabilities.

Requirements for an old PC

  • SATA connectors on motherboard, since HDDs with this interface have the best price / performance ratio and have a much larger volume, unlike IDE hard drives.
  • The number of connectors for connecting hard drives on the motherboard and free slots in the case (the ability to install HDDs in 5.25-inch bays (special boxes)) For HTPC assembly, I use such boxes with 2 slots for 2.5″ HDD .
  • If there are not enough SATA plugs on the power supply, you can use special IDE-SATA adapters.

Procedure for Installing an HDD in an Enclosure

To install 3.5-inch hard drives in 5.25-inch optical drive bays, place them in a special box (see figure).

Such cases can also be made in the form of rails that are attached to the HDD on both sides.

You can also use the five-inch bay, which is installed optical drive, since it is not needed in the server solution.

Software installation

To implement the server solution, we will use the software FreeNAS. Download the ISO image from the link for a 32-bit or 64-bit system and burn at minimum speed to a CD-R\RW disc. If there is no blank, you can install it on a USB flash drive, how to make a bootable USB flash drive is written in. Temporarily connect a disk drive (which you removed earlier or use a USB drive) to your PC. Go into the BIOS and set the Boot section to boot from the drive. After installing the software and restarting the PC, remember its IP address, which will be shown on the screen.

Setting up the NAS server

Connect the NAS server to your network. Open a browser on your work computer on this network and type in the address bar: http://"IP address of your NAS". In the window that appears, enter the username - admin and password - freenas. Go to menu Storage | volumes | Create Volume" and select the hard drives that will form the RAID array. Next, activate the ZFS file system.

Can be used:

  • RAID 0- a disk array of increased performance, without fault tolerance.
  • RAID 1— mirrored disk array, has high reliability

We will use RAID 1 as more reliable. Now click "Add Volume" to format your drives into an array.

Access to the NAS server on the local network

To open access to the server, go to the menu Services | Control Services, enable CIFS services and configure access in the partition Sharing | Windows Shares». As with any network medium local network access is via Windows Explorer (for example, \\NAS to access the root, or \\NAS\Photos to access a specific shared folder). You can also make shortcuts by clicking on the "Map network drive" button in the Computer window (Windows 7) under the explorer line.

P.S. You can always make an additional array by adding hard drives, and you can also set up access for remote use of your NAS server.

Some information about the dangers of using RAID

RAID is a redundant array of independent hard drives. RAID is not a backup storage system, it only helps to improve the comfort of data access. A RAID system is a set of HDDs combined into one array. If your hard drive fails, you can replace it, and then restore the RAID and your data will be with you, except for RAID array 0.

Disadvantages of RAID 0

This mode gives only the speed of data access. In Striping Mode (interleaved mode), data is divided into blocks and written simultaneously to multiple hard drives. If one hard drive fails, all data will be lost.

Disadvantages of RAID 1

RAID 1 uses data mirroring, meaning that the second drive has an identical copy of the data. There is one vulnerability - a possible malfunction of the controller, which will damage both media.

Disadvantages of RAID 1 and RAID 5

During the RAID recovery process, the write speed is high, and if one hard drive fails, it can cause another hard drive to fail, and, consequently, data loss.

Also, a faulty RAID controller can lead to HDD failure. In RAID arrays, changes are applied to files and if data is accidentally deleted or changed, the actions are irreversible.

Part one: cold iron

It can be stewed, and crumbled into the broth,
And serve well with vegetables.

Lewis Carroll, Hunting the Snark

Anyone who is able to collect Personal Computer and install Windows, if desired, it can also handle the creation of a fairly advanced NAS from x86-compatible hardware and free software builds based on *nix . At the same time, roughly speaking, the number of installed disks affects the cost and complexity of the project only by the cost of the disks. This allows you to save a lot of money compared to buying a ready-made NAS with 4 or more drives, but it is hardly profitable if a NAS with 1-2 drives satisfies your needs. It is impossible to say which option is better. Everyone has their own preferences. Someone cooks well at home, while someone prefers to dine in a restaurant. Do you enjoy fiddling with computer software and hardware? Then this text might be helpful. Do you need a storage service on its own? Choose between cloud storage and ready NAS out of the box.

N. B. This article is not about the hardware model and not about the version of the software product. It is about the concept of creating a NAS with your own hands and suggests considering other options for solving the problem, in addition to buying a ready-made device. The topic is long, has under a thousand pages of discussion. The people there are polite and responsive. This is, as it were, a hint that the article does not claim to be complete, academic, or the ultimate truth.

What kind of NAS?

According to Wikipedia, NAS (English Network Attached Storage) - network storage system, network storage. It is a computer connected to a network and designed to provide storage services to other devices. The operating system and programs of the NAS unit provide data storage and file system operation, access to files, and control over system functions. The device is not designed to perform normal computing tasks, although it may be technically possible to run other programs on it. Typically, NAS devices do not have a screen and keyboard, but are managed and configured over the network, often using a browser.

The definition is not perfect, but quite working. NAS is also used in business, but it has its own requirements and features. We will be interested in home use of NAS.

People usually come to the idea of ​​\u200b\u200bassembling a NAS with their own hands in two ways, and often - both at once. When you have one computer at home, you don't need a NAS. Gradually, other network devices appear. Laptops, smartphones, tablets. And especially - network HD-media players, all sorts of Dune, Popcorn, WD TV and the like. It is with the acquisition of a network media player that a person often begins to accumulate terabytes of information. First, it is stored on removable hard drives connected to the media player and / or all added to the main computer. Soon there will be too many disks for convenient use, and around the clock a softly buzzing computer, at the same time downloading something from the Internet, will begin to annoy, if not you, then your better half. An idea arises to collect this bunch of disks in a separate box, put it somewhere in a corner and instruct it to distribute content to all network devices and download torrents. Congratulations, you've come to NAS the first way. On the way, be sure to look at the finished NAS, out of the box. But the price!

The second way is through hardware upgrades. As a result, a few less than a cubic meter of components are accumulated, which are difficult to sell, and there is no one to give as a gift. The plushkin inside of us puts them to good use in the idea of ​​building a NAS. And at the same time satisfy your craving to delve into the guts of the computer. No wonder one cheerful American wrote that working with a computer is the only legal way today to push around someone who is smarter than you.

Of course, there are other ways. For example, you are a passionate photographer and need to securely store years of archives. Or a loving parent filming their baby's every move. Etc. But rarely do such scenarios lead to do-it-yourself NAS assembly. Much more often - to buying ready-made out of the box. The needs of such users are confidently met by 1-2 disk models of ready-made NAS. It is difficult, if not impossible, for a neophyte amateur to assemble something similar in size, noise and price to 1-2 disk models.

In defense of off-the-shelf NAS, it is worth noting that they provide many features and functions out of the box that require minimal installation / configuration / tuning. So in fact, their cost should also include the work of programmers, technical support etc.

The situation changes dramatically if 1-2 disks are not enough, but there is a need for 4 or more. Marketers of manufacturers set a price level on them, which plunges a person familiar with a computer price tag into a state of frustration (although they pronounce much more popular words at the same time). And the person begins to choose the hardware configuration, to which we move on. Although he should have started with software, you can't argue against nature.

Hardware depends on the software used. Software - from the assigned tasks. And the correct statement of the problem has never been a strong point of the home master. So he starts with iron. If we came to building a NAS with a bag of parts left over from upgrades, then the good news is that they will fit, albeit not optimally. Without even looking.

Pomelo in the barn

In order to comfortably watch FullHD video over the network, including BD disc images, we need at least:

  • 1-2 gigabytes of RAM if ZFS is not used and 4-8, more if ZFS is. (About ZFS - later, impatient Google to help.) But even on a rarity with 256 MB, you can collect something useful;
  • x86-compatible processor, ideally (and for ZFS) 64-bit, but 32-bit will work for most options. That is, any x86 processor, except for the already completely museum ones. It is desirable - less heated, but there is already something;
  • wired Ethernet port, gigabit is better - although 100 megabits is enough for viewing BD images over the network. Connecting a NAS over Wi-Fi is a controversial idea (but if you build it yourself, you have much more freedom in choosing wireless controllers);
  • drives and SATA ports. For NAS, there is no difference between SATA-2 (at 3Gb/s) and SATA-3 (at 6Gb/s). Not every drive is faster than the ancient SATA-1, so these ports can be used. But IDE drives, according to modern concepts, are slow, low-capacity, hot and noisy. If there are not enough SATA ports, controllers can be used. But if (when) you soon decide to move to new hardware, then the SATA controllers bought as crutches for an outdated motherboard will be lying around idle. I know for myself, I have two lying around. And be careful with drives over 2 TB. Many older controllers are not compatible with them. And among the SATA-1 controllers, there are those that do not work with disks larger than a terabyte - however, this is already antiquity and a rarity;
  • it’s clear, the case where it all fits and the power supply that it will pull. There are subtleties with the PSU, it makes sense to look after a new one, see below.

Most likely, the hardware remaining from the upgrades will satisfy such requirements. And if it also doesn’t make much noise (or there is where to remove it), then it’s generally lucky. You can start experimenting.

Indposhiv

If you are building a NAS from specially purchased components, then you should first decide on your wishes. In most cases (but it is impossible to embrace the immensity), requests are divided into three groups, conditionally “quietly compact”, “efficiently extensible” and “server-so-server”. I will clarify that there is no unambiguously correct option. After all, the user himself weighs the wishes, costs and his capabilities. But the wrong one is possible. When the result does not satisfy the requirements explicitly or implicitly specified in the design. For example, the spouse will say that the box is, of course, big. But it howls like an airplane, and she does not agree with her to live in the same apartment. Or the system assembled under the passive does not stand the test in the summer. Or corny video shuts up when viewed over the network. Therefore, it is better to consider wishes on the shore. Especially the implicit ones.

Important note. We are talking about NAS, not about HTPC (Home Theater PC), that is, not about a computer that shows movies with sound on big screen connected to its video output. In principle, no one forbids you to make HTPC, including with many hard drives, although the requirements for HTPC and NAS, as well as the software and hardware used for them, are very different. HTPC is a different topic.

Quiet-compact

This set of requirements is shaped by off-the-shelf NAS. I want compact and quiet, but to fit 4 disks (often 6, sometimes more). Such requirements usually result in the choice of a Mini-ITX motherboard with a soldered Atom-like processor housed in a compact package. Examples are just below.

There is a very good preconfigured solution - HP Proliant Microserver (). Compact, reasonably priced (from 12,000 at the moment), 4 hard drives, the fifth can be inserted instead of ODD, which is superfluous in the NAS. And with the help of a small tambourine, make the port intended for ODD SATA work normally. Disadvantages - far from a powerful processor, but for many scenarios - sufficient. If the microserver suits you, we go to the chapter about software.

HP Proliant Microserver - a high-quality and inexpensive candidate for the role of a home NAS

If not, first select the case for the desired number of disks (whether or not a disk is needed for the system depends on the OS. We will discuss it in the chapter about software.). Here, in the struggle between show-offs of aesthetic feeling and greed with the desire for efficient costs, the first test of the strength of the concept of "quiet-compact" takes place. Beautiful compact cases are not cheap. If the toad is winning by the desire for efficiency, let's go to the chapter efficiently-scalable. We also go there if the selected case allows the installation of a microATX motherboard. If aesthetics won, we select the Mini-ITX (Mini-DTX) motherboard. The first requirement is a maximum of SATA ports (possible with eSATA). In principle, desktop versions with 6 SATA ports were produced. But whether it will be possible to find here and now is the question. If there are not enough ports, PCIe SATA controllers with 2 and even 4 ports are quite affordable. For them, of course, you need a PCIe slot. Given that it is the only one in Mini-ITX, expandability ends there.

Examples are all from real life, often with modifications and additional photos - see the FAQ in the profile thread, section 3.1

by axel77by half_moon_bayby padavan
FrameChenbro ES34069Lian Li PC-Q25Lian-Li PC-Q08
Power Supply180W includedCorsair PSU-500CXV2EU 500WEnermax 380W (82+)
MotherboardZotac NM10-DTX WiFiAsus E35M-I*Asus P8H67-I**
CPUintegrated Intel Atom D510integrated AMD E-350Intel Pentium G840
RAMKingston 2×2 GBCorsair XMS3 2×8 GB2x4GB DDR3-1333
Winchesters for data4×Samsung HD204UI7×3.5″6×3.5″ + hotswap for 3.5″ HDD in 5.25″ bay
System drive2.5″ Toshiba 500 GBUSB flash drive2.5″ HDD
Operating systemFreeBSDFreeNAS 8.xOMV
Additionallynetwork Intel WG82574L***ST-Lab 370 4xSATAPCIe 2xSATA-II
Price estimate****RUB 14,950RUB 15,600RUB 14,000

* E-350 motherboards are now rare, replaced by E-450 versions. SATA ports - less;
** Not for sale, but see, for example, ASUS P8H77-I;
*** the author added a network through a self-made raiser, but this is rather personal perfectionism;
**** Prices - an estimate at the request of the editors using modern Yandex Market, in the absence of - Price.ru, in the absence - analogues. The estimate is rough, since some models are no longer on sale and the prices found are not necessarily relevant. The price does not take into account data disks, a used system HDD, if available, was taken into account as 1000 rubles.

There are subtleties about "quiet". The first impulse is "complete passive". However, in most cases the argument is accepted that 4-6 drives will make more noise than a good 120mm fan at low speeds. In any case, you need to understand that you have to pay for everything and a compact case, all other things being equal, will be noisier than a more spacious standard one with large fans.

The obvious feature of a soldered-in processor is performance. If it is not enough, the vast majority refuses the Mini-ITX format. But, for the sake of completeness, it must be said that this is not necessary, cf. configuration from maestro padavan.


Assembly from padavan, as you can see - extremely compact

In December last year, Intel Atom S1200 (Centerton) for server purposes was announced. When available, they might be an interesting option for a home NAS. Support for ECC memory, Intel Virtualization (VT-x), 8 lanes of PCI-E, 8 GB of memory - this is enough for most options.

Efficiently extensible

A significant part of NAS builders - some immediately, some faced with the limitations of options on Atom-like processors - decide to put together a configuration that allows for serious expansion. By processor, memory, but above all - by the number of disks. As already mentioned, ready-made NAS even for 4 drives are not cheap, and for 8-10 they are already prohibitively expensive for a home. At the same time, picking up a fairly spacious case is not difficult. For example, in my case, which was left over from the upgrade of the Kraftway computer (they didn’t save on case hardware then), now there are 7 pcs. 3.5″ drives and you can install 3 more without any problems. When choosing a case for a really large number of drives, you should look towards models with many 5.25″ slots, in which you can then install airflow baskets using 5.25″ slots for four 3.5″ drives. See the example in the Costs chapter.

Since the NAS works 24/7, I would like an energy-efficient processor (in Moscow, a watt per year costs 35 rubles). Intel Sandy Bridge and Ivy Bridge seriously reduce idle power consumption, and the NAS is extremely lightly loaded the lion's share of the time. Therefore, the daily power consumption of such a NAS can be significantly lower than that of the Atom version, which is not able to reduce idle consumption. Which processor model to take depends on whether real-time video transcoding is required.

Many modern TVs have DLNA functionality that allows you to receive video over a local area network. The problem is that they understand only some of the encoding options. And often not at all those that use rips and remixes that are found on the vastness of the Web. The problem can be solved in several ways. (1) Search for movies in a format that your TV recognizes. It's the tail wagging the dog. (2) Recode the movie on the computer to suit the TV's requests. It's a waste of time and only possible for yourself filmed video. (3) Load the NAS with real-time transcoding and (4) Buy a media player, that is, a small box that receives, including over a network from the NAS, video as files and supplies an audio-video signal to a TV with a receiver, usually via HDMI. If you chose option (3), then you need to study the specifications of the TV and watch in the Core i7 area. Plus, due to restrictions in DLNA in general, and in the implementation of this marketing idea on your TV in particular, you will not be able to get complete omnivorousness. Option (4) at the current price level is not only simpler and more functional, but also cheaper. Whereas a NAS processor will fit virtually any low-end Pentium or Celeron 2nd or 3rd Generation Core. You can take i3, since the difference will be negligible compared to the price of disks. Choose to taste. For a quick reference or a detailed final comparison of the candidate models, you can use the processor testing section on iXBT. I took the Intel Pentium G2120 as the junior Ivy Bridge at that time. The junior Sandy Bridges are cheap and more than adequate.

Available at the time of writing AMD processors compared to Intel, they are not impressive - although AMD supplies its processors with ECC memory support much more generously, and it is possible that the company will soon have something competitive, for example, the Opteron 3250 with a declared price of $99.


ASUS P8H77-M Pro Motherboard: 7 SATA, up to 32 GB RAM

Motherboard. I took ASUS P8H77-M Pro for the following reasons:

  • LGA1155, we get embedded video automatically due to the processor, it will be needed only at the installation stage;
  • the maximum number of SATA ports, no matter, 3 or 6 Gb / s (7 SATA + eSATA);
  • 4 memory slots are better, but 2 is enough (4, up to 32 GB);
  • integrated 1000BaseTX, considered to be the best from Intel. But given the presence of a processor with a margin of computing power, Realtek will do just fine (Realtek 8111F);
  • PCIe slots for future SATA controllers and network cards(x16, x4 in x16 slot, 2 x1);
  • Form factor - microATX.
This is quite enough to provide all the required functionality. And all kinds of additions will only eat electricity in vain. But if you suddenly liked the ATX-board - you have the right.

The cooler is chosen according to taste, memory - according to the requirements of the selected OC. Here, a spread from gigabytes to 32 is possible.

The power supply is moved to a separate chapter.

Examples of the described option:



by ZanZagby shale
FrameLian Li PC-V354RInWin BP659
Power SupplyChieftec BPS-550C 550W200W included
MotherboardASUS P8H67-M EVO(B3)ECS H61H2-I2
CPUIntel Pentium G860Intel Celeron G530
RAM4x4GB DDR3 PC3-1066Kingston 2×2 GB
Winchesters for data6×Hitachi HDS5C3030ALA6303×Seagate ST3000DM001
System driveCF 4 GB via CF-IDE adapter40GB SSD
Operating systemnas4free 9.xOMV
Additionally Cooler Master DP6-8E5SB-PL-GP cooler, add. 2×Zalman FDB-1 and Arctic Cooling F9 PWM fans
Price estimateRUB 18,2007300 rub

server-so-server

There is a "premium" category of NAS builders who, for objective or subjective reasons, build a NAS from serious and expensive server components. Enthusiasts are experimenting with 10 Gigabit networking solutions. Remember that server configurations are often not quite compatible with living quarters in size and noise. The ability to use ECC memory is the most obvious advantage of the approach. The ZFS file system used in this segment of the home NAS build is memory intensive. In this case, a memory failure can lead to data corruption that goes unnoticed. ECC memory solves the problem, but using it in the Intel version requires server processors (there are interesting exceptions, such as the Pentium G2120) and motherboards.

Virtualization is often used and several guest OCs solve problems, each with their own. A common option is when a SATA controller is thrown into a virtual machine that performs the storage function (Solaris or FreeBSD with zfs). From this VM, disk capacity is exported over NFS or iSCSI to the hypervisor and other VMs. From further explanation of what I myself do not understand much, I will refrain and give real examples.





Assembly from TPAKTOP, outside and inside view

by fatfreeby axel77by TPAKTOP
FrameFractal Design Define MiniSupermicro CSE-SC846E26-R1200B
Power SupplySeasonic X560
MotherboardSupermicro X9SCL-FSupermicro X9SCM-FSupermicro X9SCM-F
CPUIntel Xeon E3-1230Intel Xeon E3-1230Intel Xeon E3-1220
RAM4×Kingston KVR1333D3E9S/8G4×Kingston KVR1333D3E9S/4G4×Kingston KVR1333D3E9S/4G
Winchesters for data5×WD20EFRXin the process of accumulation12×ST31000524AS in two 6xRaidZ2 (main pool), 2xST32000542AS in mirror (backup pool), 4xST3250318AS in stripe (torrent pool)
System driveIntel SSD 520 180 GB2.5″ for 320 GBTS64GSSD25S-M
Operating systemESXi 5.1.0 + Nexenta CE + Ubuntu Server 12.04 + Windows 8FreeBSDFreeBSD
AdditionallyHBA IBM ServeRAID M1015, Noctua NH-L12 cooler2×HBA IBM ServeRAID M10152×HBA IBM ServeRAID M1015, Intel Gigabit ET Dual Port Server Adapter

SATA/SAS controllers

So if you can't wait, you can get started. And in the second part of the software we will discuss in more detail.

I would like to express my gratitude to all participants of the profile branch on the forum.site, including comrades axel77, half_moon_bay, padavan, ZanZag, shale, whose configurations were used in the article; comrades Sergei V. Sh, TPAKTOP, iZEN and RU_Taurus for many helpful comments.
Special thanks to free software developers: Olivier Cochard-Labbé, Daisuke Aoyama, Michael Zoon, Volker Theile and many more. They made the DIY NAS theme possible.

Part two: software

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

To whom and why

Your home NAS should satisfy you, it's not a production system that must provide some formalized indicators. There are two difficulties in describing such a thing. One is included in the epigraph, and the second is associated with an acute shortage of telepaths. But I'll still try to make some reasonable assumptions, and they will fall under the category IMHO. To save space, I omit "IMHO" further. We believe that this label is on every sentence. If it was not possible to see your specific case, I apologize, perhaps a different text will suit you.

The same one is addressed to those who build their first NAS, able to install Windows, but who have never seen FreeBSD Handbook or Oracle Solaris ZFS Administration Guide. NAS is also assembled by IT-savvy citizens, they usually deploy the full version of the chosen operating system. It is interesting that some newcomers to the topic are drawn in and eventually do the same.

Tasks

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

The first task is secure storage. The data must survive a hardware problem, such as a 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 in the local network. Family photos, videos, documents you created are unique and unrecoverable, but at home it’s all well kept if in one and a half copies: one on a laptop drive, half on some USB drive where the photos were dropped last fall. If (more precisely, when) such data disappears, and the NAS allows them to be restored, you will experience sincere pleasure from your insight. Or vice versa.

Requirements

Moderately difficult initial setup. A person on the first day should get a working version. Maybe not fully tuned, but giving a useful result. This, by the way, means that the user who has filled his hand must initial setup deal with it in a couple of hours.

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

Transparent everyday use. Your better half with a liberal arts education should be able to handle it: watch movies on TV, listen to music, backup from her laptop to NAS should be automatically done, 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, using this technology is a temporary step that ends with either buying a network media player (I think the preferred option) or connecting a TV as a monitor. If time and nerves are expensive, then it may be worth skipping this step.. The capabilities of a player built into a TV and an inexpensive separate one, like Dune, Popcorn or WD, usually differ greatly in terms of omnivorousness, picture quality, ease of use, etc. True, built-in players are progressing rapidly, so it’s worth deciding on a specific hardware.

Disk arrays and file systems

Why do you need an array

The main issue when building a NAS is the organization of disk space. As we found out in the 1st part, there are a lot of disks, 4-6, sometimes 10 or more. Of course, they can also be used separately. But combining into an array is convenient because the place is available in a single piece. In an array without redundancy, when a disk dies, the data on it and, often, depending on the implementation, on the entire array die. You have the right, using the “nothing, I’ll transfer” argument, to save on redundancy. Those who value time prefer arrays with redundancy. Important: no RAID will replace a backup. RAID ensures data availability in the event of a 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 software for a NAS, you can use them or not. To understand what is more suitable 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 at the same time. But writing to multiple disks is not an atomic operation. If a problem occurs during writing (power off, disk failure, etc.), it is possible that the data and parity blocks do not match. If the data is written incorrectly, then 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, may go unnoticed until the moment when the array is restored from them. And instead of the data, garbage will be restored. Moreover, the garbage will be recorded without any warning about that. Additional information on the problem can be obtained.

Figure 1. RAID write hole. On the left - data and parity blocks are synchronized, recording is in progress. In the center - a power failure. Right - data and parity blocks not synchronized, but the RAID does not know about it.

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

Failure during reconstruction

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

Reliable file system

Let's go one level up, to the file system. They expect a simple thing from her - the ability to write files and then read what is written. Paradoxically, most file systems do not guarantee this: they rely on the perfect operation of the hardware - the disk controller, the cable, the disk itself. A hardware failure doesn't just result in data loss, it results in unnoticed data loss. 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 we do when transferring firmware and similar non-failing data. And why not compare the checksums using the FS?

Another "childish" wish for the FS - so that it works and does not break - is also not really fulfilled. An unjournaled filesystem, such as FAT or ext2, is capable of burying all of its contents if it crashes. Journaled file systems, such as NTFS or ext3, are much more reliable, because you can find the point of consistency and replay the log. Is it possible to create a FS that cannot get into an inconsistent state at all? It is possible - through Copy-on-Write. We write the data not over 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 FS functionality with support for RAID-like arrays. Distributed under a free license (CDDL). Created by Sun Microsystems for Solaris. Ported to FreeBSD since version 7.0. More recently, the ZOL (ZFS on Linux) project has reached the release stage. We can expect a rapid spread of ZOL, the process has already begun. There is also a project for Mac OS X, ZEVO, see .


Fig 2. ZFS automatically compares checksums, detects errors and restores data if it is saved with redundancy (figure from eonnas.com).

Take a closer look at ZFS if you are interested in a file system with such features:

  • storing checksums and not allowing garbage to be read instead of data;
  • preserving integrity to such an extent that utilities like chkdsk or fsck simply do not exist for it;
  • equipped with a tool for checking the integrity of cold data and their automatic correction if the data is stored with redundancy;
  • able to instantly create snapshots of its state and store them at least for every minute of the month, mount any set of snapshots, roll 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 on record;
  • capable of reconstructing a degraded array with partially unreadable disks with the loss of only those data for which there is no copy;
  • working during integrity checking and reconstruction only with useful 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" (preserving data if any three disks in the array fail), as well as more complex options like RAID50 or RAID60.

ZFS also has disadvantages, the main of which are:

  • You cannot grow a RAID-Z array by one disk. You can replace all terabyte disks with triters - and increase the volume. It is possible to assemble another RAID-Z from 3 (or more) disks and add it to the existing one, getting 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 - 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 it worked for me with an Atom 330 and 2 GB of memory. Although when using ZFS this Atom was not enough for me to completely utilize the gigabit network, 40-50 MB / s will suit many.

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

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

ReFS + Storage Spaces

In Windows Server 2012, Microsoft introduced 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 analog of ZFS, and with properties that are 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 feedback from those who tested it, the performance of the ReFS-Storage Spaces bundle noticeably, at times, drops when using options with parity, that is, roughly, an analog of RAID5 or ZFS RAID-Z. Worse yet, there are early reports of data loss due to ReFS failures, with official support didn't solve the problem. So an interesting solution, it seems, is worth ripening.

Btrfs+mdadm

Officially, Btrfs for Linux has not yet received release status, although it has been developed since 2007. Like the vast majority of file systems (and unlike ZFS), this 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-established mdadm, one of the features of which is to rebuild RAID when adding a disk without losing data.

Traditional FS

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

Software options


Fig 3. An approximate algorithm for choosing software for a home NAS

From what and how to choose

I want to recommend downloading VirtualBox, installing a few options you like there and poke 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-assembly NAS software.

First, you can put the full operating system. It can be Linux, UNIX or Windows depending on personal needs and preferences. Windows seems more familiar, *nix gives 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 set up and use the product without a command line.

Finally, the third option is to install a complete operating system, and on top of it - some kind of web interface for configuration and management. A compromise option, an intermediate one. Simplifies use, but not to a level sufficient for an inexperienced amateur. And advanced citizens usually dislike any superstructures. We'll start with options for mere mortals.

Windows

In the profile branch, a survey was conducted about the operating systems used by forum users in self-assembled NAS operating systems, and Windows got third place with a result of just under 20%. Of course, more advanced comrades also voted, but they were definitely not the majority.

A result that can surprise. Windows is the most familiar operating system to most people. Based on it, you can make a NAS - in the end, 20% of the respondents did it. The reason for the modest number is that using Windows as a NAS axis has not only advantages, but also disadvantages:

  • Windows is paid software that competes with much more functional free software for specific tasks.
  • Supports the existence of viruses, which requires constant loading of anti-virus databases.
  • Requires constant application of updates, and after them a reboot is often needed. 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 needs a monitor, keyboard, and mouse to function naturally. NAS is usually deprived of them. But of course, there are ways to solve the problem.
  • Windows is resource hungry.
  • 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 in them, and make a lot of discoveries, sometimes without wanting to.

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

  • Native high speed SMB implementation.
  • Iron compatibility. Drivers for Windows are required.
  • Wide selection of software. That is, for a NAS, you usually don’t need a lot of choice. But the more specific your requirements, the more likely it is that they can be solved with software for Windows.
  • A huge number of instructions and solutions for all occasions, in their native language.

NAS on Windows is quite possible. But the theme windows settings disclosed 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 builds - NAS4Free, OMV (=openmediavault) and FreeNAS 8.x. All are aimed at the average hobbyist and allow either out of the box or by downloading plug-ins to satisfy typical needs.

There is a history of confusion associated with the FreeNAS trademark. The FreeNAS product evolved over many years and then split for a number of reasons. The well-known name, which is a trademark, fell into 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 survived by enthusiasts, was ported to FreeBSD 9.x and is successfully developed under the name NAS4Free. As a result, a configuration-preserving upgrade from FreeNAS 0.7 is supported on NAS4Free, but not on FreeNAS 8.

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

We'll summarize the official hardware requirements for these three products in a table, especially since they're not easily googled.

And, of course, we need disks for storing data. It seems that the FreeNAS developers do not specify the requirements to just start working, but to work productively. In any case, the operating manual for installation on a virtual machine indicates the minimum RAM size of 512 MB.

NAS4Free

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

NAS4Free is compiled in two versions, for 32-bit and 64-bit Intel x86 compatible processors. There are three ways to use NAS4Free: 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 performed. The full option is a traditional installation, usually to 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 put full on a USB flash drive, but due to intensive recording, the flash drive will wear out in a few months.

For installation on a USB flash drive, the embedded installation option is intended. When the system starts, a small disk is created in memory, where the system image is copied and immediately configured according to the parameters collected in a single XML configuration file. And then it is loaded from this disk in 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 it and, if necessary, use it to restore the system. The disk in memory is very fast, and the system flash drive practically does not wear out.

The disadvantage is that almost any changes made to the system other than through the web interface are lost after a reboot. Partially, the developers solved the problem by providing the ability to save many parameters in the web interface. Part of the problem can be circumvented by using tricks like joining in-memory disk folders with real media folders via unionfs, and using auto-run command scripts. More advanced users use virtualization to jail or separate virtual machines anything, even a couple of Windows. TheBrig extension greatly simplifies the setup and use of jail to install additional software. But it still requires knowledge comparable to that needed to deploy a complete system. And it’s more correct for a beginner to assume that NAS4Free has only those services that are included initially, everything is configured through the web interface, and nothing can be added.

List of what is "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 mix (1+0, 1+1, etc.), disk encryption (using hardware acceleration if present), 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) - powerful tool, including backup, SCP (SSH), iSCSI target;
  • Services: UPnP server (FUPPES - I must admit, average), 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 that 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 bundled UPnP/DLNA media server. From personal experience, it is quite working and will satisfy most needs, but if you need special buns, you have to look for something else.

I wrote detailed, with pictures, setup instructions and. Both the basic setup and tricks are described, such as installing homemediaserver in a Windows virtual machine or TorrentMonitor in jail to automatically download TV shows 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 severely 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 both in the high hardware requirements (6+ GB of RAM) and the focus on the functionality used in the business. Typically home services such as bittorrent and UPnP/DLNA media server are implemented as add-on modules, each in its own jail. Working with jail is done through user interface and, like the whole project, is well documented.

UPD: FreeNAS 9. More recently, on August 5, 2013, FreeNAS 9.1.0 was released, and on August 27, bug-fixing release 9.1.1 The new version uses FreeBSD 9-Stable and, according to the developer, contains significant improvements in the area of stability, extensibility, ease of use and performance. We plan to test the performance in the 3rd part 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 more of a preview. For actual use, the 64-bit version is recommended, in part because of the memory requirements that are incompatible with the 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 it over time).

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

OMV

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

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. On the net you can find a hack to install zfsonlinux on OMV.

OMV is installed on a hard disk or a USB flash drive, while it occupies the entire media. Such an installation does not look optimal for either 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 USB flash drive that intensively writes to it. However, for both problems, enthusiasts have developed hacks that solve these problems: a special script removes write-intensive directories into memory, and simple editing of the distribution kit allows you to create a partition for data on the system disk.

It makes little sense to describe the functionality of OMV. Basic functionality similar to NAS4Free and FreeNAS, with the notable absence of ZFS, available out of the box or as a bundle additional modules. But OMV is essentially Debian, a variant of Linux for which there are an incredible number of applications. They can be installed in the standard Linux way.

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

Other options

In addition to the three most popular assemblies, there are many others. Paid options were practically not considered by the author, their popularity is low. You can mention free in basic version, up to 3 discs, and not prohibitively expensive in paid ones. This is not quite a NAS, but a solution that allows you to keep home file storage on different-sized disks, including those formatted in NTFS, as well as add disks to the system. At the same time, 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 is . This is a Linux(CentOS) project with zfsonlinux integration. If (and when) the author brings the product to release, it can be an interesting alternative.

Many NAS builds are rooted in enterprise applications. For a home, this can be a disadvantage. It's not so bad that the emphasis is on functionality, of little interest at home. Worse, the necessary one is missing from the box, and it is difficult to add it. Most often, such assemblies lack a torrent client and a DLNA server. An example is, which is also distinguished by the paid documentation.

If you, like the author of these lines, the presence of ZFS seems to be a mandatory functionality of the NAS, then sooner or later attention turns to options that grow roots from Solaris. All Solaris derivatives were sealed by Oracle's suffocation of OpenSolaris after the Sun purchase. Most made it through the difficult phase by moving to the Illumos codebase, some died out, but that's another topic. There are several options here, for example. Pros - performance with slightly less appetite for hardware compared to options on FreeBSD and Linux. Cons - 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.

The use of modified software from purchased NAS on standard hardware stands apart. The author is not a lawyer in order to fully assess the details of the application of licenses, so just in case, we will do without references. But for a non-lawyer, the picture looks very similar to the situation with OpenWRT. The original firmware is written by the NAS manufacturers on an open source basis with a GPL license. Under the same license, the result is published in source codes. Enthusiasts, again under the GPL, 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 third-party NAS. The latter, by the way, has been practiced for many years and is still not covered up - probably just because of the lack of legal violations in such practice. The advantage of this option is the price, but there are also disadvantages. Firstly, in addition to the GPL code, the purchased NAS also uses a proprietary one, mainly for communication with hardware. Therefore, such assemblies have problems in going to sleep, saving electricity, controlling fan noise, etc. Secondly, a purchased NAS from a leading manufacturer is also Internet services intended, of course, only for buyers, and not for everyone. So exactly the same as a result of installing such an assembly does not work, rather it is an option to feel, including in a virtual machine.

Web interface for full OS

More or less active members of the profile branch use ZFSguru and napp-it. Undoubtedly, there are other products, starting with . But they are less suitable (or not at all suitable) for the purposes discussed. Yes, and the author did not encounter them, see the epigraph.

ZFSguru

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

nap-it

The project in terms of readiness looks like a rare exception. The product allows you to literally turn a clean installation of a Solaris-like operating system into a NAS with ZFS in just a few clicks. The current version recommends using OmniOs or OpenIndiana, Nexenta, Illumian and Oracle Solaris 11.1 are supported with some limitations. 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 - paid. According to the results of short tests by the author on the virtual machine, the impressions were positive. But solar is solar. In the repositories, even the transmission is very bearded, and a more or less modern one needs to be assembled, for which the author of the curvature of the hands was not enough. Kamrad 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 while napp-it is a great addition to Solaris-based NAS friendliness, it's best not to harness this cart without a notable UNIX experience.

Full *nix system

Here - briefly. To teach a scientist is only to spoil. A server *nix product from scratch at home is raised either by people with professional experience or advanced amateurs whose hobbies no longer fit in the sandbox of a finished assembly (or box) with ruffles sewn to it. Judging by the profile branch, they work with a wide variety of software. Often by combining the strengths and / or advanced functionality of products under different operating systems through virtualization.

Virtualization in NAS

The use of virtualization in NAS is a natural practice for an advanced user. Probably the simplest option is to install VirtualBox on a NAS with a PHP web interface and raise several virtual machines that do what is difficult or impractical to do in the main axis. First of all, launch more or less exotic software. For NAS4Free and OMV, special extensions have been written 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 through the monitor, mouse and keyboard of a desktop computer is even easier, including using a VNC client. The downside of VirtualBox is a significant performance hit compared to bare metal systems.

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

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

Total

If you read so many letters at least diagonally, then you can handle the creation of a home NAS by 99.9%. There would be a desire. Good luck, and if anything - contact the profile branch.

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

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

Canon PowerShot A200

Digital photography burst into my life in 2002 with the birth of my daughter. You can’t remember everything, and with time something is forgotten, and therefore I wanted to capture as many moments as possible of the beginning of her life. So it was assumed that I would take a lot of photos and often, which then film photography did not allow (the cost of film + the cost of printing = expensive). And on August 21, 2002, a Creative PC-CAM digital device was purchased that combines a battery-powered webcam and the ability to take 1MP digital photos no more than 8 pieces (it no longer fit in the internal memory of the device and it could not work with memory cards) . Very quickly realizing all the charm of such a photo and the inferiority of the built-in small memory, after a couple of months, the young dad strained himself financially and bought a real Canon PowerShot A200 digital camera that could also record video!

Canon PowerShot A400

From that moment on, the Samsung Hi8 camcorder immediately died morally in pursuit of the film camera. The quality of the photos of the new camera was so amazing, and this Canon line is so versatile (multiple optical zoom, stabilization from "shaky" hands, a large number of photos from a single charge), that in subsequent years only the model changed: A400, A430, SX100 IS (optical stabilization!) and SX200 IS. The latter was also bought on August 21 (coincidence), but already in 2009 and is still in use. In addition, in March 2012, a Sony NEX-C3K Kit camera was purchased with two interchangeable lenses in the kit 18-55mm/F3.5-5.6, and the volume of photos and videos (already in FullHD quality) has grown significantly. The Sony NEX camera is even better because through a cheap Chinese adapter I connected the Helios 44-M lens to it from my father's professional Zenith camera in the USSR (wow, how many weddings were filmed on it!).

CANON PowerShot SX100IS

What am I for. For about 17 years, we have accumulated more than 20 thousand photographs and many, many hours of video. For me, this is a real treasure, which I didn’t want to lose at all. All this goodness was unloaded from the memory of cameras and carefully stored first on the hard drive of the PC, then, due to a problem with viruses in Windows, moved to one external drive, and then to a more capacious HDD western digital(WD) 1TB My Book. Plus, digitized films (!) from my father and from my Samsung Hi8 video camera began to take up some decent volume.

Photos in old photo albums could disappear only if there was a fire, but you will notice this unpleasant event immediately, or if you are lucky, then call the firemen in advance and manage to save everything. The peculiarity of the digital is that all your accumulated photo and video archive disappears instantly, without the preliminary smell of smoke, how to say “at the snap of your fingers”. In recent years, this has happened to two of my friends with external USB-HDDs.


As an option for storage external HDD, the market offers us NAS devices - network storage devices. But this is not their only function, these devices have a fairly wide functionality: they can work as stand-alone torrent downloaders, and then they can broadcast the downloaded video, for example, to a TV, they can work as media players directly on TV by connecting via HDMI, as servers of your web site, etc. Everything is limited only by your desires and the software repository for a particular NAS. Drives in the NAS can be combined into arrays from RAID0 to RAID10, depending on the number of slots in the NAS model. RAID allows you to freely manipulate the shared disk space (for example, combine two different HDDs into one common disk using RAID0), and make file storage more secure (for example, using RAID5). You can read more about the options for using different levels of RAID on the Internet. And another difference from conventional PCs and a big plus of NAS is energy efficiency and silence. Because NAS is not supposed to be used for games, they usually put a cold processor and a large slow fan to cool the HDD. The big minus of NAS is the cost, sometimes reaching up to 40 thousand rubles or more for some models, and this is without taking into account the cost of drives, which can take another fifteen thousand (for example, 4 HDDs of 1 TB each in April 2019 prices) . Agree, not every family budget can pull this whole idea.

Fortunately, there is another alternative and very budget option. I also took advantage of them. It's certainly not ideal, nothing is perfect. Of the benefits - the cost is from 0 rubles, you can assemble a NAS for your home from an old PC and unnecessary HDDs. And from the minuses - you must be "with hands" or at least not be afraid to tinker a little with pieces of iron and software. I went down this path and here is my story.

corpus example

For starters, a decommissioned 10-year-old “office” PC with a 300W PSU, 2GB of DDR3 RAM, an Intel Pentium Dual-Core E5400 processor and all this “happiness” was found on a Gigabyte GA-G41MT-ES2L motherboard (2009) having “ on board" for connecting hard drives, not only 4 SATA connectors, but also a couple of old IDE. I was very happy with the last one, because. I had a couple of old IDE drives that had just been lying around unneeded for years, on which I was going to start my NAS experiments. Another thing that pleased, on the motherboard, in addition to naturally PCI slots, there was one modern PCI Express x1, which was very useful to me later. Of the minuses of this motherboard - there is no way to load the operating system from the built-in card reader, even after BIOS updates before latest version. It's a pity, I have an unnecessary pair of 4GB SD cards that would be suitable for this project, but alas. But it is possible to boot the OS from a USB flash drive. Okay, let's see how this can be used in the future. There is also a 1Gb network port on board the motherboard, which is just great, because. network copying speed will be very fast. The center of my home LAN is the Zyxel Giga II Internet Center, whose ports also operate at 1Gbps.

Let's continue. So the second question after system block, there was such: and what OS to use for NAS? There are many options on the Internet, both paid and absolutely free: FreeNAS, EasyNAS, Rockstor, OpenMediaVault and the like, I advise you to read the article (opens in a new window) "The best NAS distributions". After I watched Youtube for a few more days, and then independently checked and tested all these OSes on my virtual computer in VirtualBox, the decision came to stop at OpenMediaVault (in short OMV). Why? Yes, because OMV fully supports the Russian language, is free and based on the Linux (Debian) OS, which means stability and reliability that Windows OS never dreamed of. What is remarkable about solutions on Linux OS is that they are free, there is no threat of infection with OS viruses, which means there is no need to buy an antivirus, system requirements to Linux in times below than Windows, which means that the OS will feel great even on those PCs on which Windows simply refuses to start. In addition, devices running Linux do not require much attention to maintenance (for example, all SmartTVs, routers and Cell Phones work on one or another build of Linux. In general, whatever one may say, Linux in this case, this is my choice. In general, I decided on the OS.

I probably will not describe the installation of OpenMediaVault here. Everything is quite simple, there are no problems, and there are plenty of similar descriptions on the Internet, for example, I will give a link to the article (opens in a new window) “Openmedia vault, or How to make a NAS yourself? ". Read yourself. I'll just write what works for me now:

    Torrent downloader with a web interface. Very comfortably.

    MThe miniDLNA media server allows you to watch movies on your TV. Specified several folders where my films are located, as well as the folder where the torrent downloadsrocker.

    Notifications enabled for email. Now at work (yes, anywhere!) I immediately know about all the incidents if they happen.

    S.M.A.R.T hard drive monitor enabled. If a disk suddenly becomes “bad”, I will receive a notification about this by e-mail, for example, on my smartphone and I will be able to save information from it to another disk in time, before the disk is completely broken.

    Rsync is enabled, with which backup copy hard drive with family photos and videos is archived on a remote server at work.

    Imade a shared folder for all users in mine home network. Now there are no problems with documents, when you finish editing the text on a stationary PC, you can open it on a laptop that is on the balcony or on a tablet.

    Clave antivirus is enabled for scheduled scans of a shared folder. The fact is that there is one Windows PC on the home network, and although it has an antivirus installed, it it's Windows and we understand that the antivirus in this case is notalways saves. So in fact, an antivirus in Linux is needed in case files in a shared folder become infected from a Wiondows computer. In Linux itself, there are no viruses just as a class.

IDE HDD example

OMV has a plugin that needs to be installed if the OS is running on a USB flash drive. To be honest, my hands itched so much that I hurried and did not deal with this plugin, and therefore did not install the OS on a USB flash drive, and in order not to take boot disk valuable SATA port on the mother, I decided to put OMV on an IDE disk. And what? The speed is not so important here, the peculiarity of Linux is that it works in the PC's memory and does not terrorize the write-read HDD computer like Windows. In general, the OS takes up about 2.5 GB of space and is located on a 80 GB hard drive, and after finishing all the OMV settings, I made a backup on the second IDE screw, in case the first IDE drive fails. That's how it turned out byudzhetninko and I think it's reliable.

Temporarily, for experiments, friends threw a pair of 3.5" HDD 500GB each. I included them in RAID0 and the output was one disk with a capacity of 1TB. Until they take it back, it will work like this. Used for the operation of the torrent and the shared folder of users. We also bought a pair of 2.5" Seagate Barracuda 1TB. That's how all 4 SATA ports on the motherboard became occupied. The photo on the right shows, from top to bottom: 2 IDEs with an OMV system, then there are a pair of SATA 500Gb that are “linked” in RAID0, and at the very bottom two are 1TB 2`5 inch laptop screws. By the way, the pictures below are all clickable, click on them to enlarge.


Aerocool Motion 12

Because disks turned out to be what is called "foreboding" and the summer is ahead, I decided to do it for them additional cooling. I bought an Aerocool Motion 12 fan at the CSN for 270 rubles. and installed it inside opposite the rack with the HDD in a regular place. It works quietly, 1200 revolutions in total, but it blows wonderfully due to the increased number of blades, there are 9 of them.

I wonder what to do when I need to add at least one more hard drive? Now there is no free SATA port on the motherboard, and there is also no place in the PC case in the regular HDD attachment points.

Oimaster He-2006

Wandering around the Internet, one day I found in Chinese store interesting solution. A rack for six 2`5 HDDs on a retractable chassis is inserted into the PC case in place of the DVD drive, with a lock against accidental disconnection of disks, with an indication of HDD operation and forced cooling of the insides. Of course, I didn’t need to go directly to 6 HDDs, and even inside a limited space they would be too dense, and this is a heat removal problem, the disks heat up, especially around the clock. But in general, I liked the idea. I began to look for a solution for 4 HDDs and I had to somehow solve the problem of the lack of free SATA ports. And to paraphrase the proverb about Rome in a modern way: in China - everything is there. I found an SSU SA3014 PCI-E board that adds 4 SATA 3.0 ports for about 1350 rubles on Alishka.

But to be honest, I got lucky at that moment and bought it elsewhere: the new online store Bringly.ru, a joint project of Yandex and Sberbank, had just opened. There were discounts, and even for the first purchase they gave out points with which you can pay for the goods like money. In general, together with everything, with delivery, this fee cost me 565 rubles. It turned out very budget, in the style of my project. Then, having reviewed a bunch of options for HDD racks in a 5`25 bay, I came to the conclusion that the most normal company is Oimaster. A bunch of positive reviews, and judging by the photo of the device, everything is quite high quality and reliable, although a little expensive.
But after all, he must also carefully take care of my disks so that the data stored on them does not disappear anywhere, for example, due to poor-quality soldering of some kind of circuit inside the rack or elementary overheating. The minimum price for it is around 1898 rubles. For a couple of months I was looking for cheaper options, I was waiting, maybe where there will be discounts? There were no discounts on the last sale even on Aliexpress, so I had to buy what is called at full price. It's good that I use the Letyshops cashback service (click on the banner at the top of this page), and part of the money paid is always returned to me, so we can assume that the goods are always cheaper. When everything came, I installed everything in the case. Everything works perfectly!

OMV has a built-in statistics system. A record is kept of how strong the load on the processor is, how much RAM is used, and how much is left free, you can see the dynamics of filling hard drives, and so on. Let me remind you that my system has the Intel Pentium Dual-Core E5400 processor, whose power turned out to be more than enough, the average load does not exceed 8-10%. Random access memory 2GB is also more than 0.6GB is occupied by the system, the rest is allocated for data buffering.

In conclusion. I can say that the NAS turned out to be cheap, in fact, from the mandatory expenses - this is 270 rubles. for an additional fan for mandatory cooling of the HDD array. So do not rush to throw out old PCs - they can still serve you for a long time, but in a different role. If there are old HDDs, then there are no costs either. All my other expenses for an additional fee and a rack for 4 disks were, in general, not necessary. The OMV capabilities are enough not only for home use, but also for the office and for a large corporate network - since all this is based on the Linux (Debian) OS with regular system updates. And my NAS pleases with seven new movies, instant availability of the entire mass of home videos and photos at once, and finally, confident peace of mind for the safety of all the data accumulated over the years.

Categories:// dated 09/04/2019