Rockstor — A Btrfs-based NAS distribution

Please consider subscribing to LWN Subscriptions are the lifeblood of LWN.net. If you appreciate this content and would like to see more of it, your subscription will help to ensure that LWN continues to thrive. Please visit this page to join up and keep LWN on the net.

This is the second article in a short series on distributions designed for use in a network-attached storage (NAS) box. The first was a look at OpenMediaVault , a fairly traditional NAS distribution. The subject this time around — Rockstor — is a different beast; its purpose is to make the features of the Btrfs filesystem available behind an easy-to-use, web-oriented management interface.

Given that, by some accounts, Btrfs is still not ready for production use, one might wonder about the wisdom of using it in an NAS box, which, after all, could be the definition of "production use." The Rockstor developers are clearly sensitive to that concern, to the point that they have dedicated an FAQ entry to it: "In our experience, BTRFS has become very reliable. Also, Rockstor confines users from using BTRFS more freely, thus reducing the chances of hitting deep intricate bugs." The Rockstor forums do not contain any reports of data loss as of this writing, which is an encouraging sign. But it is not clear that Rockstor has a lot of users yet, and advice in the project documentation like "so wear your Linux ninja hat to troubleshoot serious data loss problems." might be seen as troubling. Rockstor is probably of most interest to users who want to explore the leading edge and are prepared for the possibility of trouble.

The distribution appears to be built by a small group of developers at a company (Rockstor, Inc.) that hopes to monetize it via support contracts and partnerships with other companies. That, too, could be an area of concern; if Rockstor's commercial plans don't work out, the distribution could end up in an unsupported state. The best defense against that outcome, of course, would be to grow an active development community outside of the corporation; it is not clear that this has happened so far, though. The Rockstor GitHub repository shows commits from four contributors, three of which are listed as employees of the company.

The Rockstor distribution is based on CentOS 7. Given the rapid pace of Btrfs development, one might wonder about using a set-in-stone enterprise-oriented distribution. Rockstor ships a newer kernel than CentOS, though; the 3.5 release tested by your editor runs a 3.17 kernel seemingly taken from ElRepo. Assuming that no bugs are introduced in the newer kernel, a CentOS base should provide the kind of stability that is more than welcome in a storage server. It also allows Rockstor to depend on CentOS to provide the bulk of its security updates.

Installation

The initial installation experience was not entirely pleasant. The installation documentation says that the installation image can be copied to a USB drive and booted from there — as one would expect these days. Nothing your editor tried would render that drive bootable, though. A question on the forum yielded the truth: booting from USB simply does not work. That would have been nice to know before sinking some hours into the attempt.

The acquisition of a cheap USB optical drive was sufficient to get past this problem. Once booted, the CD provides a fairly straightforward, Anaconda-based graphical installation experience. Like OpenMediaVault, Rockstor wants an entire drive for its own use; it will not share a drive with the filesystems it serves. Happily, the small server used as a testing platform has a MicroSD slot on the motherboard; purchasing a 16GB card along with the USB drive enabled an installation that leaves all of the drive bays free for data storage.

Managing Rockstor

Unlike OpenMediaVault, Rockstor uses SSL with its web-based administration interface from the outset. At this point, of course, the user has had no opportunity to install an SSL certificate on the machine, so Rockstor generates its own. That leads to the inevitable "unknown certificate" warnings when first connecting to the new machine — unfortunate, but it would be hard to do better. The warning seems preferable to managing a storage server over an unencrypted connection.

The first step requires the user to agree to the end-user license agreement. It was with some trepidation that your editor went off to see what he was agreeing to, but the actual EULA is sufficiently short and sweet that most users should have little trouble with it.

The administrative interface itself starts with a "dashboard" view with a number of little, constantly updating widgets. The usual information is there, showing parameters like available space, network bandwidth, and CPU usage at a glance. The Rockstor interface also shows I/O bandwidth to the individual storage devices, which is a useful feature.

The first step, naturally, is to set up some filesystems to export to the network. The only available filesystem type is Btrfs, and its use forces a different view of the task than one sees with more traditional filesystems. The first step is to organize the available devices (Rockstor only deals with full drives; no partitioning is available) into "pools" for use. Pools can be set up with any of the usual RAID configurations from standalone drives through RAID6; data compression can also be enabled at this level.

The pool setup process feels a bit fragile at times; it will fail if it looks like the drive is in use for any other purpose. Seemingly the presence of a partition table on the drive is all it takes to block the pool-creation process. Getting around such issues can require some manual command-line work — not the experience that the web interface is meant to provide. The error messages can also be misleading; it claimed that a disk was unusable due to having a Btrfs filesystem on it, when that drive was previously part of an MD RAID setup hosting an ext4 filesystem.

Existing pools can be resized by adding or removing disks. The resizing dialog, though, warns that the pool must be rebalanced manually after adding or removing drives. There is no indication of how to do that rebalancing. So it is safe to say that, for all practical purposes, the pool-resizing functionality in the web interface does not really work yet.

One other place where Rockstor falls a bit short is that it has no support for SMART monitoring of drive health. Drives fail, and anything that can be done to gain some advance warning of a failure can only be welcome. Rockstor's web interface also lacks any sort of power-management configuration for drives.

After at least one pool has been set up, it is time to create "shares," otherwise known as filesystems. Each share draws space from one pool; it can share that space with other filesystems. The space in the pool can be overcommitted if one desires, as long as the relevant filesystems don't all fill at the same time.

A separate "exports" screen controls the exporting of shares to the net; it can manage NFS, CIFS, and Apple (AFP) shares. The NFS screen is simple but straightforward; it allows the specification of a special host that is allowed root access to the filesystem. The CIFS (Samba) screen is also simple; one thing that is lacking here is support for the Samba home directories feature.

If one digs far enough into the "shares" screens, one finds the ability to work with Btrfs snapshots. Taking a snapshot is a simple matter of hitting a button and giving the snapshot a name. Snapshots can be cloned and deleted. There is also a function to roll a filesystem back to a previous snapshot, but that will only work if that filesystem is not exported to the net.

There is a set of screens for managing users and groups. There also appears to be the ability to obtain this information from a NIS or LDAP server on the net. In general, one gets the sense that the Rockstor developers assume that user management will be handled elsewhere.

Command-line administration — sort of

The web interface is nice, but it seems obvious that not all tasks can be accomplished that way currently. Obtaining a shell on the device is easy enough, of course, but one naturally wonders how much command-line work can be done before one runs into conflicts with the Rockstor software. There is, for example, a PostgreSQL database humming away in the background, so there is clearly some significant state being maintained; putting the system in a condition that doesn't match that state is unlikely to lead to pleasant results.

The Rockstor developers seem to have thought of this problem; for that reason, they have provided a command-line interface providing access to a variety of management functions. The documentation says that this interface is entered automatically when an administrative user logs into the server with SSH. That did not happen; an SSH login leads to an ordinary bash prompt. Some digging around turned up the actual interface in /opt/rockstor/bin/rcli , though.

The functionality provided there is useful, and could make the writing of shell scripts easier. Unfortunately, the command-line interface is fragile at best. Various functions don't work and just about any error leads to a Python traceback and the program's untimely demise. Clearly some work is still needed to get this tool into a usable condition.

Closing notes

One interesting feature that your editor was unable to play with is server replication; Rockstor can be configured to automatically replicate filesystems across servers. The Btrfs send/receive feature is used to implement this functionality. If it works as advertised, it is a feature that could prove useful, especially in larger installations.

The web interface advertises an "analytics" function that is supposed to provide information on what is keeping the NFS server busy. It seems to be based on a set of SystemTap probes. Your editor was unable to get it to produce any output, though.

To summarize: Rockstor is an interesting distribution with a number of useful features. It could well serve as the base for a production NAS device. That said, much of this code has the appearance of being rather new and immature. The Rockstor distribution could certainly benefit from a larger group of developers who could round out its functionality and deal with the various glitches. If Rockstor the company survives long enough to build a development community and get that work done, it could have a bright future; this is a project to watch.

