GPFS stands for General Parallel File System, which is a cluster file system developed by IBM, know as the IBM Storage Scale. It allows simultaneous read and write access to a file system or set of file systems from multiple nodes at the same time.
In the last article, we had showed you how to install and configure GPFS file system in RHEL system, today we will show you how to create GPFS cluster file system on RHEL, including NSD stanzafile creation, NSD Disk creation, GPFS file system creation and mounting it
If you are new to GPFS, I recommend reading the GPFS series article listed below:
Part-1 How to Install and Configure GPFS Cluster on RHEL
Part-2 How to Create a GPFS Filesystem on RHEL
Part-3 How to Extend a GPFS Filesystem on RHEL
Part-4 How to Export a GPFS Filesystem in RHEL
Part-5 How to Upgrade GPFS Cluster on RHEL
1) Creating NSD StanzaFile
The mmcrnsd command is used to create cluster-wide names for Network Shared Disks (NSDs) used by GPFS. To do so, you must define and prepare each physical disk that you want to use with GPFS as a Network Shared Disk (NSD). The NSD stanzafile contains the properties of the disks to be created. This file can be updated as needed with the mmcrnsd command and can be provided as input to the mmcrfs, mmadddisk, or mmrpldisk command.
The names generated by the mmcrnsd command are necessary because disks attached to multiple nodes might have different disk device names on each node. The NSD names identify each disk uniquely. This command should be run for all disks used in GPFS file systems.
A unique NSD volume ID is written to the disk to identify that a disk has been processed by the mmcrnsd command. All of the NSD commands (mmcrnsd, mmlsnsd and mmdelnsd) use this unique NSD volume ID to identify and process NSDs. After NSDs are created, GPFS cluster data is updated and available for use by GPFS.
NSD stanzafile Syntax:
Here are the common parameters used in NSD stanzafile.
Where:
device=DiskName – Block device name that you want to define as an NSD.
nsd=NsdName – Specifies the name of the NSD to be created. This name must not already be used as another GPFS disk name, and it must not begin with the reserved string ‘gpfs’.
servers=ServerList – Specifies NSD servers seperate by comma. Define NSDs in primary and secondary orders. It supports up to eight NSD servers in this list.
usage – Specifies the type of data to be stored on the disk. The ‘dataAndMetadata’ is the default for disks in the system pool, which indicates that the disk contains both data and metadata.
failureGroup – Identifies the failure group to which the disk belongs. The default is -1, which indicates that the disk has no point of failure in common with any other disk.
pool=StoragePool – Specifies the name of the storage pool to which the NSD is assigned. The default value for pool is system.
thinDiskType – Specifies the space reclaim disk type
Check if the disk reservation policy is set to 'NO reservation‘ using the sg_persist command. If not, make the necessary changes at VMWare or Storage level.
This is a sample NSD stanzafile created to add a data disk to illustrate this article. Let’s use '2gdata.nsd' as a filename and it will be placed under '/usr/lpp/mmfs'.
Make a Note: It is not mandatory to include all the parameters, so only the required one should be added, the rest of the parameters will use the default value if any.
2) Creating Network Shared Disk (NSD)
The mmcrnsd command is used to create cluster-wide names for NSDs used by GPFS.
After NSD generation, the ‘2gdata.nsd’ file is rewritten and looks like below.
Run mmlsnsd command to check NSD status. It will show the disk name you created and filesystem will show 'free disk' because we didn’t create it.
3) Creating GPFS Filesystem
Use the mmcrfs command to create a GPFS file system. By default, GPFS starting from 5.0 creates a file system with a '4 MiB' block size and an '8 KiB' subblock size for good performance, but the block size can be changed depending on the application workload using the mmcrfs command with the option '-B'.
Make a Note: The block size can also be configured during NSD creation.
Execute the following command to create a GPFS file system.
Use the mmlsfs command to list the attributes of a file system. To check the FS information of '2gdatalv', run: This will show you a lot of information.
Use the necessary switches to get only the required information of the '2gdatalv' file system. To filter only inode size, block size, subblock size, run:
4) Mounting GPFS File System
The mmmount command mounts the specified GPFS file system on one or more nodes in the cluster. If no nodes are specified, the file systems are mounted only on the node from which the command was issued. Use the '-a' switch to mount the GPFS file system on all system in the cluster simultaneously.
If you want to mount multiple file system simultaneously, run:
Finally check the mounted file system using df command as shown below:
Bonus Tips:
After the GPFS file system creation, if you run the ‘mmlsnsd’ command, you can see the file system information as shown below.
Similarly, you can find the file system information in the ‘mmlsconfig’ command output as shown below:
Final Thoughts
I hope you learned how to create a GPFS Cluster File System on a RHEL system.
In this article, we covered GPFS Cluster file system creation, NSD creation and mounting GPFS file system in RHEL.
If you have any questions or feedback, feel free to comment below.
The post How to Create a GPFS Filesystem on RHEL (Part-2) first appeared on 2DayGeek.