Skip to content

Instantly share code, notes, and snippets.

@johnko
Last active November 25, 2015 21:43
Show Gist options
  • Save johnko/04051c22cceac1fc85be to your computer and use it in GitHub Desktop.
Save johnko/04051c22cceac1fc85be to your computer and use it in GitHub Desktop.

Revisions

  1. johnko revised this gist Nov 25, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion test.sh
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ zfs snap tank/pool2@b
    echo "snaps are diverged, can we send?"
    zfs send -I tank/pool1@now tank/pool1@a | zfs recv tank/pool2
    echo "maybe we can clone then send?"
    zfs clone tank/pool2 @now tank/poolshared
    zfs clone tank/pool2@now tank/poolshared
    zfs send -I tank/pool1@now tank/pool1@a | zfs recv tank/poolshared
    echo "doesn't look like we can merge diverged snaps. we can only rollback the one we want to destroy or create a new dataset"
    echo "summary list of snaps"
  2. johnko created this gist Nov 25, 2015.
    50 changes: 50 additions & 0 deletions log.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,50 @@
    Script started on Wed Nov 25 20:15:39 2015
    # sh test.sh

    + zfs create tank/pool1
    + zfs snap tank/pool1@now
    + zfs send tank/pool1@now
    + zfs recv tank/pool2
    + hostname
    + zfs snap tank/pool1@a
    + date
    + zfs snap tank/pool2@b
    + echo 'snaps are diverged, can we send?'
    snaps are diverged, can we send?
    + zfs send -I tank/pool1@now tank/pool1@a
    + zfs recv tank/pool2
    cannot receive incremental stream: destination tank/pool2 has been modified
    since most recent snapshot
    + echo 'maybe we can clone then send?'
    maybe we can clone then send?
    + zfs clone tank/pool2@now tank/poolshared
    + zfs send -I tank/pool1@now tank/pool1@a
    + zfs recv tank/poolshared
    cannot receive incremental stream: most recent snapshot of tank/poolshared does not
    match incremental source
    + echo 'doesn'\''t look like we can merge diverged snaps. we can only rollback the one we want to destroy or create a new dataset'
    doesn't look like we can merge diverged snaps. we can only rollback the one we want to destroy or create a new dataset
    + echo 'summary list of snaps'
    summary list of snaps
    + zls -r tank/pool1
    NAME USED REFER CREATION
    tank/pool1@now 64K 96K Wed Nov 25 20:15 2015
    tank/pool1@a 0 96K Wed Nov 25 20:15 2015
    + zls -r tank/pool2
    NAME USED REFER CREATION
    tank/pool2@now 64K 96K Wed Nov 25 20:15 2015
    tank/pool2@b 0 96K Wed Nov 25 20:15 2015
    + zls tank/poolshared
    cannot open 'tank/poolshared': operation not applicable to datasets of this type
    + zl tank/poolshared
    NAME USED AVAIL REFER USEDCHILD USEDSNAP QUOTA CANMOUNT MOUNTED MOUNTPOINT CREATION
    tank/poolshared 8K 591G 96K 0 0 none on yes /tank/poolshared Wed Nov 25 20:15 2015
    + zfs destroy tank/poolshared
    + zfs destroy -r tank/pool1
    + zfs destroy -r tank/pool2
    + exit
    # exit

    exit

    Script done on Wed Nov 25 20:15:54 2015
    23 changes: 23 additions & 0 deletions test.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    #!/bin/sh
    set -x
    zfs create tank/pool1 ; zfs snap tank/pool1@now
    zfs send tank/pool1@now | zfs recv tank/pool2
    hostname > /tank/pool1/file
    zfs snap tank/pool1@a
    date > /tank/pool2/file
    zfs snap tank/pool2@b
    echo "snaps are diverged, can we send?"
    zfs send -I tank/pool1@now tank/pool1@a | zfs recv tank/pool2
    echo "maybe we can clone then send?"
    zfs clone tank/pool2 @now tank/poolshared
    zfs send -I tank/pool1@now tank/pool1@a | zfs recv tank/poolshared
    echo "doesn't look like we can merge diverged snaps. we can only rollback the one we want to destroy or create a new dataset"
    echo "summary list of snaps"
    zls -r tank/pool1
    zls -r tank/pool2
    zls tank/poolshared
    zl tank/poolshared
    zfs destroy tank/poolshared
    zfs destroy -r tank/pool1
    zfs destroy -r tank/pool2
    exit