
Building a low-powered NAS
Rock and Roll
External drives are a great way to add extra storage quickly and conveniently, but they have drawbacks. For one, their data retrieval capabilities are restricted to the computer to which they are connected. Although this might work for individual users with single PCs, it isn't a practical solution for most people who have a variety of data-consuming devices.
The go-to option for adding more flexibility to your data storage and retrieval policy is a network-attached storage (NAS) solution. With NAS, you can essentially share the storage with everyone on the network. More often than not, a typical NAS setup comprises a specific combination of hardware and software designed to provide file sharing through services such as the Network File System (NFS) and Server Message Block (SMB) protocols.
Although you can pick up a prefabricated NAS box from your favorite computer store, it doesn't take much effort to build one yourself, thanks to distributions like Rockstor, which offers the features and flexibility of commercial NAS minus the cost of proprietary software. Instead of simply pooling together attached disks, Rockstor lets you arrange available space into different RAID configurations and gives you control over how you want to store your data – whether spread across drives or at different levels of redundancy – for an effective backup solution.
A centralized data storage system will be of little use if you can't access the data across different devices. With Rockstor, you can access your data over popular network protocols, including Samba/Common Internet File System (CIFS), Apple Filing Protocol (AFP), NFS, and Secure File Transport Protocol (SFTP). Rockstor can also plug in to an Active Directory, Network Information Service (NIS), or Lightweight Directory Access Protocol (LDAP) directory server on the network.
The best thing about this CentOS-7-based server is its focus on a single filesystem, Btrfs. Thanks to its copy-on-write and snapshot features, Btrfs is considered a strong competitor to FreeBSD's ZFS filesystem. Focusing on Btrfs streamlines the process of creating a share and allows Rockstor to expose the filesystem's capabilities consistently throughout the interface.
Installation
Before you get started you'll have to earmark a computer that will be used as your NAS box. Rockstor has modest requirements and works with any 64-bit computer with at least 2GB of RAM. Remember, however, that these are minimum requirements, and you wouldn't get much performance from such a computer in the real world.
Make sure you choose the appropriate hardware configuration depending on the amount of data you want to house and the number of users that will be using it. Also note that Rockstor requires about 8GB for installation. Again, remember that Rockstor will take over this entire installation drive, and although you can use this drive to store data, the practice is strongly discouraged by the developers. Besides the installation drive, you'll also have to plug in other disks you want to use for storing data.
As with all server software, it's best to install and fiddle around with Rockstor first inside the safe confines of a virtual machine before you unleash it onto a physical computer. The Rockstor developers recommend evaluating it with the Virtual Machine Manager (VMM) [1].
Once you've prepared the real or virtual machine that will be your NAS, head to Rockstor's website and download the latest ISO [2]. After the image has been downloaded, you'll need to transfer it to a USB disk for installation if you are installing Rockstor on a physical machine. Assuming your USB device is mounted at /dev/sdb
, enter:
$ sudo dd if=Rockstor-3.8-9.isoof=/dev/sdbstatus=progress
Once it's done, boot the computer from the disk and navigate to the installer [3]. Rockstor is based on CentOS and uses its default Anaconda installer, which is fairly intuitive. Just make sure that Rockstor picks up the correct disk for installation, and remember to set a strong root password.
First Boot
After the installation is done, you can manage the NAS from its web-based administration interface. Fire up a browser on any computer in the same network as the NAS and enter the IP address of the NAS server. Because this is the first time you are accessing the interface, you'll be asked to name the host and create an admin user (Figure 1).

Save the details and proceed to the admin interface, where you'll now be asked to update to a newer version. Rockstor supports two update channels: the freely available Testing Updates channel that gets updates that haven't been thoroughly tested, and the Stable Updates channel that gets updates that have been tested for use in a production environment but are only available at a yearly subscription fee of £20 (about $26).
For now, select the option to skip updating your installation. You're now at the Dashboard of the administration interface. The Rockstor developers have spent time fine-tuning the interface to make it fairly intuitive. The main components are listed on the top of the interface. The options in the sidebar are contextual and change depending on the selected components (e.g., Storage, System).
The Dashboard (Figure 2) comprises a set of configurable widgets that enable you to keep an eye on various aspects of the NAS, including storage. You can rearrange the widgets by dragging them around the interface and even disable them by toggling their checkbox from the left-hand column. Refer to the project's documentation for more details about the different widgets [4].

Before you can store data on the NAS device, you have to create one or more users. To do this, head to System | Users, click the Add User button, and complete the form to add a new user by entering essential details, such as the username and password. Remember to toggle the checkbox if you want to allow this user to be able to log in to the Rockstor admin interface. You can go with the default options for the other details, such as the login shell for the user.
Add Storage
The first order of business is to take stock of the available storage space. If you haven't already plugged in the extra drives, turn off the NAS server, and connect the drives. Rockstor supports the traditional hard disk drives, the latest solid state drives (SSDs), and even USB drives and SD cards.
To manage disks, head to Storage | Disks (Figure 3). This page will list all the disks attached to the NAS server along with various parameters such as their name and capacity. Please note that Rockstor only works with whole drives, and if a drive has partitions, although it will be listed on the page, it can't be used. To use such a drive you'll have to first wipe the disk from within the interface to remove any partitions [5].

Once your disks are ready, you'll have to assign them to a pool, which in Rockstor is a set of disk drives put together and represented as a single volume. To create a pool, head to Storage | Pools and click on the Create Pool button. In the page that opens (Figure 4), you'll have to enter some details about the pool. After you've chosen a name for the pool, Rockstor will ask you to select a RAID profile. The server supports multiple RAID profiles for data redundancy and each requires a different number of disks. For example, RAID 5 requires a minimum of three disks, whereas RAID 1, which mirrors data across drives, only needs two drives [6].

Next, you'll have to decide whether you want to compress the data housed inside the pool. It's advisable not to enable compression here because if you enable compression at the pool level, it will be applicable on all subsequent shares you carve out of this pool. Instead, for better control, you can choose to enable compression for individual shares that you'll create later.
At the end of the page, you'll see a list of all available disks. You can select multiple disks to attach to the pool. As mentioned earlier, the minimum number of disks you can attach to a pool depends on the RAID level you've selected. You can even attach all the disks to a single pool.
When you add disks to a pool, the server automatically fires up the Btrfs balance process to spread the data evenly across all disks in the pool. To ensure the consistency of the data, Rockstor also lets you initiate a Btrfs scrub operation that will read the data on the disks in a pool, verify checksums, and fix any corruption. You can also schedule the scrub operation on the pools.
Create and Use Shares
The next step is to define a shared folder. Space carved out of a pool is identified as a share, and each share on Rockstor behaves like directories on a desktop distribution. The chief consideration while adding one is whether the NAS will be used by multiple users or a single individual. In case you're going to be sharing the NAS storage space with multiple users, you can define several folders, each with different user permissions.
To add a folder, head to Storage | Shares and click the Create Share button. You'll now have to fill the details in the page that opens to specify the various attributes for the share (Figure 5). The most important ones are the name and size of the share. You'll also have to select the pool under which this share will be created and whether to enable compression on the share. By default, the share will inherit the compression policy from the pool. However, if you did not turn on compression at the pool level, you can now do so while creating a share.

With the users and shared folders set up, you're now ready to share the NAS storage with your network. Rockstor supports several sharing protocols, but I'll use the popular SMB protocol commonly known as Samba, which works across devices. To activate the service, head to Storage | Samba and click the Add Samba Export button. Once again, you are presented a form in which you'll be asked for various details for the share.
First up, use the list of shares pull-down to select the newly created share that you want to export through Samba. Similarly, use the Admin users pull-down list to select the user you created earlier who will have administrative access to this share. The page also has three radio buttons to enable or disable options. The Browsable option should be set to yes so clients can see the exported shares. Similarly, the Guest Ok option should be set to no to restrict access to the share to admin users only. Finally, Read only should be set to no to ensure that users can write data to this share, as well (Figure 6).

Once you've created a network share, you can access the shared folders from anywhere on the network, irrespective of whether they reside on an individual disk or a RAID array. You can either use your file manager's built-in Network feature to access the network shares or enter the IP address of the NAS device in the location area (e.g., smb://192.168.0.11).
You'll be prompted for an admin username and password before you can access the folders, unless of course, you marked them as public when adding them. After the credentials have been verified, Rockstor mounts the shared folder. You can now upload files into the shared folder or delete the ones already on it, just as you would inside a regular folder.
Although I have covered the essentials for deploying a Rockstor-powered NAS, you can do a lot more with the server. Rockstor ships with adequate defaults but offers extensive administration options to help you maintain your installation per your requirements. For instance, you can and should create a backup policy for your shares (see the box titled "Taking Snapshots"). You can also do a lot more with your NAS besides managing files, thanks to the extensive plugins system (see the "Extend Your NAS" box). Rockstor's interface is intuitive enough to encourage exploration, and you can always refer to its extensive online documentation to tweak and customize your installation.