Lead Image © vesuv, photocase.com

Lead Image © vesuv, photocase.com

Building a low-powered NAS

Rock and Roll

Article from ADMIN 56/2020
By
Build a network-attached storage box with Rockstor to manage your data.

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).

Figure 1: Note that getting to the above page may first require adding an exception in the browser for the default self-signed certificate.

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].

Figure 2: You can maximize widgets to view them better, although some, like the Disk Activity widget, reveal more information when maximized.

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].

Figure 3: The Rescan button asks Rockstor to find hotplugged drives.

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].

Figure 4: RAID 5 and RAID 6 are not supported in production-ready environments.

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.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus