How to Extend/Increase VxFS Filesystem in Linux

This is a routine task for Linux/Unix administrator to increase the VxFS filesystem when you are running out of space. It can be done in online safely without any issues.

In this scenario, the Disk Group (DG) already has sufficient free space and we will be simple resizing it.

Refer the following article if you want to create a Veritas Diskgroup (DG), Volume, and VxFS filesystem in Linux.

Step-1: Identifying Filesystem

First, identify the filesystem to be increased/extended using the df command. Also, note down the DiskGroup (DG) and Volume name from the below output, which will be used later.

df -hP /data

Filesystem                  Size  Used Avail Use% Mounted on
/dev/vx/dsk/testdg/testvol  9.0G  76M  8.4G  1%   /data

The above VxFS filesystem size is ‘9.0 GB’ and we would like to extend additionally ‘500MB’ as part of this activity, so post this activity the VxFS size would be '9.5GB'.

As per the above output, the DG name is ‘testdg’ and Volume name is ‘testvol’.

Step-2: Identifying Volume layout types

VxVM allows you to create volumes with the different layout types, so you need to identify the volume layout types in order to find out the exact available free space for given layout types.

The below command shows you the volume layout that you have created: Ours is 'CONCAT' volume.

vxprint -g testdg -htr

Details:

  • vxprint : Command
  • -g : Specifies a group to print
  • testdg : Our DiskGroup (DG) Name
  • -h : Lists record hierarchies
  • -t : Print single-line output records that depend upon the configuration record type.
  • -r : Display related records of a volume containing subvolumes. Grouping is done under the highest level volume.

Step-3: Checking free space in DiskGroup (DG)

To determine how much free space is available for a concatenated volume, run:

vxassist -g testdg maxsize
Maximum volume size: 2031616 (992Mb)

The above output shows that we have '992MB' of free space in the DG. This can be used to create a new volume or extending the existing volume as needed.

For mirror Volume, run:
vxassist -g testdg maxsize layout=mirror

For striped Volume, run:
vxassist -g testdg maxsize layout=striped

Step-4: Increasing VxVM Volume and VxFS Filesystem

The vxresize command allows you to increase/extend VxVM volume and VxFS filesystem in one go: In this scenario, we will be increasing the ‘testvol’ additionally ‘500MB’.

Syntax:
vxresize -b -g [DG_Name] [Volume_Name] +[Size_to_be_Increased(m|g)]

vxresize -b -g testdg testvol +500m

Details:

  • vxresize : Command
  • -b : Perform the resize operation in the background (optional).
  • -g : Limits operation of the command to the given disk group, as specified by disk group ID or disk group name.
  • testdg : Our DiskGroup (DG) Name
  • testvol : Our Volume Name
  • +500M : This volume will be increased additionaly 500MB.

Step-5: Checking Extended VxFS size

Finally, check the extended VxFS of '/data' using the df command:

df -hP /data

Filesystem                  Size  Used Avail Use% Mounted on
/dev/vx/dsk/testdg/testvol  9.5G  76M  8.9G  1%   /data

Conclusion

In this tutorial, we’ve shown you how to increase/extend VxVM Volume and VxFS Filesystem using an existing Diskgroup (DG) in Linux with few easy steps.

If you have any questions or feedback, feel free to comment below.

Kindly support us by sharing this article with wider circle.

About Jayabal Thiyagarajan

Love and like to work with Linux.

View all posts by Jayabal Thiyagarajan

Leave a Reply

Your email address will not be published. Required fields are marked *