Red Hat Enterprise Linux Diagnostics and Troubleshooting
Set up and manage complex storage configurations integrated by the Stratis high-level system.
Outcomes
You should be able to install and configure file systems with the Stratis service.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command confirms that the required hosts for this exercise are accessible and have the required devices for the file system configuration.
[student@workstation ~]$ lab start storage-overview
Instructions
Log in to
serveraand switch to therootuser.[student@workstation ~]$
ssh student@servera...output omitted... [student@servera ~]$sudo -i[sudo] password for student:student[root@servera ~]#Install and enable the Stratis service.
Install the
stratisdandstratis-clipackages.[root@servera ~]#
yum install stratisd stratis-cliEnsure that the
stratisdservice is enabled.[root@servera ~]#
systemctl enable --now stratisd
Create a Stratis pool named
my-poolthat consists of the/dev/vdband/dev/vdcdevices.Wipe devices from any file system, partition table, or RAID signatures.
[root@servera ~]#
wipefs --all /dev/vdb /dev/vdcCreate a Stratis pool.
[root@servera ~]#
stratis pool create my-pool /dev/vdb /dev/vdcVerify the Stratis pool.
[root@servera ~]#
stratis blockdevPool Name Device Node Physical Size Tier my-pool /dev/vdb 1 GiB Data my-pool /dev/vdc 1 GiB Data [root@servera ~]#stratis pool listName Total Physical Properties my-pool 2 GiB / 41.63 MiB / 1.96 GiB ~Ca,~Cr
Create the Stratis file system.
Create the file system in the pool.
[root@servera ~]#
stratis fs create my-pool my-fsConfirm the Stratis file system creation.
[root@servera ~]#
stratis fs list my-poolPool Name Name Used Created Device UUID my-pool my-fs 546 MiB Oct 04 2021 23:47 /dev/stratis/my-pool/my-fsb6588...Create a
/testdirectory and mount the Stratis file system.[root@servera ~]#
mkdir /test[root@servera ~]#mount /dev/stratis/my-pool/my-fs /testVerify the Stratis file system.
[root@servera ~]#
df -h /testFilesystem Size Used Avail Use% Mounted on /dev/mapper/stratis-1-8c1...-thin-fs-b6...1.0T 7.2G 1017G 1% /test
Explore the features of Stratis file systems.
Inspect the file system format type.
[root@servera ~]#
blkid /dev/stratis/my-pool/my-fs/dev/stratis/my-pool/my-fs: UUID="b658..." BLOCK_SIZE="512" TYPE="xfs"Create a snapshot of the file system and verify it.
[root@servera ~]#
stratis fs snapshot my-pool my-fs my-fs-snapshot[root@servera ~]#stratis fsPool Name Name Used Created Device UUID my-pool my-fs 546 MiB Oct 04 2021 23:47 /dev/stratis/my-pool/my-fsb6588...my-pool my-fs-snapshot 546 MiB Oct 05 2021 00:33 /dev/stratis/my-pool/my-fs-snapshot1cf51...Create a test file and use a snapshot as a file system backup.
[root@servera ~]#
echo "Hello, I am a test file" > /test/mytestfile[root@servera ~]#cat /test/mytestfileHello, I am a test fileBack up the current file system state and verify it.
[root@servera ~]#
stratis filesystem snapshot my-pool my-fs my-fs-backup[root@servera ~]#stratis fsmy-pool my-fs 546 MiB Oct 04 2021 23:47 /dev/stratis/my-pool/my-fsb6588...my-pool my-fs-snapshot 546 MiB Oct 05 2021 00:33 /dev/stratis/my-pool/my-fs-snapshot1cf51...my-pool my-fs-backup 546 MiB Oct 05 2021 00:39 /dev/stratis/my-pool/my-fs-backupd25b5...Create a
/bkpdirectory and mount the backup file system on it.[root@servera ~]#
mkdir /bkp[root@servera ~]#mount /dev/stratis/my-pool/my-fs-backup /bkp[root@servera ~]#df -h /bkpFilesystem Size Used Avail Use% Mounted on /dev/mapper/stratis-1-8cc...-thin-fs-d2...1.0T 7.2G 1017G 1% /bkp [root@servera ~]#cat /bkp/mytestfileHello, I am a test fileUse the file system backup to restore the original file system.
Unmount and destroy the file system.
[root@servera ~]#
umount /dev/stratis/my-pool/my-fs[root@servera ~]#stratis filesystem destroy my-pool my-fs[root@servera ~]#stratis fsPool Name Name Used Created Device UUID my-pool my-fs-snapshot 546 MiB Oct 05 2021 00:33 /dev/stratis/my-pool/my-fs-snapshot1cf51...my-pool my-fs-backup 546 MiB Oct 05 2021 00:39 /dev/stratis/my-pool/my-fs-backupd25b5...Use the original file system name to back up the
my-fs-backupsnapshot and mount it on the/testdirectory. Confirm the restore.[root@servera ~]#
stratis filesystem snapshot my-pool my-fs-backup my-fs[root@servera ~]#stratis fsmy-pool my-fs-snapshot 546 MiB Oct 05 2021 00:33 /dev/stratis/my-pool/my-fs-snapshot1cf51...my-pool my-fs-backup 546 MiB Oct 05 2021 00:39 /dev/stratis/my-pool/my-fs-backupd25b5...my-pool my-fs 546 MiB Oct 05 2021 00:53 /dev/stratis/my-pool/my-fsca12d...[root@servera ~]#mount /dev/stratis/my-pool/my-fs /test[root@servera ~]#cat /test/mytestfileHello, I am a test file
Return to
workstationas thestudentuser.[root@servera ~]#
exit[student@servera ~]$exit[student@workstation ~]$