How to Create Stratis Filesystem & Pool in RHEL 8

If you keep track of Linux news and announcement, you must be aware that “Red Hat Enterprise Linux 8” has been available for general use and comes with the facility of Stratis Filesystem, which is basically easy to use tool for your local storage management for Linux. In this tutorial, we will learn how to create Stratis Filesystem and pool. We will also show how to mount it, so keep reading this tutorial.

 

How to Create Stratis Filesystem and Pool in RHEL 8

 

What is Stratis?

Stratis Storage is a local storage management solution for Linux Operating System and aims to ease the work of a system administrator by advance storage options like snapshots, thin provisioning, pool-based management, monitoring, Tiering, etc. apart from being very simple to use.

Stratis is a user-space daemon that configures and monitors existing components from Linux’s device-mapper subsystem, as well as the XFS filesystem. Stratis Pool which is the central attraction of Stratis tool is a collection of one or more local disks or partitions. Once the pool is created, administrators can create volumes.

Currently, Stratis supports block devices based on LVM Logical Volumes, mdraid, dm-multipath, iSCSI, and LUKS (crypto), as well as hard drives, SSDs, and NVMe storage devices.

 

Steps to Create Stratis Filesystem & Pool in RHEL 8

1. First of all, add the new disks for creating the Stratis pool and filesystem or identify the existing block devices based on LVM, iSCSI, multipath, etc.

2. Now, install the stratisd and stratis-cli packages using Yum command. Make sure your repository is already configured.

Syntax: # yum install stratisd.x86_64 stratis-cli.noarch -y

[root@rhel8 ~]# yum install stratisd.x86_64 stratis-cli.noarch -y
Red Hat Update Infrastructure 3 Client Configuration Server 8      1.9 kB/s | 2.1 kB     00:01
Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs)  29 kB/s | 2.8 kB     00:00
Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs)     28 kB/s | 2.3 kB     00:00
Dependencies resolved.
.......................
.......................
OUTPUT TRUNCATED 
.......................
.......................
Installed:
  stratis-cli-1.0.2-1.el8.noarch                           stratisd-1.0.3-1.el8.x86_64                           python3-justbytes-0.11-2.el8.noarch
  python3-into-dbus-python-0.06-2.el8.noarch               python3-dbus-client-gen-0.4-1.el8.noarch              python3-justbases-0.9-6.el8.noarch
  python3-dbus-signature-pyparsing-0.03-2.el8.noarch       python3-dbus-python-client-gen-0.6-2.el8.noarch       device-mapper-persistent-data-0.7.6-1.el8.x86_64
  libaio-0.3.110-12.el8.x86_64                             python3-pyparsing-2.1.10-7.el8.noarch

Complete!
[root@rhel8 ~]#

[root@rhel8 ~]# rpm -qa | grep -i stratis
stratisd-1.0.3-1.el8.x86_64
stratis-cli-1.0.2-1.el8.noarch
[root@rhel8 ~]#

3. Now its time to enable Stratis daemon. You can use ‘systemctl enable‘ command for that.

[root@rhel8 ~]# systemctl enable --now stratisd
[root@rhel8 ~]#
[root@rhel8 ~]# systemctl status stratisd
● stratisd.service - A daemon that manages a pool of block devices to create flexible file systems
   Loaded: loaded (/usr/lib/systemd/system/stratisd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-05-08 06:00:55 UTC; 2s ago
     Docs: man:stratisd(8)
 Main PID: 1542 (stratisd)
    Tasks: 1 (limit: 5003)
   Memory: 812.0K
   CGroup: /system.slice/stratisd.service
           └─1542 /usr/libexec/stratisd --debug

May 08 06:00:55 rhel8 systemd[1]: Started A daemon that manages a pool of block devices to create flexible file systems.
May 08 06:00:55 rhel8 stratisd[1542]: DEBUG libstratis::stratis::buff_log: BuffLogger: pass_through: true hold time: none
May 08 06:00:55 rhel8 stratisd[1542]:  INFO stratisd: Using StratEngine
May 08 06:00:55 rhel8 stratisd[1542]: DEBUG stratisd: Engine state:
May 08 06:00:55 rhel8 stratisd[1542]: StratEngine {
May 08 06:00:55 rhel8 stratisd[1542]:     pools: {},
May 08 06:00:55 rhel8 stratisd[1542]:     incomplete_pools: {},
May 08 06:00:55 rhel8 stratisd[1542]:     watched_dev_last_event_nrs: {}
May 08 06:00:55 rhel8 stratisd[1542]: }
May 08 06:00:55 rhel8 stratisd[1542]:  INFO stratisd: DBUS API is now available
[root@rhel8 ~]#

4. Create Stratis pool with the disks added or identifies in step 1.

Syntax: #stratis pool create my-pool device-1 device-2 device-n

[root@rhel8 ~]# fdisk -l  | grep -i GiB
Disk /dev/xvda: 10 GiB, 10737418240 bytes, 20971520 sectors
Disk /dev/xvdf: 1 GiB, 1073741824 bytes, 2097152 sectors
Disk /dev/xvdg: 1 GiB, 1073741824 bytes, 2097152 sectors

[root@rhel8 ~]# lsblk
NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda    202:0    0  10G  0 disk
├─xvda1 202:1    0   1M  0 part
└─xvda2 202:2    0  10G  0 part /
xvdf    202:80   0   1G  0 disk
xvdg    202:96   0   1G  0 disk
[root@rhel8 ~]#

[root@rhel8 ~]# stratis pool create pool1 /dev/xvdf /dev/xvdg
[root@rhel8 ~]#
[root@rhel8 ~]# stratis pool list
Name     Total Physical Size  Total Physical Used
pool1                  2 GiB               56 MiB
[root@rhel8 ~]#

5. Once our Stratis pool is created, we can create Stratis filesystem and list it.

Syntax: #stratis fs create pool fs

[root@rhel8 ~]# stratis fs create pool1 data
[root@rhel8 ~]#
[root@rhel8 ~]# stratis fs list
Pool Name  Name  Used     Created            Device               UUID
pool1      data  545 MiB  May 08 2019 06:40  /stratis/pool1/data  274cd3a9380b4d2899c8b29345f5458c
[root@rhel8 ~]#

6. Now as Stratis pool and filesystem have been created, let’s mount it under /data_fs and verify it. Please don’t try to create /data dir as it will be already there.

[root@rhel8 ~]# mkdir /data_fs
[root@rhel8 ~]
[root@rhel8 ~]# mount /stratis/pool1/data /data_fs/
[root@rhel8 ~]
[root@rhel8 /]# df -hT /data_fs/
Filesystem                                                                                      Type  Size  Used Avail Use% Mounted on
/dev/mapper/stratis-1-5634019c5ae6439ab5b26a95661245b8-thin-fs-274cd3a9380b4d2899c8b29345f5458c xfs   1.0T  7.2G 1017G   1% /data_fs
[root@rhel8 /]#

Hope you have observed that we did not format the filesystem. Stratis daemon takes care of this for us and creates XFS type filesystem.

Also, by default, it will show filesystem size as 1 TB due to thin provisioning and that size is only virtual and not an actual one. To check the actual size you will have to use Stratis command

 

How to Mount Stratis Filesystem Permanently?

To mount the Stratis filesystem permanently, you will first need to know the UUID of the filesystem. To know the UUID of the filesystem, you can use ‘lsblk’ or ‘blkid’ command as shown below.

[root@rhel8 /]# lsblk --output=UUID /stratis/pool1/data
UUID
274cd3a9-380b-4d28-99c8-b29345f5458c
[root@rhel8 /]#

[root@rhel8 /]# blkid -p /stratis/pool1/data
/stratis/pool1/data: UUID="274cd3a9-380b-4d28-99c8-b29345f5458c" TYPE="xfs" USAGE="filesystem"
[root@rhel8 /]#

Once you have the UUID, just make its entry in /etc/fstab file as shown below.

UUID=274cd3a9-380b-4d28-99c8-b29345f5458c /data_fs/ xfs defaults 0 0

Your /etc/fstab file should looks like below one.

# /etc/fstab
# Created by anaconda on Fri Apr 26 13:56:24 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
UUID=58013e4a-11c0-4195-8fd8-e4b33e5b17d6 /                       xfs     defaults        0 0
# Stratis FS
UUID=274cd3a9-380b-4d28-99c8-b29345f5458c /data_fs/     xfs  defaults  0 0
[root@rhel8 /]#

 

This is how we create Stratis filesystem and pool in RHEL 8.

We are sure, you must have liked this tutorial and if you really do, please share it with your friends and colleagues. Also, do subscribe to our blog and follow us on all the social media channels for more storage tutorials.

Add Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.