Configure Volume Snapshots for the StorCycle Database - Linux

Before you can install the StorCycle solution, you must configure your system to create volume snapshots for the StorCycle database.

Use the instructions in this section to configure volume snapshots in a Linux environment.

Note: The below steps must be executed as a root user, or prefix commands with sudo as needed.
1. Enable thin pool and snapshot auto-extension

vi /etc/lvm/lvm.conf

2.   Within the activation section find or add these values:

activation {

...

thin_pool_autoextend_threshold = 70

thin_pool_autoextend_percent = 20

...

snapshot_autoextend_threshold = 70

snapshot_autoextend_percent = 20

...

}

3.   Enable periodic block discards:

systemctl enable --now fstrim.timer

4.   Create a physical volume:
a.   Enter the following command:

lsblk

The command returns information similar to the following:

b.   Create a physical volume on the desired storage block devices listed in the previous step.

pvcreate /dev/block storage name

pvdisplay

The command returns information similar to the following:

5.   Create the volume group:

vgcreate vg_mongo /dev/nvme0n2

vgdisplay

The command returns information similar to the following:

6.   Create the logical volume:

lvcreate --size 1G --thin vg_mongo/mongo_pool --virtualsize 100G --name mongo_volume

lvs

The command returns information similar to the following:

7.   Create the filesystem, mount, and enable mount on reboot:

mkfs.xfs /dev/vg_mongo/mongo_volume

mkdir /var/lib/mongo

mount /dev/vg_mongo/mongo_volume /var/lib/mongo

echo '/dev/vg_mongo/mongo_volume /var/lib/mongo xfs defaults 0 2' | tee -a /etc/fstab

8.   Display the block information:

lsblk

The command returns information similar to the following:

9.   Create a test snapshot:

lvcreate --name mongo_snap_test --snapshot /dev/vg_mongo/mongo_volume

10.   Verify the test snapshot creation:

lvdisplay /dev/vg_mongo/mongo_snap_test

The command returns information similar to the following:

11.   Delete the test snapshot:

lvremove /dev/vg_mongo/mongo_snap_test