How can I reduce or shrink the size of a GFS or GFS2 filesystem on RHEL 5,6,7,8,9?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux Server 5,6,7,8,9 (with the High Availability and Resilient Storage Add Ons)

Issue

  • How can I reduce or shrink the size of a GFS or GFS2 filesystem?
  • How to resize a GFS2 filesystem to a lower size?

Resolution

A GFS or GFS2 cannot be shrunk to a smaller size. There is no supported tool that will shrink a GFS or GFS2 filesystem after it is created with mkfs.gfs2.

  • The only way to decrease a GFS or GFS2 filesystem is to do the following;
    • Create a new GFS or GFS2 filesystem to your preferred size.
    • Copy the contents of the original GFS or GFS2 filesystem to the new GFS or GFS2 filesystem.

Root Cause

  • Red Hat Enterprise Linux does not provide a command which can be used to reduce the size of a GFS or GFS2 filesystem.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments