RHCSA Rapid Track
In this exercise, you will use Stratis to create file systems from pools of storage provided by physical storage devices.
Outcomes
You should be able to:
Create a thin-provisioned file system using Stratis storage management solution.
Verify that the Stratis volumes grow dynamically to support real-time data growth.
Access data from the snapshot of a thin-provisioned file system.
Log in to workstation as student using student as the password.
On workstation, run lab advstorage-stratis start to start the exercise.
This script sets up the environment correctly and ensures that the additional disks on servera are clean.
[student@workstation ~]$lab advstorage-stratis start
From
workstation, open an SSH session toserveraasstudent.[student@workstation ~]$ssh student@servera...output omitted...[student@servera ~]$Switch to the
rootuser.[student@servera ~]$sudo -i[sudo] password for student:student[root@servera ~]#Install the stratisd and stratis-cli packages using the
yumcommand.[root@servera ~]#yum install stratisd stratis-cli...output omitted...Is this ok [y/N]:y...output omitted... Complete!Activate the
stratisdservice using thesystemctlcommand.[root@servera ~]#systemctl enable --now stratisdEnsure that the
stratispool1Stratis pool exists with the block device/dev/vdb.Create a Stratis pool named
stratispool1using thestratis pool createcommand.[root@servera ~]#stratis pool create stratispool1 /dev/vdbVerify the availability of
stratispool1using thestratis pool listcommand.[root@servera ~]#stratis pool listName Total Physical stratispool15 GiB/ 37.63 MiB / 4.96 GiBNote the size of the pool in the preceding output.
Expand the capacity of
stratispool1using the/dev/vdcblock device.Add the block device
/dev/vdctostratispool1using thestratis pool add-datacommand.[root@servera ~]#stratis pool add-data stratispool1 /dev/vdcVerify the size of
stratispool1using thestratis pool listcommand.[root@servera ~]#stratis pool listName Total Physical stratispool110 GiB/ 41.63 MiB / 9.96 GiBAs shown above, the
stratispool1pool size increased when you added the block device.Verify the block devices that are currently members of
stratispool1using thestratis blockdev listcommand.[root@servera ~]#stratis blockdev list stratispool1Pool Name Device Node Physical Size Tier stratispool1 /dev/vdb 5 GiB Data stratispool1 /dev/vdc 5 GiB Data
Add a thin-provisioned file system named
stratis-filesystem1in the poolstratispool1. Mount the file system on/stratisvol. Create a file on thestratis-filesystem1file system namedfile1containing the textHello World!.Create the thin-provisioned file system
stratis-filesystem1onstratispool1using thestratis filesystem createcommand. It may take up to a minute for the command to complete.[root@servera ~]#stratis filesystem create stratispool1 stratis-filesystem1Verify the availability of
stratis-filesystem1using thestratis filesystem listcommand.[root@servera ~]#stratis filesystem listPool Name Name Used Created Device UUID stratispool1stratis-filesystem1546 MiB Mar 29 2019 07:48 /stratis/stratispool1/stratis-filesystem1 8714...e7dbNote the current usage of
stratis-filesystem1. This usage of the file system increases on-demand in the following steps.Create a directory named
/stratisvolusing themkdircommand.[root@servera ~]#mkdir /stratisvolMount
stratis-filesystem1on/stratisvolusing themountcommand.[root@servera ~]#mount /stratis/stratispool1/stratis-filesystem1 /stratisvolVerify that the
stratis-filesystem1volume is mounted on/stratisvolusing themountcommand.[root@servera ~]#mount...output omitted... /dev/mapper/stratis-1-5c0e...12b9-thin-fs-8714...e7db on /stratisvol type xfs (rw,relatime,seclabel,attr2,inode64,sunit=2048,swidth=2048,noquota)Create the text file
/stratisvol/file1using theechocommand.[root@servera ~]#echo "Hello World!" > /stratisvol/file1
Verify that the thin-provisioned file system
stratis-filesystem1dynamically grows as the data on the file system grows.View the current usage of
stratis-filesystem1using thestratis filesystem listcommand.[root@servera ~]#stratis filesystem listPool Name Name Used Created Device UUID stratispool1 stratis-filesystem1546 MiBMar 29 2019 07:48 /stratis/stratispool1/stratis-filesystem1 8714...e7dbCreate a 2Â GiB file on
stratis-filesystem1using theddcommand. It may take up to a minute for the command to complete.[root@servera ~]#dd if=/dev/urandom of=/stratisvol/file2 bs=1M count=2048Verify the usage of
stratis-filesystem1using thestratis filesystem listcommand.[root@servera ~]#stratis filesystem listPool Name Name Used Created Device UUID stratispool1 stratis-filesystem12.53 GiBMar 29 2019 07:48 /stratis/stratispool1/stratis-filesystem1 8714...e7dbThe preceding output shows that the usage of
stratis-filesystem1has increased. The increase in the usage confirms that the thin-provisioned file system has dynamically expanded to accommodate the real-time data growth you created with/stratisvol/file2.
Create a snapshot of
stratis-filesystem1namedstratis-filesystem1-snap. The snapshot will provide you with access to any file that is deleted fromstratis-filesystem1.Create a snapshot of
stratis-filesystem1using thestratis filesystem snapshotcommand. It may take up to a minute for the command to complete.The following command is long and should be entered as a single line.
[root@servera ~]#stratis filesystem snapshot stratispool1 stratis-filesystem1 stratis-filesystem1-snapVerify the availability of the snapshot using the
stratis filesystem listcommand.[root@servera ~]#stratis filesystem list...output omitted... stratispool1stratis-filesystem1-snap2.53 GiB Mar 29 2019 10:28 /stratis/stratispool1/stratis-filesystem1-snap 291d...8a16Remove the
/stratisvol/file1file.[root@servera ~]#rm /stratisvol/file1rm: remove regular file '/stratisvol/file1'?yCreate the directory
/stratisvol-snapusing themkdircommand.[root@servera ~]#mkdir /stratisvol-snapMount the
stratis-filesystem1-snapsnapshot on/stratisvol-snapusing themountcommand.The following command is long and should be entered as a single line.
[root@servera ~]#mount /stratis/stratispool1/stratis-filesystem1-snap /stratisvol-snapConfirm that you can still access the file you deleted from
stratis-filesystem1using thestratis-filesystem1-snapsnapshot.[root@servera ~]#cat /stratisvol-snap/file1Hello World!
Unmount
/stratisvoland/stratisvol-snapusing theumountcommand.[root@servera ~]#umount /stratisvol-snap[root@servera ~]#umount /stratisvolRemove the thin-provisioned file system
stratis-filesystem1and its snapshotstratis-filesystem1-snapfrom the system.Destroy
stratis-filesystem1-snapusing thestratis filesystem destroycommand.[root@servera ~]#stratis filesystem destroy stratispool1 stratis-filesystem1-snapDestroy
stratis-filesystem1using thestratis filesystem destroycommand.[root@servera ~]#stratis filesystem destroy stratispool1 stratis-filesystem1Exit the
rootuser's shell and log out ofservera.[root@servera ~]#exitlogout[student@servera ~]$exitlogout Connection to servera closed.[student@workstation ~]$