<div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:Arial,&#39;Helvetica Neue&#39;,Helvetica,sans-serif;line-height:19.5px">I am running glusterfs on a 3 node prod server with thinly provisioned LVM-Volumes. My goal is to automate a backup process that is based on gluster snapshots. The idea is basically to run a shell script via cron that takes the snapshot, zips it and moves it to a remote server.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:Arial,&#39;Helvetica Neue&#39;,Helvetica,sans-serif;line-height:19.5px">Backup works, now I do want to test restoring it on a development server with a similar glusterfs setup. My question is, how to restore this image into gluter. Is this simply by replacing the brick, or would I run into conflicts with the volume_id or similar things?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:Arial,&#39;Helvetica Neue&#39;,Helvetica,sans-serif;line-height:19.5px">This is how my script looks like so far:</p><pre style="margin-top:0px;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,sans-serif;word-wrap:normal;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,sans-serif;white-space:inherit">#!/bin/bash

NOW=$(date +%Y%m%d_%H%M%S)
DAY=$(date +%u)

GS_VOLUME=&quot;vol1&quot;
BACKUP_DIR=&quot;/home/user/backup/&quot;
SNAP_NAME=&quot;snap_&quot;$GS_VOLUME&quot;-&quot;$NOW

# create snapshot
gluster snapshot create $SNAP_NAME $GS_VOLUME no-timestamp

# get snapshot volume name
SNAP_VOL_NAME=$(gluster snapshot info $SNAP_NAME | grep &quot;Snap\ Volume\ Name&quot; | sed -e &#39;s/.*S.*:.//g&#39;)
MOUNT_OBJECT=&quot;/dev/vg0/&quot;$SNAP_VOL_NAME&quot;_0&quot;
MOUNT_POINT=&quot;/run/gluster/snaps/$SNAP_VOL_NAME/brick1&quot;

# umount the image
umount $MOUNT_POINT

# create backup
sudo dd if=$MOUNT_OBJECT | lz4c -c &gt; $BACKUP_DIR$SNAP_NAME.ddimg.lz4

# mount image back
mount $MOUNT_OBJECT $MOUNT_POINT
</code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:Arial,&#39;Helvetica Neue&#39;,Helvetica,sans-serif;line-height:19.5px">Thank you in advance for any help on this toppic.</p></div>