Using Stratis to configure local storage in RHEL 8 and Fedora

What is Stratis ?

One of the new features intoduced in RHEL 8 is the new Local Storage Management tool Stratis. Stratis is a hybrid user-and-kernel local storage management solution that simplifies and eases the task of Initial Configuration of Storage, making changes in the existing configurations such as expansions of volumes/file systems and offers advanced storage features like thin provisioning, pool based management, managing snapshots, tiering and monitoring.

Stratis: Volume-Managing File System(VMF)

Startis is not a traditional file system like ext4, xfs but it is a Volume-Managing filesystem like ZFS and Btrfs. Stratis is based upon the concept of storage pool. The pool is created from one or more local disks or partitions and further volumes are created from the pool. The concept of Pool is common to Linux Volume Manager(LVM).

Components of Stratis Volume

Stratis Volume consists of following components:
  • blockdev: It is the block device such as local disk or disk partitions.
  • pool: pool is created from one or more block devices or disk partitions. Size of the pool is equal to the size of total block devices. For each pool, Stratis creates a directory as /Stratis/pool-name
  • filesystem: From the storage pool, we can create one or more file systems that can be mounted on the system and stores files. File systems are configured as thin provisioned and its size increases with the data stored on it. XFS is the default File system used by Stratis. Filesystems are created in /stratis/pool-name/file-system-name

Supported Storage Devices by Stratis

Below storage devices can be used for Stratis.
  • LVM Logical Volumes
  • iSCSI
  • mdraid
  • Device Mapper Multipath
  • LUKS
  • SSD
  • NVM storage devices
  • hard drives

Software Component

Stratis consists of two software components:
  1. Stratis CLI : Command line interface converts the commands into D-bus API calls to stratisd
  2. Stratis Service – stratisd implements the D-bus interface and monitors and manages the Stratis internal pool

Installation of Stratis

RHEL 8 is distributed with Stratis software components mentioned above. To install Stratis on your system use dnf or yum. DNF (dandified yum) is the latest package manager distributed in RHEL 8.
# dnf install stratisd stratis-cli

Make sure that stratisd service is enabled at boot. Use below command for enabling.
# systemctl enable --now stratisd

Creating a Stratis Pool

For this demo, I have exposed three disks of 1 GB each as shown below. Before creating pool make sure stratis daemon is running and block device used for pool should be at least 1 GB each in size.
Three disks/ block device used for pool creation are as below:
sdb             8:16   0    1G  0 disk 
sdc             8:32   0    1G  0 disk 
sdd             8:48   0    1G  0 disk 
In case, your disk or block device contains partition table or file system, erase them using below command.
# wipefs -a /<devicepath>
Creating Pool 1 using one disk /dev/sdb
# stratis pool create pool1 /dev/sdb

Now, lets create pool2 that will use two disks /dev/sdc and /dev/sdd
# stratis pool create pool2 /dev/sdc /dev/sdd
To list the pools, use below command. As clear from the output we have created two pools of 1 GB and 2 GB respectively.
[root@rhel8beta ~]# stratis pool list
Name     Total Physical Size  Total Physical Used
pool1                  1 GiB               52 MiB
pool2                  2 GiB               56 MiB
[root@rhel8beta ~]# 

Creating a Stratis File System

Now we have two pools ready, out of which we can create a Stratis file system.
# stratis fs create <my-pool> <fs-name>
From pool1, let us create file system 1 named app and using pool2, let us create another file system named database as shown in screenshots below.
To list File systems, run below command.
# stratis fs list

Mounting a Stratis file system

To mount the file system, use the entries that stratis maintains in directory /dev/stratis
# mkdir -p /app
# mount /dev/stratis/pool1/app /app

# mkdir -p /database
# mount /dev/stratis/pool2/database /database
Once mounted, you can check the same using “df” command as shown below. You will notice that new file systems show up as 1 TB, Stratis file systems are formatted with XFS but maintained on behalf of user. They show up in df as the virtual size of the XFS file system and actual usage is less due to thin provisioning.
To make the mount point persistent, add the entry of the same in /etc/fstab file.
You have learned about Stratis, how to install the same and use Stratis to manage local storage on RHEL 8 or Fedora Linux.