Reusing GlusterFS Directory

If you want to reuse the same directory for Gluster FS:

# gluster volume create gv0 10.19.8.85:/media/data/gl2
volume create: gv0: success: please start the volume to access data

# gluster volume delete gv0
Deleting volume will erase all information about the volume. Do you want to continue? (y/n) y
volume delete: gv0: success

# gluster volume create gv0 10.19.8.85:/media/data/gl2
volume create: gv0: failed: /media/data/gl2 or a prefix of it is already part of a volume

The reason is Gluster FS leaving some extended attibutes and files around:

# getfattr -d -m"-" /media/data/gl2
trusted.gfid=0sAAAAAAAAAAAQAAQAAQAAAQ==
trusted.glusterfs.dht=0sAAAAAQAAAQAAQAAQ/////w==
trusted.glusterfs.volume-id=0sm+SuzgUiTIaVGD2YBGNYOw==

To fix if, you need to unset them:

# setfattr -x trusted.gfid /media/data/gl2
# setfattr -x trusted.glusterfs.volume-id /media/data/gl2

You may also want to delete any files inside that folder.