Using Stratis to manage local storage in Centos8

Reading guideThis article describes how to add new disks and cache disks to an existing Stratis pool. Add, delete, snapshot and other contents will be introduced below.

System environment

Centos8

Add additional disks to the Stratis pool

Under Stratis management, it is easy to add new block devices to an existing pool. In the setting of the previous article "creating Stratis local storage in Centos (I)", there are four disks in "data01_pool". Now we need to expand the space in the pool by adding new disks. Use the option add data to add a new disk. Next, add "/ dev/sde" disk to the "data01_pool" pool.

[root@localhost ~]# stratis pool list 
Name                       Total Physical   Properties
data01_pool   8 GiB / 1.11 GiB / 6.89 GiB      ~Ca,~Cr
[root@localhost ~]# stratis pool add-data data01_pool /dev/sde 
[root@localhost ~]# stratis pool list 
Name                        Total Physical   Properties
data01_pool   10 GiB / 1.12 GiB / 8.88 GiB      ~Ca,~Cr


It can be seen that in the above figure, 8G is before expansion and 10G is after expansion. Take another look at stratis's block devices:

[root@localhost ~]# stratis blockdev list 

Rename pools and file systems

Stratis has the ability to rename pools or file systems while running without affecting any running settings. Let's rename the current pool name "data01_pool" to "data01_pool_old".

[root@localhost ~]# stratis pool rename data01_pool date01_pool_old


Let's rename the file system. Renaming the file system is similar to renaming the pool:

[root@localhost ~]# stratis fs rename date01_pool_old user_data01 sys_data01

Create a snapshot in Stratis

Stratis can snapshot any file system. Let's take a snapshot of the existing file system in the server. Let's go first_ Write some data in data01:

[root@localhost ~]# touch /user_data01/file{1..100}.txt

Let's take a snapshot:

[root@localhost ~]# stratis fs snapshot date01_pool_old sys_data01 sys_data01_snap


You can see that the snapshot has been generated. Mount / stratis / data01 below_ pool_ old/sys_ data01_ Snap the snapshot to the / mnt directory and check to see if the file exists.

[root@localhost ~]# mount /stratis/date01_pool_old/sys_data01_snap /mnt/

Delete Stratis file system

Before deleting the stratis file system, you need to delete the two file system entries related to stratis in / etc/fstab. I only comment out the following items without deleting them.

Unmount file system:

[root@localhost ~]# umount /user_data01 
[root@localhost ~]# umount /user_data02

Let's start deleting the file system:

[root@localhost ~]# stratis fs destroy date01_pool_old sys_data01
[root@localhost ~]# stratis fs destroy date01_pool_old user_data02
[root@localhost ~]# stratis fs destroy date01_pool_old sys_data01_snap 
[root@localhost ~]# stratis fs destroy date01_pool_old user_data02_snap 

Delete Stratis pool

To delete the Stratis pool, we should delete all the file systems created under it. Otherwise, you will be prompted:

[root@localhost ~]# stratis pool destroy data01_pool_old 
Execution failure caused by:
BUSY: filesystems remaining on pool

Let's delete the pool:

[root@localhost ~]# stratis pool destroy date01_pool_old 
[root@localhost ~]# stratis pool 
Name   Total Physical   Properties

summary

We've seen how to manage Stratis tiered storage by adding disks and renaming them That's how Linux should be learned . The first part of the article: https://www. linuxprobe.com/?p=213444

Added by hyperyoga on Sun, 20 Feb 2022 09:39:57 +0200