ZFS rollback -r nicht mehr rekursiv?

Rakor

Administrator
Teammitglied
Hallo zusammen!

Ich wundere mich gerade als ich ein rollback machen wollte. Ich bin mir ziemlich sicher, dass ich früher einen rekursiven rollback machen konnte (wie ich ja auch meine snapshots rekursiv erzeuge). Aber das scheint nicht mehr zu funktionieren.

In der Manpage von FBSD 9.2 steht in zfs(8) noch bei rollback:
Code:
[...]
-r Recursively destroy any snapshots more recent than the one
specified.
[...]

In der Manpage von FBSD 10.2 steht:
Code:
[...]
The -rR options do not recursively destroy the child snapshots of a
recursive snapshot. Only direct snapshots of the specified filesys-
tem are destroyed by either of these options. To completely roll
back a recursive snapshot, you must rollback the individual child
snapshots.

-r Destroy any snapshots and bookmarks more recent than the one
specified.
[...]

Hab ich da was verpasst? Wieso ist das denn so? Bei beliebig tiefen Datasets macht das ja wenig Spass alle von Hand zurück zu rollen :)
 
Wahrscheinlich wegen Konsistenz zu destroy?

Aber auch bei 9.2 steht:
Code:
By default, the command refuses to roll back to a snapshot
other than the most recent one. In order to do so, all intermediate
snapshots must	be destroyed by	specifying the -r option.

Insofern ist das bei 10.2 eigtl. nur eine Klarstellung. Die Funktion müsste seit jeher dieselbe gewesen sein.
 
Hmm... Du meinst ein rekursiver rollback ging noch nie? Dann hab ich das wohl falsch in Erinnerung
 
Hallo Rakor,

ich benutze immer mein selbstgeschriebenes Perl Skript:

Aufruf über ./zfsrollback.pl [snapshotname nach dem @]

Code:
#! /usr/local/bin/perl -w

$num_args = $#ARGV + 1;
if ($num_args != 1) {
        print "\nUsage: zfsrollback.pl zfs-snapshot name\n";
        exit 1;
}

$arg = $ARGV[0];
@snap = `zfs list -t snapshot`;

foreach $zeile ( @snap ) {
    if ( $zeile =~ /$arg/ ) {
        @splzeile = split " ", $zeile;
        print "\nRollback: $splzeile[0]\n";
        `zfs rollback -r $splzeile[0]`;
        print "\nRollback: $splzeile[0] ... done\n";
        print ""
   }
}

Eventuell hilft Dir das Skript.

Gruß Mardor
 
Willst du wirklich, dass zfsrollback.pl foo auch @foobar zurückrollt?

Normalerweise ist das ein Einzeiler in Shell, da muss man doch nicht Perl bemühen. :)

Code:
#!/bin/sh -u

snap=${1}

zfs list -H -o name -t snapshot \
| grep "@${snap}$" \
| xargs -n 1 -r zfs rollback -r
 
Hallo TCM,

Willst du wirklich, dass zfsrollback.pl foo auch @foobar zurückrollt?
Warum nicht ?

Normalerweise ist das ein Einzeiler in Shell, da muss man doch nicht Perl bemühen.
Das war zu der Zeit als ich mit perl hantiert habe und was ist besser als praxisbeispiele :)

Code:
...
| xargs -n 1 -r zfs rollback -r
Nice, ich habe zwar schon mit xargs hantiert, aber -n 1 erspart ne Schleife ... wirklich nice.

Gruß Mardor
 
Zurück
Oben