Restore a brick in a GlusterFS replicated volume

I did post a while ago on how to replace a failing brick in a replicated volume. This procedure worked quite well if the disk that is failing is still sort of 'OK'... in the meanwhile I figured out a different approach which is even faster...

Step 1
Stop GlusterFS

Step 2
Unmount the faulty disk

Step 3
Partition the new disk, create a filesystem and mount it

Step 4
Run the following command (enure you set the variables vol and brick to your settings:

(vol=DataVolume; brick=/usr/glusterfs/brick_1; 
setfattr -n trusted.glusterfs.volume-id
-v 0x$(grep volume-id /var/lib/glusterd/vols/$vol/info |
cut -d= -f2 | sed 's/-//g') $brick)

Step 5
Start GlusterFS

Step 6
Start a heal on the archive using the following command:

# gluster volume heal DataVolume full

Step 7
The disk will be repopulated with the data