We remind you that attempts to repeat the author’s actions may lead to loss of warranty on the equipment and even to its failure. The material is provided for informational purposes only. If you are going to reproduce the steps described below, we strongly advise you to carefully read the article to the end at least once. The editors of 3DNews do not bear any responsibility for any possible consequences.
A year ago, it was no coincidence that we reviewed the seventh version of FreeNAS, since the eighth edition removed many nice features like the built-in BitTorrent client. And the story was very simple. The FreeNAS project a year earlier was absorbed by iXsystems, Inc., which transferred it to a partially commercial basis and reasonably considered that all sorts of domestic nonsense was not needed in a serious product. The developer of the original FreeNAS gave the code of the seventh branch to the community, as a result of which its rightful successor NAS4Free was born. Along the way, the developers updated the basic version of FreeBSD to the ninth. So now NAS4Free supports a lot of new hardware and technologies, including modern Intel Atom and ZFS file system. The system is still managed through the web interface, but you can freely use all the functions of FreeBSD itself, adding shine and beauty with a manual “file”.
System requirements remain approximately the same as FreeNAS. The very, very minimum amount of memory required to run is 256 MB. In practice, you need to have at least 512 MB, and to support ZFS - 1 GB of RAM or more. An Intel Atom or some old Pentium 4 is suitable as a processor. To use ZFS, you also need support for AMD64/EM64T instructions. The OS takes up very little disk space—from 380 MB. If you want, you can install NAS4Free on a USB flash drive or SD/CF card. It is not recommended to use flash memory for an optional swap partition. As disks for storing files directly, it is best to take capacious, but quiet and cool series from well-known manufacturers. To create arrays (except JBOD), it is better to have HDDs of the same capacity, otherwise the available space will be limited by the capacity of the smallest disk. It also doesn't hurt to have a gigabit network connection. If the computer meets the above requirements, then you can proceed with the installation.
⇡#Basic installation
There have been no noticeable changes in the installation process since FreeNAS. System images for copying to CD or flash drive are here. After burning the image to a suitable medium, you need to boot from it. Most likely, you will be satisfied with the default launch in the bootloader menu, but if problems arise, you can try safe mode (step 3). In the NAS4Free main menu, we are interested in the last item, when selected, the installation of the system on the hard drive starts. For our case, installing the full version (Full), which is located under the third number in the list, will do. The installer honestly warns that all data on the disk used for the system will be deleted. By the way, here you can update an already installed system to the latest version.
Once again, make sure that you are willing to sacrifice data on the drives. If everything is in order, then you can continue with the installation. We will need to select the media from which the installation will be made, and then the disk where the system will be recorded. You can navigate the list of drives by their capacity. Next, we will be asked to specify the size of the partitions on the disk. The partition with the OS must be at least 380 MB in size, but it is better to take it with a reserve - for example, a gigabyte. Optionally, you can create a swap partition. If the installation is performed on a flash drive, then you will have to abandon it.
Otherwise, you will need to indicate its size. Either leave the default value or specify a value equal to the amount of installed RAM. Then the installer will “rustle” the disk for a while, display a report on the work done and prompt you to press Enter to return to the main menu, from where you can reboot the machine (Reboot Server), after first removing the CD or flash drive with the NAS4Free image. After the restart, you will be taken to the main menu of the newly installed system. If you enabled swap, then write down the partition path just in case (something like /dev/ada0s3).
By default, our homebrew file server tries to obtain an IP address from the 192.168.1.0/24 subnet, and its network name is nas4free.local. These settings are not suitable for all local networks, so it is better to change them. If your machine has several network interfaces installed, then in the first menu item you need to associate one of them with a local connection. Initially, it is suggested to use DHCP to obtain an IP address. To make it permanent, you can set the appropriate settings on the router (Static DHCP).
It’s easier to manually set connection parameters in the second menu item. In this case, you will need to specify the NAS4Free IP address, subnet mask, IP addresses of the gateway (your router) and DNS server (usually the same as the router address). IPv6, it seems, will be irrelevant for a long time, so you can safely abandon setting up this protocol. All other system settings are carried out through the web interface, which is available at https://ip_address_nas/ or https://nas4free.local.
The default login is admin and the password is nas4free. After logging in, the user is taken to a page with brief information about the operation of the system. First of all, in the menu, go to the System → General section. Here you need to change the web interface language to Russian for greater convenience, as well as specify the time zone and enable synchronization with the NTP server. Optionally, you can change the username and switch to HTTPS instead of HTTP. It is strongly recommended to change the password to access NAS4Free on the adjacent Password tab. Don't forget to click the Save button after making changes to the system settings.
If you enabled the creation of a swap partition during installation, you must now enable it. In the "System" → "Advanced" → "Swap File" section o. In the list of types, select “Device” and enter the path that was shown during installation. To activate swap, the machine will have to be rebooted. Also in the advanced settings section it is recommended to enable Zeroconf/Bonjour and, if you want, the power management manager. It would be a good idea to specify e-mail parameters for sending reports and warnings. It's a good idea to keep a backup copy of all your settings, just in case. At this point, the basic setup of NAS4Free can be considered complete.
Free installation via sourceforge
NAS4Free can be installed on virtually any bootable media that supports advanced formatted drives using 4K sectors, including LiveCDs with low-power USB drives. Computer platforms x86-64 and x86-32 are available in version 10.3. The software distribution is currently distributed in ISO (.iso, ~370 MB) or USB stick (.img, ~320 MB) format as source code. There is also a small program image (.img, ~150 MB).
The preferred method is an embedded USB installation. The NAS4Free OS will boot from system memory, excluding system writes to disk. Flash devices are more power efficient and the update process can be completed using the WebGUI interface in the browser by downloading and installing a new firmware image.
For NAS4Free beginners, installation and configuration is carried out in detail according to the manufacturer's instructions and usually begins with downloading a LiveCD from the NAS4Free sourceforge. You can connect using the ASRock IPMI interface, which allows you to create a bootable USB. Select the image after downloading and run it.
Action algorithm:
- Perform nas4free install, boot from CD. At this stage, select option 9 “Install from LiveCD”.
- Go to the configuration and update options menu.
- It is recommended to use a USB drive to install the operating system as it does not take up valuable SATA/SAS port.
- Go to the web interface and begin setting up NAS4free.
- Default login information: username - admin, password - nas4free.
- The web interface is quite extensive, so most tasks can be easily completed after installation using a browser.
⇡#Setting up disks
To add disks to the system on which data will be stored, go to the “Disks” → “Management” section and click on the plus sign. In the list, select one of the free drives, but not the one on which NAS4Free is installed. It's useful to enable SMART support, add a short description of the drive, and optionally adjust power saving levels. If there is already some data on the disk and you need to save it, then in the last list you need to select the file system you are using. Well, in the case of a “fresh” and empty drive, select the Unformatted mode. All installed disks are added in the same way. On the “Disks” → “Management” → SMART tab, you must select the disk scanning mode, specify the temperature thresholds for the protection system response and enable e-mail notification. But then several options are possible.
If you only have one drive, you can simply format it to UFS (recommended), FAT32 or Ext2. To do this, in the “Disks” → “Format” section, you need to select a disk from the list and specify the desired FS. However, even if you have several disks, you can mount and use them separately. But it makes more sense to combine them into a single storage - this can be either software RAID or ZFS. For the first case, when formatting drives, you need to select the Software RAID option, and then proceed to selecting the RAID type in the “Disks” → “Software RAID” section. For most users, JBOD (banding) is enough to get maximum capacity, or RAID 1 (mirroring) for reliability. On the tab corresponding to the selected array type, click the plus sign, enter the name of the future array, select two or more disks from the list, and click the “Add” button.
The system will quickly collect and initialize the new array. Now it needs to be formatted. We return to “Disks” → “Formatting”, select our disk array, specify UFS as the file system, set the volume label and start formatting. When the process is finished, go to “Disks” → “Mount Point”, where we again click on the ubiquitous plus sign. We select our array as the disk, and UFS as the file system. All that remains is to specify the name of the mount point, which must be unique for each drive. Here you can add existing data drives to the system by correctly indicating the partition type, its serial number and file type. It is better to leave all other settings unchanged.
This was, so to speak, a classic version of working with storage devices. However, NAS4Free supports the extremely interesting and promising file system ZFS version 28. Perhaps there is no point in listing here all the advantages and disadvantages of this interesting development. Among the advantages, it is worth noting the high reliability of data storage, on-the-fly compression and the ability to quickly create snapshots (“backup” copies), combined with fairly high performance. The price for these 33 pleasures will be an increased load on the CPU/RAM and a slight decrease in available space due to the need to store metadata. According to the logic of its operation, ZFS is somewhat different from the usual combination of drives with a file system and a logical disk (volume) manager. The basic element is the so-called virtual device (vdev), which can be represented by a regular HDD, a RAID array or a group of several devices (RAID-Z). These virtual devices are combined into virtual pools, and devices of different types cannot coexist in the pool, which can lead to problems when adding new drives. But ZFS itself is already being built on top of the pools.
If you decide to try ZFS as the main FS, then format the disks as ZFS storage pool devices, and they will turn into those same virtual devices. In principle, you can create a software RAID array and format it. Newly created vdevs are added to the system in the “Disks” → ZFS → “Pools” → “Virtual Devices” section. To get the maximum volume, use the Stripe mode, for reliability - Mirror and at least two disks. For RAID-Z single parity, it is recommended to use 3 disks (or 5, or 7). If you have more than four drives, then this no longer looks like home use, so let’s leave such massive configurations aside. After adding devices, go to “Disks” → ZFS → “Pools” → “Management” and create a new pool from them.
In principle, you can use a ready-made pool directly; you don’t even need to mount it manually. But it’s better to create one or more datasets in “Disks” → ZFS → Datasets → Dataset. The most important thing is that for a dataset you can enable automatic file compression and specify the minimum and maximum limits of available space. Mounting datasets is also not required, but do not forget to specify the correct directory /mnt/pool_name/dataset_name when choosing the path for shared network folders or in other places. As for snapshots, all the necessary functions are located on the “Nuggets” tab in the ZFS section. You can manually create snapshots or entrust automation to create them daily.
To restore data from a snapshot, you need to click on the icon with a wrench next to it, select the copy mode and specify the path to the folder where the files in the format pool_name/dataset_name/folder_name will be transferred. Here you can delete unnecessary snapshots, but keep in mind that before this you need to copy the recovered data, and then delete all clones on the “Copy” tab (translation error, in the original “Clone”). By and large, there is no need to maintain ZFS, but occasionally or in case of any obvious problems, it is worth running the scrub command on existing pools. It checks data integrity, but at the same time creates a very high load on the hardware and is quite slow.
DIY NAS for home
Part two: software Spit in the eyes of anyone who says that you can embrace the immensity of 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 reliable storage. The data must survive a hardware problem, such as disk failure.
The second is to provide 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.
The third is the offline downloading of documents from the network using various protocols.
The fourth is to automate backups from computers on the local network. Family photos, videos, documents you created 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 disappears, 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 ongoing 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 with 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 Write Hole
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 issue can be found here.
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 - data and parity blocks are 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 1013 bytes = 0.96 1014 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 drives have the legal right to fail once every 1·1014 bits on average (see, for example, the WD Red specifications). 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 cause data loss—it causes data loss that goes unnoticed 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.
As the reader has already guessed, further there should be examples of FS with Copy-on-Write. The most well-established is ZFS (in production since 2006), but you can remember Btrfs, awaiting release for Linux, and ReFS, implemented in Windows Server 2012.
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 the corresponding material.
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 most familiar operating system to most people. 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 merits, and make 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 on a specialized website, 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.
Product | CPU | RAM | System storage |
NAS4Free 9.x, with ZFS | x86, x86-64 | minimum 512 MB, 4+ GB recommended | 400 MB (rest available for data) |
NAS4Free 9.x, without ZFS | x86, x86-64 | 256 MB for full, 384 MB for embedded, 512 MB recommended | 400 MB (rest available for data) |
FreeNAS 8.x, with ZFS | x86-64 | 6+ GB | 2 GB or more (will be completely occupied) |
FreeNAS 8.x, no ZFS | x86, x86-64 | 4 GB | 2 GB or more (will be completely occupied) |
OMV | x86, x86-64 | 1 GB | 2 GB or more (will be completely occupied) |
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.
Fig 4. NAS4Free web interface view (more screenshots)
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 is 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 for backup, SCP (SSH), iSCSI target;
- Services: UPnP server (FUPPES - admittedly, mediocre), Webserver (lighttpd), Network bandwitdh measure (Iperf), Bittorent client (Transmission);
- Monitoring: SMART (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 and published detailed setup instructions with pictures. 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 bug fixes was released. The new version uses FreeBSD 9-Stable and, according to the developer, contains significant improvements in the area 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.
Fig 5. View of the FreeNAS 8 web interface (more screenshots)
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 (thread on the iXBT.com forum) 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.
Fig 6. View of the OMV web interface (more screenshots)
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 unRAID, free in the basic version, up to 3 disks, 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. MyNAS is a potentially interesting example. 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 Openfiler, 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 EON. 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.
Fig 7. OpenSolaris rests here (from zdnet.de)
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 includes 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 out there, starting with webmin. But they are less suitable (or not at all suitable) for the purposes discussed. And the author has not encountered them, see epigraph.
ZFSguru
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 napp-it 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. Teaching a scientist only spoils 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 NAS, quite popular in the specialized branch, is called “all-in-one” by 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 forum.ixbt.com, including comrades bormental, Krey, ZanZag, Oleg Pyzhov, Sergei V. 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.
⇡#Other settings
We discussed all other features like access via NetBIOS/FTP, UPnP, torrent client, iTunes server, and so on in last year’s article. So we refer the reader to it for details. The only caveat concerns NetBIOS network shares. For completely free access to them, the easiest way is to select the Anonymous authentication type in the CIFS/SMB service settings and specify the use of the NT1 protocol instead of the “correct” local authorization and SMB2. In an amicable way, of course, you need to create a new group, add users to it, create a separate folder (or dataset) for each of them, denying access to it to everyone except the user himself, and then share it. Well, for the “file dump” in this case, another directory with free access is simply created. If you are using ZFS, it is useful to enable Shadow Copy. This option interacts with the shadow copy service in Windows Vista/7/8 (client for older operating systems), if automatic creation of snapshots is enabled and at least one of them has already been saved. This makes it possible to open earlier versions of modified files.
Installation and configuration on a Windows network
First burn the NAS4Free ISO image onto a CD or DVD, connect the keyboard and monitor to the NAS. A mouse is not needed because the first installation of NAS4Free does not have a GUI. Next, insert the NAS4Free disk into the computer and boot from it. For beginners, installing and configuring NAS4Free is done in detail step by step, and begins with changing the boot order of the device, this will require going to the BIOS screen of the computer.
NAS4Free automatically downloads a compatible device driver for detected hardware. Once the user returns to the screen, they will see that an IP address has been assigned, after which the NAS4Free will be fully booted. If not, you need to find the problem and try again.
By installing the operating system on the hard drive, the user can preserve network information during future reboots without re-configuring. To begin the installation, press the 9 key on your keyboard and then Enter.
On the initial screen, select option 3 and click OK. On the next warning screen, read the prompt and click OK again. Essentially what this says is that NAS4Free will install itself on the first partition and automatically create another partition to use as the data partition. This encourages many users to install the operating system on a USB drive.
Select a source for installation. If you booted NAS4Free from a CD, it will become the source. Then select the disk to install on the first hard drive and the partition size to install the operating system. The required minimum is 380 MB. Finally, you can decide whether to create an exchange section or not. Now that the operating system is installed locally on the hard drive, the user tests it by removing the installation CD and rebooting the computer.
OpenMediaVault
Image credit: OpenMediaVault
OpenMediaVault has a strong NAS pedigree. It has been around since 2009 and was created as a successor to FreeNAS by one of its original developers when that project underwent a major rewrite. It is open source, so it is completely free to use and distribute, and has over 4 million downloads.
Unlike FreeNAS, OpenMediaVault is based on Debian, one of the best Linux distributions
Best Linux Operating Systems and Distributions
Best Linux Operating Systems and Distributions With so many Linux distributions out there, choosing one can be difficult. Here are the best Linux operating systems reviewed. Read more thanks to its stability and active development. Speaking of active development, OpenMediaVault receives minor updates on a monthly basis, with major releases occurring almost every year.
OpenMediaVault and FreeNAS have some crossover features such as storage monitoring, Samba/NFS file sharing, and RAID disk management. However, it does not have some of the more advanced features of FreeNAS, such as hot swapping or the OpenZFS file system. Since it is based on Debian, ext4 is the default file system, but you can install others such as JFS or XFS.
Using Debian as a base means that OpenMediaVault installations can use the large number of available Debian packages. OpenMediaVault doesn't come standard with cloud integration, but you can add it using additional plugins or using the appropriate Debian package.
You can set up a web server, a BitTorrent client, or even a Plex media server if you want, thanks to OpenMediaVault plugins.
There is only one main developer for OpenMediaVault, but others play a small role in patch development and plugin creation. One of the best features of OpenMediaVault compared to FreeNAS is its low system requirements. You can run OMV on low-power devices like Raspberry Pi, where you can combine it with multimedia software like Plex to create a Raspberry Pi Plex server.
Download: OpenMediaVault
Setting up a custom drive
First of all, you need to prepare your hard drive for use. In the login field, enter the username and password for the default NAS4Free installation, that is, admin and nas4free, respectively. If you are using only the NAS4Free version, you can leave the default password unchanged. However, it is better to change the password if the user is sure that he will use NAS4Free on his network. You can change the NAS4Free login password by going to “System” -> “General” and clicking the “Password” tab.
To prepare the disk, go to “Disk” -> “Management”. By default there should be no entries. Click on the blue plus sign on the right. If the user only has one physical hard drive, it is imported there. Therefore, select only one disk and click “Add”.
The next screen notices that the changes have not been approved. You need to click the “Apply changes” button to confirm them.