Deleting a GlusterFS volume is a final cluster metadata operation for a storage namespace that should no longer be mounted, replicated, or recovered through its volume name. The risky part is confirming that no clients or applications still depend on the volume before the stop and delete prompts remove it from the trusted pool.

The gluster volume stop command takes the volume out of service and makes mounted data paths inaccessible. The gluster volume delete command then removes the volume definition that glusterd stores for the cluster, including the brick layout and volume options.

Deleting the volume does not wipe brick directories from disk. Keep a snapshot, backup, or other recovery path when the data may be needed later, unmount clients first, and only remove brick paths after the volume no longer exists in GlusterFS.

Steps to delete a GlusterFS volume:

  1. List volumes from a cluster node and confirm the exact target name.
    $ sudo gluster volume list
    gvol-data
    gvol-archive
  2. Record the target volume layout and brick paths before stopping it.
    $ sudo gluster volume info gvol-data
    
    Volume Name: gvol-data
    Type: Replicate
    Status: Started
    Number of Bricks: 1 x 2 = 2
    Transport-type: tcp
    Bricks:
    Brick1: node1:/srv/gluster/brick1/gvol-data
    Brick2: node2:/srv/gluster/brick1/gvol-data

    Save the Bricks entries if disk cleanup or recovery checks may be needed after deletion.

  3. Confirm no clients are still connected to the volume.
    $ sudo gluster volume status gvol-data clients
    Brick node1:/srv/gluster/brick1/gvol-data
    Client connections: 0
    
    Brick node2:/srv/gluster/brick1/gvol-data
    Client connections: 0

    Active clients can see application errors when the volume stops. Move workloads away or stop the applications before continuing.

  4. Unmount the volume from every client that still has it mounted.
    $ sudo umount /mnt/gvol-data

    Remove or disable matching /etc/fstab entries and automount units so the retired volume is not mounted again.
    Related: How to mount a GlusterFS volume in Linux

  5. Stop the volume and confirm the prompt.
    $ sudo gluster volume stop gvol-data
    Stopping volume will make its data inaccessible. Do you want to continue? (y/n) y
    volume stop: gvol-data: success

    Stopping the volume makes remaining mounts return I/O errors until the volume is started again or removed from the clients.

  6. Confirm the volume reports Stopped before deletion.
    $ sudo gluster volume info gvol-data
    
    Volume Name: gvol-data
    Type: Replicate
    Status: Stopped
    Number of Bricks: 1 x 2 = 2
    ##### snipped #####
  7. Delete the stopped volume and confirm the prompt.
    $ sudo gluster volume delete gvol-data
    Deleting volume will erase all information about the volume. Do you want to continue? (y/n) y
    volume delete: gvol-data: success

    Deletion removes the volume from GlusterFS management. Use a snapshot or backup for recovery; the volume name and options are no longer available through the cluster.

  8. Verify the volume definition is gone.
    $ sudo gluster volume info gvol-data
    Volume gvol-data does not exist
  9. Remove the recorded brick directories only when disk space must be reclaimed.
    $ sudo rm -rf /srv/gluster/brick1/gvol-data

    Run the cleanup on each brick host only after confirming the recorded path belongs to the deleted volume and is not shared with another volume.