Create a thinly provisioned volume that uses the previously created pool by running the lvcreate command with the --virtualsize and --thin options:

# lvcreate --virtualsize size --thin volgroup/poolname --name volname

For example:

# lvcreate --virtualsize 1G --thin rhs_vg/rhs_pool --name rhs_lv

It is recommended that only one LV should be created in a thin pool.

5.4.1.2. Creating a Thickly Provisioned Logical Volume

Format bricks using the supported XFS configuration, mount the bricks, and verify the bricks are mounted correctly. To enhance the performance of Red Hat Gluster Storage, ensure you read Chapter 20, Tuning for Performance before formatting the bricks.

Important

Snapshots are not supported on bricks formatted with external log devices. Do not use -l logdev=device option with mkfs.xfs command for formatting the Red Hat Gluster Storage bricks.

Run # mkfs.xfs -f -i size=512 -n size=8192 -d su=128k,sw=10 DEVICE to format the bricks to the supported XFS file system format. Here, DEVICE is the created thin LV. The inode size is set to 512 bytes to accommodate for the extended attributes used by Red Hat Gluster Storage.

Run # mkdir /mountpoint to create a directory to link the brick to.

Add an entry in /etc/fstab:

/dev/rhs_vg/rhs_lv /mountpoint xfs rw,inode64,noatime,nouuid 1 2

Run # mount /mountpoint to mount the brick.

Run the df -h command to verify the brick is successfully mounted:

# df -h /dev/rhs_vg/rhs_lv 16G 1.2G 15G 7% /rhgs

If SElinux is enabled, then the SELinux labels that has to be set manually for the bricks created using the following commands:

5.4.2. Using Subdirectory as the Brick for Volume

You can create an XFS file system, mount them and point them as bricks while creating a Red Hat Gluster Storage volume. If the mount point is unavailable, the data is directly written to the root file system in the unmounted directory.

For example, the /rhgs directory is the mounted file system and is used as the brick for volume creation. However, for some reason, if the mount point is unavailable, any write continues to happen in the /rhgs directory, but now this is under root file system.

To overcome this issue, you can perform the below procedure.

During Red Hat Gluster Storage setup, create an XFS file system and mount it. After mounting, create a subdirectory and use this subdirectory as the brick for volume creation. Here, the XFS file system is mounted as /bricks. After the file system is available, create a directory called /rhgs/brick1 and use it for volume creation. Ensure that no more than one brick is created from a single mount. This approach has the following advantages:

When the /rhgs file system is unavailable, there is no longer/rhgs/brick1 directory available in the system. Hence, there will be no data loss by writing to a different location.

This does not require any additional file system for nesting.

Perform the following to use subdirectories as bricks for creating a volume:

Create the brick1 subdirectory in the mounted file system.

# mkdir /rhgs/brick1

Repeat the above steps on all nodes.

Create the Red Hat Gluster Storage volume using the subdirectories as bricks.