don't leave snapshots hanging around
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 26 Jun 2014 12:49:50 +0000 (14:49 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 26 Jun 2014 12:49:50 +0000 (14:49 +0200)
sbin/lvrename

index 8a10502..28dc120 100755 (executable)
@@ -11,6 +11,8 @@ if [ "$EXTP_VG" = "$1" ] ; then
                # rename filesystems with snapshots using clone/promote
                zfs snap  $EXTP_ZFS/$2@$3
                zfs clone $EXTP_ZFS/$2@$3 $EXTP_ZFS/$3
+               zfs promote $EXTP_ZFS/$3  # new zvol is now origin
+               zfs destroy -R $EXTP_ZFS/$3@$3
        )
 else
        /sbin/lvm lvrename $*