#!/bin/sh -e . /usr/share/ganeti/extstorage/zfs/defaults.sh # lvremove -f ffzgvg/3e6746a9-cb99-4584-a219-af7e4b5cb5f5.disk0_data.snap if echo $* | grep -q $EXTP_VG ; then while [ ! -z "$1" ] ; do if echo $1 | grep -q $EXTP_VG ; then VOL_NAME=`echo $1 | sed -e "s:$EXTP_VG/::"` # FIXME -e 's/\.snap$/@snap/'` fi shift; done origin=$(zfs_get lv:origin) # destroy snapshot and clone export VOL_NAME $dir/remove if [ ! -z "$origin" ] ; then VOL_NAME=$origin@snap $dir/remove zfs set lv:s='-' $EXTP_ZFS/$origin fi else /sbin/lvm lvrename $* fi