Skip to main content
In this lesson, you will learn how to manage layered storage using Stratis—an advanced storage management tool for Linux. Stratis simplifies working with pools of physical storage, making it easier to configure, deploy, and manage complex storage scenarios.
The image is a slide with the text "What Is Stratis?" and describes it as a "storage-management tool for Linux."
Stratis efficiently handles pools of disks or partitions (block devices) and allows you to create volumes within those pools. These pools enable powerful features such as filesystem snapshots, thin provisioning, and tiering.
The image is a diagram illustrating a network of servers connected to databases, labeled "What Is Stratis?" at the top. It shows three servers linked to two databases, suggesting a storage or data management system.
The image is a presentation slide titled "What Is Stratis?" featuring three icons with labels: "Filesystem Snapshots," "Thin Provisioning," and "Tiering."
While similar to LVM, Stratis offers a simpler and more straightforward approach. It utilizes the XFS filesystem for managing file systems.
Do not use traditional XFS command-line tools on filesystems managed by Stratis, as this may lead to unexpected behavior.
The image is a diagram explaining "What Is Stratis?" with sections labeled "Configure," "Deploy," "Manage," and "XFS File System." It includes a warning not to use XFS tools to manage the Stratis filesystem.

Installing and Starting Stratis

If Stratis is not yet installed on your machine, you can easily add it using YUM. Install both the stratisd daemon and the stratis-cli command-line interface. Then, start and enable the Stratis service to run automatically at boot time:

Creating a Storage Pool

After installation, verify that you have one or more available block devices (unmounted and not in use) for creating a storage pool. Use the commands below to create a pool. To create a pool from a single block device:
To create a pool using multiple block devices (for example, /dev/vdc and /dev/vdd), list them on the same command line:
Verify your pool and review its properties:

Creating a Filesystem

Before storing data, you need to create a filesystem within the pool. In the example below, a filesystem named myfs1 is created in the pool my-pool:
After creation, inspect the filesystem details:
This command displays useful information such as the pool name, filesystem name, space usage, creation timestamp, and the device path (commonly in the format /dev/stratis/<pool>/<filesystem>).

Mounting the Filesystem

To access and use the new filesystem, follow these steps:
  1. Create a mount directory:
  2. Open the /etc/fstab file with a text editor (for example, vi):
  3. Add the following line to ensure the filesystem mounts automatically at boot time:
  4. Mount all filesystems defined in /etc/fstab:
You can now use your mounted Stratis filesystem. For instance, to copy a file (/home/aaron/mydata.txt) to the mounted location:

Expanding the Storage Pool

When you need additional space, Stratis allows you to add new block devices to an existing pool easily. For example, to add the block device /dev/vdd to the pool my-pool, execute:
Check the updated pool information after adding the new data device:
Stratis automatically manages filesystem size adjustments when new storage is incorporated.

Creating and Restoring Filesystem Snapshots

Stratis supports the creation of snapshots for filesystems, providing an effective method for backups and recovery. To create a snapshot of myfs1 in the pool my-pool, run:
Verify the snapshot creation by listing the filesystem details:
Both the original filesystem (myfs1) and its snapshot (myfs1-snapshot) should appear.

Using Snapshots for Data Recovery

Filesystem snapshots are a powerful tool for quickly recovering lost or accidentally deleted data.
If you accidentally delete data (for example, /mnt/mystratis/mydata.txt), follow these steps to restore from the snapshot:
  1. Remove the deleted file (if not already deleted):
  2. Rename the current filesystem (e.g., to myfs1-old):
  3. Rename the snapshot to use the original filesystem name:
  4. Unmount and then remount the filesystem:
  5. Verify the recovery:
You should now see that mydata.txt has been restored as part of the recovered filesystem. Stratis snapshots offer an efficient method to back up data and ensure swift recovery in critical situations. This concludes our lesson on managing layered storage with Stratis. For more detailed information and advanced usage, consider reviewing the Stratis documentation and additional Linux storage management resources.

Watch Video

Practice Lab