Managing storage configuration with stratis

Time:2020-3-6

Introduction to stratis

Stratis is a local management storage solution for integrated management of complex storage configurations. Used to simplify storage configuration initialization and take full advantage of advanced storage features. The core concept of stratis is storage pool, which is built on disk or partition and has the characteristics of file system snapshot, thin configuration and layering. The characteristics of stratis lie in the snapshot and layering of the file system layer.

Stratis component

Stratis mainly consists of the following components

  • Blockdev: block device such as hard disk or hard disk partition
  • Pool: a storage pool consisting of one or more block devices
    The total size of the pool is fixed, equal to the size of the block device. The pool contains most of the stratis layer. Stratis creates a / stratis / my pool / directory for each pool, which contains connections to devices and represents the mapping of the stratis file system in the pool.
  • Filesystem: each storage pool can contain one or more filesystems.
    The file system is thin and has no fixed size. The actual size of the file system changes with the growth of data volume.

Stratis management operation

Installing stratis

$ yum install stratisd stratis-cli
$ systemctl enable --now stratisd

Create a strategy pool on a block device

$ wipe --all bolck-device
$ stratis pool create my-pool block-device

Create a strategy pool on multiple block devices

$ stratis pool create my-pool device-1 device-2

View the stratis pool

$ stratis pool list

Create a structure file system

$ stratis fs create my-pool my-fs
$ stratis fs list my-pool

Mounting the stratis file system

$ mount /stratis/my-pool/my-fs mount-point

Display block device information in stratis file system

$ stratis blockdev

Show pool information in stratis file system

$ stratis pool

Display system information in stratis file system

$ stratis filesystem

Stratis snapshot

In stratis, a snapshot of a file system is also a file system. A snapshot is a regular stratis file system copied from another stratis file system. The snapshot is not associated with its original object in its lifecycle. A snapshot file system can have a longer life cycle than the original system.

Create Snapshot

$ stratis fs snapshot my-pool my-fs my-fs-snapshot

Mount snapshot file system

$ mount /stratis/my-pool/my-fs-snapshot mount-point

Uninstall snapshot

$ umount /stratis/my-pool/my-fs-snapshot

Destroy snapshots

$ stratis filesystem destroy my-pool my-fs-snapshot

Rollback snapshot
1 back up the current system

$ stratis filesystem snapshot my-pool my-fs my-fs-backup

2 uninstall and delete the current system

$ umount /stratis/my-pool/my-fs
$ stratis filesystem destory my-pool my-fs

3 restore with snapshot under current system

$ stratis filesystem snapshot my-pool my-fs-snapshot my-fs

4 mount snapshot system

$ mount /stratis/my-pool/my-fs mount-point

Delete the stratis file system

Unmount file system

$ umount /stratis/my-pool/my-fs

Destroy file system

$ stratis filesystem destory my-pool my-fs

Make sure the file system does not exist

$ stratis filesystem list my-pool

Delete the stratis pool
List pools in the system

$ stratis filesystem list my-pool

Unmount the file system in the pool

$ umount /stratis/my-pool/my-fs-1 /stratis/my-pool/my-fs-2

Destroy file system

$ stratis filesystem destory my-pool my-fs-1 my-fs-2

Destruction pond

$ stratis pool destroy my-pool

Make sure the pool is eliminated

$ stratis pool list