7

I have some GlusterFS(Version 3.7.11) volumes created and started, after some test, I stopped hand deleted the volumes, but they are still remain in the GlusterFS servers.

For example, I have 3 servers, and bricks saved under /gfs:

[vagrant@gfs-server-2 ~]$ sudo gluster volume create test-vol gfs-server-1:/gfs/test-vol gfs-server-2:/gfs/test-vol gfs-server-3:/gfs/test-vol force
volume create: test-vol: success: please start the volume to access data
[vagrant@gfs-server-2 ~]$ sudo gluster volume start test-vol
volume start: test-vol: success
[vagrant@gfs-server-2 ~]$ mkdir /tmp/test

[vagrant@gfs-server-2 ~]$ sudo mount -t glusterfs gfs-server-1:/test-vol /tmp/test

[vagrant@gfs-server-2 ~]$ sudo touch /tmp/test/`date +%s`.txt
[vagrant@gfs-server-2 ~]$ sudo touch /tmp/test/`date +%s`.txt
[vagrant@gfs-server-2 ~]$ sudo touch /tmp/test/`date +%s`.txt
[vagrant@gfs-server-2 ~]$ sudo touch /tmp/test/`date +%s`.txt

[vagrant@gfs-server-2 ~]$ sudo ls /tmp/test/
1469617442.txt    1469617446.txt    1469617447.txt    1469617449.txt
[vagrant@gfs-server-2 ~]$ ls /gfs/test-vol/
1469617449.txt
[vagrant@gfs-server-2 ~]$ sudo umount /tmp/test

After delete the volume, I can still see the files remain in the GlusterFS servers:

[vagrant@gfs-server-2 ~]$ sudo gluster volume stop test-vol
Stopping volume will make its data inaccessible. Do you want to continue? (y/n) y
volume stop: test-vol: success

[vagrant@gfs-server-2 ~]$ sudo gluster volume delete test-vol
Deleting volume will erase all information about the volume. Do you want to continue? (y/n) y
volume delete: test-vol: success

[vagrant@gfs-server-2 ~]$ ls /gfs/test-vol/
1469617449.txt
sakura_liu
  • 239
  • 2
  • 4
  • 7

4 Answers4

6

gluster volume delete does not delete the data from the back-end, you would need to manually delete them from the bricks. (rm -rf /gfs/test-vol/)

itisravi
  • 3,406
  • 3
  • 23
  • 30
2

To delete the the data from the back-end you need to remove it manually e.g in your case you need to do rm -rf /gfs/test-vol/

atm0sphere
  • 21
  • 6
  • Fastest will be create empty directory: `/home/blanktest` and after `rsync -a --delete blanktest/ /gfs/test-vol/` – rafalkasa Nov 21 '20 at 20:04
2

You can mount the volume at a point for example /mnt/data, then use rm -rf /mnt/data/*. And then remove the volume from gluster.

HY G
  • 185
  • 1
  • 14
-1

Disconnect the mount (umount) the dir. and then force remove the volume. Followed by manually delete the contents in the volume recursively to permanently remove the persistent data in the volume.

vatsa287
  • 127
  • 1
  • 8