<div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:Arial,'Helvetica Neue',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,'Helvetica Neue',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,'Helvetica Neue',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,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',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,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit">#!/bin/bash
NOW=$(date +%Y%m%d_%H%M%S)
DAY=$(date +%u)
GS_VOLUME="vol1"
BACKUP_DIR="/home/user/backup/"
SNAP_NAME="snap_"$GS_VOLUME"-"$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 "Snap\ Volume\ Name" | sed -e 's/.*S.*:.//g')
MOUNT_OBJECT="/dev/vg0/"$SNAP_VOL_NAME"_0"
MOUNT_POINT="/run/gluster/snaps/$SNAP_VOL_NAME/brick1"
# umount the image
umount $MOUNT_POINT
# create backup
sudo dd if=$MOUNT_OBJECT | lz4c -c > $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,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px">Thank you in advance for any help on this toppic.</p></div>