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.
Related: How to create a GlusterFS snapshot
Related: How to start and stop a GlusterFS volume
$ sudo gluster volume list gvol-data gvol-archive
$ 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.
$ 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.
Related: How to check GlusterFS volume status
$ 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
$ 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.
$ sudo gluster volume info gvol-data Volume Name: gvol-data Type: Replicate Status: Stopped Number of Bricks: 1 x 2 = 2 ##### snipped #####
$ 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.
$ sudo gluster volume info gvol-data Volume gvol-data does not exist
$ 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.