Stratis to create layered storage in RedHat Enterprise Linux 8

Introduction

Stratis is a new local storage management tool available in RHEL 8, it will help to create layered storage on top of block devices. Stratis will run as a daemon in the name stratisd, as well come with a command-line configuration tool called Stratis-CLI which facilitate users to create, modify or delete pools and file systems.

In Red Hat Enterprise Linux 8 Stratis will be available by installing two packages. Before in RHEL 7.x, we have the BTRFS file system, Red Hat removed BTRFS support in RHEL 8 and provided with Stratis layered storage management system.

To start with Stratis we need to add a number of block devices and create as a single pool, Inside a Stratis pool, multiple numbers of file systems can be created. Stratis cannot be created on top of existing thin-provisioned disks instead we need to use with hard drives, iSCSI, logical volumes, Multipath devices or NVMe.

Once RHEL 8 move from beta to production Stratis will available in CentOS 8 as well. Moreover, Stratis will support only on kernel version greater than 4.14.

More topics on Stratis storage management:

Installing Stratis

Now let us start to install required packages by resolving dependencies.

The package “stratisd” and “stratiscli” will be available from AppStream and few of python dependencies will be downloaded from BaseOS repository. Make sure to create a repo file with BaseOS and AppStream repository entry.

# yum install stratis-cli stratisd -y
or
# dnf install stratis-cli stratisd -y
[root@linuxsysadmins ~]# yum install stratis-cli stratisd -y
 Installed:
   stratis-cli-1.0.0-2.el8.noarch                                 stratisd-1.0.0-2.el8.x86_64                                
   python3-dbus-client-gen-0.3-1.el8.noarch                       python3-dbus-python-client-gen-0.6-2.el8.noarch            
   python3-dbus-signature-pyparsing-0.03-2.el8.noarch             python3-into-dbus-python-0.06-2.el8.noarch                 
   python3-justbases-0.9-6.el8.noarch                             python3-justbytes-0.11-2.el8.noarch                        
   python3-pyparsing-2.1.10-7.el8.noarch                         
 Complete!
 [root@linuxsysadmins ~]# 

Once completed with installing Stratis start and enable the service persistently, By following verify and confirm the status.

# systemctl start stratisd.service
# systemctl enable stratisd.service
# systemctl status stratisd.service
Stratis to create layered storage in RedHat Enterprise Linux 8 1
Stratisd Service Status

List the available disks

We have added with 5 numbers of 2 TB disks, let us list to verify the size. Now we are going to use only 4 disks in this guide, later in the upcoming article “adding the additional disks” the 5th disk will be used.

# lsblk
# fdisk -l
Stratis list the available  block devices
List the available block devices

Free Up the disks to use for Stratis

In case if the disk has any existing old data or headers we need to verify and wipe it off. Replace “sdb” with available disks.

# blkid -p /dev/sdb
# wipefs -a /dev/sdb

List the existing pools and filesystem:

Before creating with any pools and filesystem list and verify.

# stratis blockdev list
# stratis pool list
# stratis filesystem list
Stratis list to verify existing block, pool and fs
List to verify existing block, pool and fs

Create the pool and filesystem

First, let us create and list the pool in the name of “data01_pool“. To create the pool use 4 disks from /dev/sdb to /dev/sde.

# stratis pool create data01_pool /dev/sd[b-e]
# stratis pool list
Stratis to create layered storage in RedHat Enterprise Linux 8 2
Create pool and list it.
  1. The number of disks used to create the pool.
  2. Created pool name.
  3. The total size of the created pool.
  4. Size of the file system created in it.
  5. To list the block devices used in a pool.
  6. Devices name /dev/sda, /dev/sdb etc.
  7. Each size of disks.
  8. Disk showing “In-use” is used and contains data.
  9. Disks tier, whether used for Data or for Cache.

Once the pool created, list and check the block devices used in Stratis pool.

# stratis blockdev list

Now start to create the file system from the “data01_pool” pool.

# stratis filesystem create data01_pool user_data01
# stratis filesystem create data01_pool user_data02

List the created file systems.

# stratis filesystem list
# stratis fs list
Stratis Creating file System
Stratis Creating file System
  1. Creating a file system from a pool.
  2. List the file System.
  3. The Created file system name.
  4. Currently used FS size.
  5. When created.
  6. Device name created for FS.

Mount the created file systems

Once the file system created from the pool, create a mount point and mount the FS. By default, while creating FS it will format it with XFS file system.

# mkdir /user_data01
# mkdir /user_data02
# mount /dev/stratis/data01_pool/user_data01 /user_data01/
# mount /dev/stratis/data01_pool/user_data02 /user_data02/

Create some files inside the mount point and list it again to verify the utilization.

# df -hP /user_data0*
Create mount point and mount the FS
Create a mount point and mount the FS
  1. Created a file system using Stratis.
  2. Size of each mounted file system.

Adding FSTAB entry

Make the mount point persistent across reboot by entering FSTAB entry by getting the UUID of the mounted file system.

# blkid | tail -n 2
[root@linuxsysadmins ~]# blkid | tail -n 2
/dev/mapper/stratis-1-0eaf62ae5c9c4725a3188d7e2a10383e-thin-fs-4e85082029104b0aadd506a440930f3a: UUID="4e850820-2910-4b0a-add5-06a440930f3a" TYPE="xfs"
/dev/mapper/stratis-1-0eaf62ae5c9c4725a3188d7e2a10383e-thin-fs-d5cc59e30aad49da811d7e57f2e1f1e2: UUID="d5cc59e3-0aad-49da-811d-7e57f2e1f1e2" TYPE="xfs"
[root@linuxsysadmins ~]#

Edit the /etc/fstab and amend with UUID to the respective mount point.

# vi /etc/fstab
Stratis to create layered storage in RedHat Enterprise Linux 8 3
FSTAB Entry for mounted FS

Update the systemd unit by running “systemctl daemon-reload”.

Check the Stratis Daemon Version

To check the Stratis running daemon version use.

# stratis daemon version
Stratis to create layered storage in RedHat Enterprise Linux 8 4
Check Stratis Daemon Version

That’s it we have created an XFS file system using Stratis. More topics on Stratis will be covered in upcoming articles.

Conclusion

In this guide, we have seen Stratis local storage management which available in Red Hat Enterprise Linux 8 to create a layered storage pool and filesystem. In upcoming guides let us cover with adding additional disk to the existing pool and removing an fs and pool. Subscribe to our newsletters to receive more topics related to Linux guides, Your valuable comments and critics are most welcome.

One thought on “Stratis to create layered storage in RedHat Enterprise Linux 8

Comments are closed.