Photo by Lane Smith on Unsplash

Photo by Lane Smith on Unsplash

NAS with Btrfs-based Rockstor

Rock On!

Article from ADMIN 43/2018
By
Set up network-attached storage and manage it from a web interface with Rockstor, the easy-to-install and free Linux distribution that uses the still new Btrfs filesystem.

Even small companies keep data on a central network storage device. All you need to build a network-attached storage (NAS) solution yourself is a server and the free Rockstor [1] operating system, which is tailored for NAS operation and can be installed on the server with just a few mouse clicks. Afterward, you can manage the NAS conveniently in your browser. Clients and users access the network storage via NFS, SMB/CIFS, SFTP, and AFP.

Additional functions can be loaded with optional software packages. Using what are known as Rock-ons, you can easily add ownCloud, thus extending your NAS to provide a private cloud. Rockstor currently only runs on 64-bit processors with x86 architecture or in a virtual machine. Prefabricated NAS servers with an ARM brain therefore cannot be retrofitted with Rockstor.

Based on Btrfs

Rockstor is based on the CentOS 7 Linux distribution with a more recent kernel version provided by the ElRepo project. Thus, compared with CentOS, Rockstor supports some additional hardware components. The individual Rock-ons run in Docker containers, but thanks to the Rockstor web interface, you don't need to be familiar with Linux or Docker.

Most NAS operating systems (e.g., FreeNAS) rely on the ZFS filesystem, but Rockstor uses Btrfs, a filesystem that is replacing the ext4 filesystem in the Linux world and offers a range of functions similar to ZFS but is licensed under the GNU General Public License (GPL). Rockstor harnesses the capabilities of Btrfs for its own purposes. If so desired, the NAS automatically compresses all data in the background. Thanks to flexible volume management, retrofitted hard disks can be integrated quickly.

Moreover, you can expand or reduce the available storage space for each directory on the fly. Snapshots freeze the current data when needed or at specified intervals. Administrators can thus restore a previous state (rollback) at any time. The snapshots use the copy-on-write (CoW) principle, which means that Btrfs does not copy a file until it is actually changed. Snapshots can therefore save considerable storage space compared with an immediate copy of the complete database. Btrfs also uses appropriate measures to prevent data errors (bit rot).

Graphical Installation

If you want to set up NAS with Rockstor, you first need a server with a 64-bit processor from AMD or Intel and at least 2GB of RAM. Installation is easier if Rockstor can simply take over the entire hard disk. Manual partitioning of the disk is possible but a bit cumbersome with the installation wizard. Rockstor also requires a certain partitioning of the hard disk, which in turn requires Linux knowledge. Rockstor itself requires 8GB of hard disk space.

The NAS system also requires an Ethernet interface to access the Internet so that Rockstor can retrieve updates automatically, among other things.

To install Rockstor, download the installation medium from the project homepage [1]. You will receive an ISO image that you burn to a CD or DVD, or you can write to a USB stick with UNetbootin, for example. If you want to support the project, you can order a preconfigured USB stick from the Rockstor shop. In any case, start the server from the installation medium created in this way and press the Enter key in the Rockstor boot menu (choose the Install Rockstor item).

The installation wizard now appears and should look familiar to CentOS users. The installation process varies depending on the situation on the hard disk: If it is completely empty, the installation starts directly without further questions. In this case, click on the Root Password icon and enter a new password for the all-powerful Linux root user. After entering the password twice, click Done and wait for the wizard to copy Rockstor to the hard disk. Restart the system with Reboot , remove the installation medium, and continue reading the "Administration in the Browser" section.

If partitions already exist on the hard disk, the installation wizard offers the Installation Summary page. First click on Date & Time , where you set the local time zone. After setting your choice of language and keyboard setup, if needed, you are done in the Localization section.

Change to the Installation Destination item in the System section. In the top row, the built-in hard disk should already be checked, and thus selected as the installation target. If Rockstor is allowed to use the entire hard disk, the Automatically configure partitioning radio button should be selected below. Now, click on Done in the top left corner and confirm the message with Reclaim space . In the next dialog, delete all partitions by clicking Delete all , followed by Reclaim space . The installation wizard will then create the appropriate partitions itself. Now continue to the "Administration in the Browser" section.

If you want to partition manually, select I will configure partitioning in the Installation Destination dialog and press Done . Rockstor requires at least an 8GB root partition with Btrfs. The list on the left side shows all existing partitions when you expand Unknown . Use plus and minus buttons to add new partitions or delete existing ones. Once you have added a mount point to a partition, it will appear at top left in the list below New Rockstor 3 Installation . When you finish partitioning, click Done and apply the changes by pressing Accept Changes .

However you choose to partition your drive, you'll need to click Network & Host Name in the System section of the Installation Summary page. At the bottom left, the wizard proposes Rockstor as the hostname. You will have to define it later in the Rockstor web interface, anyway, so you can adopt it here now. If another computer is already called Rockstor, enter a different hostname for the NAS in the bottom left corner.

The list contains all currently available network interfaces. With the default settings, Rockstor obtains its IP address by DHCP. If you want to specify a static address, select the corresponding network sections, click Configure and then fill out the configuration in the IPv4 Settings and IPv6 Settings tabs. Usually, all you have to do is set the Method to Manual and then add a new IP address by clicking Add . Save stores the settings.

If the network interfaces have been set up, return by pressing Done and click Begin Installation . The wizard now transfers Rockstor to the hard disk. Meanwhile, click Root Password and give the root user a new password. The wizard warns you if the password is weak. Now click Done (twice if your password is weak), wait until the wizard is finished, and restart the system by pressing Reboot .

Administration in the Browser

After starting Rockstor, only the classic text-based login prompt of a Linux system appears. In the background, the system sets up all the necessary services and starts them up. Just let Rockstor work for a few more seconds; then, use the browser to access the IP address of the Rockstor server from another computer using the encrypted HTTPS protocol. If you do not know the IP address, log in with the root username and password assigned during installation and type the ip addr command; a list of all network interfaces and their respective IP addresses will appear. Log out of root with exit.

If Rockstor fails to access the Internet after booting or if the network configuration is faulty, the necessary services will not launch in the background. However, Rockstor does not show a corresponding error message during the very first boot process – only after a further restart. The only indication of an error is your browser: If it does not want to establish a connection after a few seconds, the network configuration is probably incorrect.

To correct it, log in at the Rockstor login prompt as the root user with the root password and type the nmtui command. A wizard appears that helps you set up network cards. In particular, make sure that Rockstor is connected to the Internet. When you have quit the wizard, restart the system with reboot. From now on, Rockstor should always display the IP address at the login prompt, which you can use to reach the browser user interface. If the server has several network interfaces, the IP address displayed here will probably be the one that Rockstor uses to access the Internet.

If your browser can access Rockstor, you will receive a warning message: Rockstor uses its own self-signed certificate, for which you need to create an exception in the browser. You will then be greeted by the setup wizard. After you have confirmed the license terms, enter a name for the server in the top input box. Finally, you need to set a username and password to access the user interface. The password you set when you installed Rockstor only lets you log in to the underlying Linux system.

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

  • Building a low-powered NAS
    Build a network-attached storage box with Rockstor to manage your data.
  • CentOS 7 (1511) and Rockstor 3.8
    CentOS describes itself as "… a stable, predictable, manageable, and reproducible platform derived from the sources of Red Hat Enterprise Linux (RHEL). Rockstor is a specialty Linux distro designed to support Btrfs-based network-attached storage (NAS) devices.
comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs



Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>
	</a>

<hr>		    
			</div>
		    		</div>

		<div class=